Skip to content

feat: Add support for automatic re-auth#1789

Merged
gtema merged 1 commit into
mainfrom
reauth
Jun 11, 2026
Merged

feat: Add support for automatic re-auth#1789
gtema merged 1 commit into
mainfrom
reauth

Conversation

@gtema

@gtema gtema commented Jun 10, 2026

Copy link
Copy Markdown
Owner

When 401 error is returned during the api call the sdk should be able to
automatically re-authenticate since it usually means the authentication
has been revoked (e.g., through password rotation).

Comment thread sdk/core/src/error.rs

/// Session lock poisoned.
#[error("session lock poisoned: {}", msg)]
SessionPoisoned { msg: String },
Comment thread sdk/core/src/error.rs

/// Session lock poisoned.
#[error("session lock poisoned: {}", msg)]
SessionPoisoned { msg: String },
@gtema gtema force-pushed the reauth branch 5 times, most recently from fe8a909 to e6ab772 Compare June 11, 2026 14:56
Restructure the client session architecture to use
Arc<RwLock<SessionContext>> for shared mutable state, enabling
concurrent access and re-auth support:

- Move get_service_endpoint from RestClient to Client/AsyncClient traits
  (by value, not reference; async version awaits)
- Sync client wraps session in Arc<RwLock<SessionContext>>
- AuthHelper trait: change &mut self -> &self, add Send + Sync bounds
- Add SessionPoisoned error variants to OpenStackError and RestError
- Update test clients and API callers to match trait changes
@gtema gtema marked this pull request as ready for review June 11, 2026 16:44
@gtema gtema merged commit 01c897c into main Jun 11, 2026
24 checks passed
@gtema-release-plz gtema-release-plz Bot mentioned this pull request Jun 11, 2026
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