Skip to content

fix(client): honor refresh during initial connect - #233

Merged
un-lock-able merged 3 commits into
stack-rs:auth-enhancementfrom
YuMo12268:fix-refresh-on-connect
Jul 29, 2026
Merged

fix(client): honor refresh during initial connect#233
un-lock-able merged 3 commits into
stack-rs:auth-enhancementfrom
YuMo12268:fix-refresh-on-connect

Conversation

@YuMo12268

Copy link
Copy Markdown

Summary

  • Honor the Client's --refresh option during the initial credential connection.
  • Refresh a valid cached credential directly instead of authenticating it first and refreshing it afterward.
  • When the cached credential is unavailable or rejected, preserve the existing login fallback while requesting a refreshed credential with /login(refresh=true).
  • Preserve the existing Client and Worker behavior when refresh is not requested.

Validation

  • cargo fmt --all
  • cargo clippy --workspace
  • cargo build
  • cargo doc
  • Manually verified with a mock Coordinator that:
    • a valid cached credential with --refresh sends exactly one /refresh request, without /auth or /login;
    • a missing cached credential with --refresh sends one /login request with refresh=true;
    • a rejected cached credential falls back from /refresh to /login with refresh=true;
    • without --refresh, the existing /auth flow remains unchanged.

Comment thread netmito/src/service/auth/cred.rs Outdated
Comment thread netmito/src/service/auth/cred.rs Outdated
@YuMo12268
YuMo12268 requested a review from un-lock-able July 28, 2026 11:44
@un-lock-able
un-lock-able merged commit d0a9541 into stack-rs:auth-enhancement Jul 29, 2026
8 checks passed
@YuMo12268
YuMo12268 deleted the fix-refresh-on-connect branch July 29, 2026 05:21
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.

2 participants