release: prepare 0.2.2#19
Conversation
* fix: refresh expired tokens, confirm destructive deletes, add logout * feat: prepare 0.2.1
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThe PR introduces a logout command, automatic token refresh on stored-token expiry, and confirmation prompts gating destructive delete operations (client, realm, user). A new confirm module provides force-flag and TTY-aware confirmation logic. reqwest defaults are disabled. Realm collection output now serializes consistently as arrays. Version bumped to 0.2.2 with release workflow safety guard. ChangesCore logout and refresh flow with confirmations
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as resolve_bearer_token
participant Store as StoredCredentials
participant Expiry as is_expired
participant Refresh as try_refresh
participant Client as FerriskeyClient
participant Repo as CredentialsRepository
User->>CLI: Bearer token needed
CLI->>Expiry: Check if stored token expired (30s leeway)?
alt Token valid
Expiry-->>CLI: false
CLI-->>User: Return StoredToken
else Token expired
Expiry-->>CLI: true
CLI->>Refresh: Attempt silent refresh
Refresh->>Client: exchange_refresh_token(refresh_token)
Client-->>Refresh: JwtToken
Refresh->>Repo: Save new StoredCredentials
Repo-->>Refresh: Success
Refresh-->>CLI: RefreshedToken
CLI-->>User: Return RefreshedToken
else Refresh unavailable
Refresh-->>CLI: None (expired refresh or server error)
CLI->>CLI: Fall back to client_credentials flow
CLI-->>User: Return new token or NoCredentials error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
logoutcommand to clear stored credentials and end the current session.--force/-fflag to delete operations (realms, clients, users) to bypass confirmation prompts in non-interactive environments.Improvements
Chores