Skip to content

fix(client): scope credential cache by coordinator#230

Open
YuMo12268 wants to merge 2 commits into
stack-rs:user-auth-fixfrom
YuMo12268:credential-cache-coordinator
Open

fix(client): scope credential cache by coordinator#230
YuMo12268 wants to merge 2 commits into
stack-rs:user-auth-fixfrom
YuMo12268:credential-cache-coordinator

Conversation

@YuMo12268

Copy link
Copy Markdown

Summary

  • Scope cached credentials by normalized Coordinator address and username.
  • Keep credentials for the same username on different Coordinators from overwriting each other.
  • Preserve malformed or previous-format credential entries when updating the cache.
  • Document that previous-format credential entries are ignored after upgrade.

Validation

  • cargo fmt --all
  • cargo clippy --workspace
  • cargo clippy --workspace --all-features -- -D warnings
  • cargo build
  • cargo test --workspace
  • cargo doc
  • cd guide && mdbook build
  • Manually verified that:
    • previous-format username:token entries are ignored without panic;
    • credentials for a different Coordinator address are not used for the current Coordinator;
    • logging in writes a new credential entry with coordinator_addr, username, and token;
    • credentials for the same username on different Coordinator addresses can coexist;
    • subsequent auth uses the credential scoped to the current Coordinator.

Notes

  • cargo audit reports existing dependency advisories unrelated to this change.

Comment thread guide/src/guide/client.md Outdated
Alternatively, they can directly specify their username (`-u`) or password (`-p`) during execution.
Once authenticated, the Client will retain their credentials in a file for future use.
Cached credentials are scoped by both the Coordinator address and username, so credentials for the same username on different Coordinators can coexist in the same credential file.
Credential entries written by previous versions do not contain a Coordinator address and are ignored, so users may need to log in again after upgrading.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information doesn't have to be included in the guide. The user doesn't need to know how we store the credentials.

Comment thread netmito/src/service/auth/cred.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants