Repository navigation
Conversation
Add native Keystone v3 password authentication with automatic token acquisition and refresh. Tokens are refreshed with a 2-minute grace period before expiry. The Swift storage URL can be discovered from the Keystone service catalog or provided explicitly. Two authentication modes: - Static token (existing behavior): provide token and endpoint directly - Keystone v3 (new): provide auth_url, username, password, project_name Backward compatible — existing token-based configs continue to work. Reference: https://docs.openstack.org/keystone/latest/api_curl_examples.html
| use std::sync::OnceLock; | ||
|
|
||
| /// Authentication mode for Swift. | ||
| pub enum SwiftAuth { |
There was a problem hiding this comment.
I suggest we implement that logic within reqsign: https://github.com/apache/opendal-reqsign. This way, OpenDAL can focus more on storage-side logic.
There was a problem hiding this comment.
Ok will look into it
There was a problem hiding this comment.
I see that opendal uses v0.16.x branch and main is v0.19.0 should I add it to both ? @Xuanwo
|
Update: I've submitted both PRs to opendal-reqsign:
Both add Once the v0.16.x PR is merged and released, I'll update this PR to |
## Summary - Add `reqsign-openstack-keystone` crate implementing Keystone v3 password authentication - Wire into the `reqsign` umbrella crate behind the `openstack` feature flag - Add CI workflow with mock server integration tests This enables OpenDAL's Swift backend to use reqsign for credential management instead of inline Keystone auth code. Contributes to #685 (`reqsign-swift` checklist item). Context: Xuanwo requested this move during review of [apache/opendal#7216](apache/opendal#7216). ## What's included **Credential types** (`credential.rs`): - `Credential` with token, expiry, and service catalog - `CatalogEntry` / `Endpoint` types with serde deserialization - `endpoint()` and `endpoint_in_region()` for catalog lookup - `SigningCredential` impl with 2-minute expiry grace period **Request signing** (`sign_request.rs`): - `RequestSigner` inserts `X-Auth-Token` header (marked sensitive) **Credential providers** (`provide_credential/`): - `KeystoneCredentialProvider` — POST to `{auth_url}/auth/tokens`, extracts token from `X-Subject-Token` header, parses expiry + service catalog - `EnvCredentialProvider` — reads `OPENSTACK_AUTH_URL`, `OPENSTACK_USERNAME`, `OPENSTACK_PASSWORD`, etc. - `DefaultCredentialProvider` — credential chain (env vars for now) **Testing** (27 tests total): - 16 unit tests covering credential validity, catalog lookup, region filtering, edge cases, serde, auth request building - 11 integration tests with Python mock Keystone server: scoped/unscoped tokens, bad credentials, connection refused, full `Signer` round-trip with token caching, region filtering - Also tested against a production OpenStack Keystone v3 deployment — confirmed token acquisition, timestamp parsing, and service catalog parsing with multiple services and regions ## Test plan - [x] `cargo fmt --all -- --check` - [x] `cargo clippy --workspace --all-targets --all-features -- -D warnings` - [x] `cargo test --workspace --no-fail-fast` (all 27 openstack-keystone tests + full workspace green) - [x] Mock server integration tests via CI workflow - [x] Verified against production Keystone v3 cluster --------- Co-authored-by: Xuanwo <github@xuanwo.io>
|
The upstream dependency is ready. Could you rebase onto (This comment was generated by AI.) |
Summary
auth_url,username,password,project_name,user_domain_name,project_domain_namemeadependency for async mutex (same as other OpenDAL services)Reference: https://docs.openstack.org/keystone/latest/api_curl_examples.html
Test plan