chore(amuleapi): stop exporting credential internals, and correct the API docs - #667
Merged
Merged
Conversation
… doc line Follow-up to the credential-store change. Two symbols were declared in webcommon/Credentials.h with no caller anywhere: kPbkdf2Iterations, which is a tuning constant rather than part of the contract, and IsValidRecord, whose rule is enforced inside LoadCredentialsFile and invoked nowhere else. Both move into the anonymous namespace. An exported symbol with no caller invites the next reader to assume it is load-bearing. The reason IsValidRecord exists — that a record which can never verify has to be rejected at load, because at login it is indistinguishable from a wrong password — now sits on LoadCredentialsFile, where the behaviour is. CredentialsFilePath stays exported but says why: only the tests use it, to assert the path-joining rules without restating them. Also corrects the file table in QUICKSTART-AMULEAPI.md, which still described amuleapi-passwords as holding MD5-hashed passwords. They are salted PBKDF2-HMAC-SHA256 records, cannot be read back, and the file is written by aMule and amuled as well as amuleapi. No behaviour change.
…erences REFERENCE.md reports amuleapi's enabled / port / bind under remote_controls but nothing about whether its admin or guest password is set, which is conspicuous next to the fields that are reported. Say why: the credential file belongs to amuleapi and may live on a different host from amuled, so the daemon's view of it can be the wrong file, and this endpoint is readable by any authenticated role while GET /auth/passwords is admin-only. webserver_guest_enabled is reported because it is a genuine amuled preference, not a fact about another process's file. Also drops the issue references from REFERENCE.md and EVENTS.md. They are parenthetical asides a reader of the published API reference cannot follow up on; that linkage belongs in code comments and PR bodies.
LSalami
added a commit
to LSalami/amule
that referenced
this pull request
Jul 28, 2026
Mechanical rebase to resolve po/ conflicts against master's amule-org#665/amule-org#667 -- no source changes here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #665. No behaviour change.
Unused exports
Two symbols were exported with no caller.
kPbkdf2Iterationsis a tuning constant, not part of the contract;IsValidRecordhas its rule enforced insideLoadCredentialsFileand is invoked nowhere else — not even by a test. Both move into the anonymous namespace. An exported symbol with no caller invites the next reader to assume it is load-bearing.The reason
IsValidRecordexists — a record that can never verify has to be rejected at load, because at login it is indistinguishable from a wrong password — now sits onLoadCredentialsFile, where the behaviour actually is.CredentialsFilePathstays exported but now says why: only the tests use it, to assert the path-joining rules without restating them.Documentation
QUICKSTART-AMULEAPI.mdstill describedamuleapi-passwordsin its file table as holding "MD5-hashed admin and guest passwords". They are salted PBKDF2-HMAC-SHA256 records, cannot be read back, and the file is written by aMule and amuled as well as amuleapi.REFERENCE.mdnow explains whyremote_controlsreports amuleapi'senabled/port/bindbut not whether its passwords are set. The omission is conspicuous next to the fields that are reported, and the reasons are worth stating: the credential file belongs to amuleapi and may live on a different host from amuled, so the daemon's view of it can be the wrong file — and this endpoint is readable by any authenticated role, whereasGET /auth/passwordsis admin-only.webserver_guest_enabledis reported because it is a genuine amuled preference rather than a fact about another process's file.Issue references dropped from
REFERENCE.md(5) andEVENTS.md(1). They are parenthetical asides a reader of the published API reference cannot follow up on; that linkage belongs in code comments and PR bodies.CHANGELOG.mdkeeps its references, where citing issues is the point, as do the build-script comments underpackaging/.Verification
Builds clean;
CredentialsTestandAmuleApiConfigTestpass; clang-format 18 clean; clang-tidy Tier-1 and Tier-2 clean with 0 compiler errors. No translatable strings changed, so no catalog regeneration.