Skip to content

feat(services/swift): add Keystone v3 authentication - #7216

Merged
Xuanwo merged 1542 commits into
apache:mainfrom
benroeder:swift/keystone-auth
Nov 30, 2026
Merged

Xuanwo merged 1542 commits into
apache:mainfrom
benroeder:swift/keystone-auth

Conversation

@benroeder

@benroeder benroeder commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Fixes #7215.

Rationale for this change

Swift users with Keystone v3 currently have to obtain a token, find the Swift account URL and replace the token when it expires. Ben Roeder contributed Keystone authentication and catalog discovery to this PR. The Reqsign port retains his original commit and co-author credit. Keystone authentication examples

What changes are included in this PR?

Swift uses the published reqsign-openstack-keystone 4.0.0 crate and the operation's HTTP transport from #9271 to acquire and refresh project-scoped tokens. Reqsign adds X-Auth-Token to authenticated Swift requests. When Swift discovers the account URL, it uses the endpoint and token from the same credential. Catalog discovery and explicit endpoints both preserve provider errors' retryability.

Swift keeps its TempURL signer until Reqsign publishes presign_until(..., u64). OpenDAL saturates the absolute expiration at u64::MAX, which a real Swift proxy accepted for a SHA-512 presigned PUT. The published Reqsign signer rejects Duration::MAX before dispatch. Reqsign #1146

Verification

  • At f44777e31a, 134 behavior tests passed with a pre-issued TempAuth token and explicit account URL on native Swift SAIO. A separate 134 passed with project credentials and public catalog endpoint discovery on Swift backed by Keystone v3.

  • At f44777e31a, a deterministic provider verified retryability for both endpoint paths. The Java regression verified that the Swift configuration and builder omit the Keystone password, token and TempURL key from toString() and that configMap() preserves their values.

  • On the earlier 86b264b648 candidate, both behavior runs also passed, and a separate live probe observed concurrent reads sharing one token and one refresh within Reqsign’s two-minute refresh window.

  • At c0d79e6b36, the repository-wide taplo format --check passed. The Swift manifest is the only file changed since f44777e31a, and its parsed values are identical.

Are there any user-facing changes?

  • For Keystone v3, set auth_url, username, password and project_name. Both user_domain_name and project_domain_name default to Default. Setting auth_url takes precedence over a static token. Supply endpoint to select the Swift account URL, or omit it to use the public object-store endpoint from the service catalog.
  • Existing static-token configurations use endpoint and token. An endpoint alone still permits anonymous requests, and adding temp_url_key permits presigning.
  • Rust callers can supply credential_provider_chain to override both built-in authentication modes. An explicit endpoint takes precedence here too. Without one, the supplied credential must provide a public object-store endpoint. To read OpenStack environment settings such as OS_AUTH_TOKEN and OS_STORAGE_URL, select Reqsign's DefaultCredentialProvider in that chain.

Breaking changes

AI Usage Statement

The following Pi runs in T3 contributed to the maintainer update. The original contributor’s tooling is unknown.

Model Thinking effort Role
magpie/codex/gpt-6.2-sol max Ported authentication to Reqsign, fixed Java diagnostics and provider retry handling, and replayed and verified the update on current main.
magpie/codex/gpt-6.2-sol high Identified the Java diagnostics and retryability problems in the initial port.
magpie/kimi-code-cn/k3.1-pro high Independently checked the private candidate, including the two regressions.
magpie/codex/gpt-6.2-astra xhigh Coordinated the port and checked the evidence against the tested revisions.
magpie/codex/gpt-6.2-astra high Prepared this description from @benroeder's PR, candidate code and verification records.

@benroeder
benroeder requested a review from Xuanwo as a code owner February 23, 2026 00:59
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Feb 23, 2026
@dosubot

dosubot Bot commented Feb 23, 2026

Copy link
Copy Markdown

Related Documentation

Checked 0 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot Bot added the releases-note/feat The PR implements a new feature or has a title that begins with "feat" label Feb 23, 2026
Comment thread core/services/swift/src/core.rs Resolved
@benroeder

Copy link
Copy Markdown
Contributor Author

Update: I've submitted both PRs to opendal-reqsign:

Both add services-openstack with Keystone v3 password auth, token
caching, service catalog parsing, and request signing. Tested against
a real Keystone cluster.

Once the v0.16.x PR is merged and released, I'll update this PR to
use reqsign for the auth instead of the inline implementation.

Xuanwo added a commit to apache/reqsign that referenced this pull request Oct 22, 2026
## 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>
@Xuanwo

Xuanwo commented Nov 20, 2026

Copy link
Copy Markdown
Member

The upstream dependency is ready. reqsign-openstack-keystone 3.0.0 is published after apache/reqsign#690 merged. OpenDAL main already uses reqsign-core 3.3.3, and S3 uses reqsign-aws-v4 3.4.0 and reqsign-file-read-tokio 3.0.8. Crate release · S3 dependencies

Could you rebase onto main and replace the inline Keystone v3 authentication in services/swift with reqsign-openstack-keystone, following the earlier review? S3 shows how to pass the operation HTTP transport to reqsign. Could you also share updated Swift behavior-test results for the rebased PR against a real Keystone v3 and Swift deployment or a fixture that runs both services? S3 transport integration

(This comment was generated by AI.)

Mola-maker and others added 21 commits November 26, 2026 03:13
* fix(services): reject URI hosts for local path services

cacache, compfs, monoiofs, persy, redb, sled and hf3fs build a local
path from the URI path and ignored the URI host, so `sled://tmp/data`
silently used `/data`. apache#9042 fixed the same problem for fs.

Reject a host other than `localhost` with ConfigInvalid unless the
caller passes the path option explicitly, matching fs. compfs and
monoiofs also let the URI path override an explicit `root` option; keep
the explicit option instead, as fs does.


* fix(services/compfs,monoiofs): keep the URI path ahead of an explicit root

Restore the behavior verified in apache#9044: a nonempty URI path wins over a
conflicting explicit `root` option, so `compfs:///a?root=/b` keeps using
`/a`. Because the path wins, a host next to a path is still dropped and
is rejected; a host is only ignored when the URI has no path and the
explicit `root` is used.


* chore: resynchronize pull request apache#9085

---------

Co-authored-by: Mola-maker <229602071+Mola-maker@users.noreply.github.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
* feat(services/cos): support native multipart copy

* fix(services/cos): validate copy receipts and preserve tags

* fix(services/cos): expose multipart copy limits in the capability catalog
…al versions (apache#9094)

* feat(services/oss): support object restoration

* feat(services/tos): restore deleted objects and historical versions
…he#9079)

* fix(integrations/dav-server): derive an ETag when the backend reports none

OpendalMetaData overrides DavMetaData::etag and returned None when the
OpenDAL metadata had no ETag. That also disabled dav-server's default,
which derives an ETag from the length and modification time. A server
on a backend without ETags, such as fs, sent no ETag in GET, HEAD or
PROPFIND responses, so clients could not use If-Match or If-None-Match
with a real ETag.

Fall back to the same derivation when the backend has no ETag. Invalid
backend ETags are still dropped as before.


* fix(integrations/dav-server): send no ETag when the backend reports none

A tag derived from length and microsecond mtime stays the same when
same-length content is replaced within one microsecond, so a conditional
GET with the old tag returns a stale 304. Drop the derived fallback and
send no ETag when the backend reports none. Native ETags are unchanged.

Add an HTTP regression test on the Fs loopback: after a same-length
replacement with the mtime pinned, the GET carries no ETag and a
conditional GET with the tag the old derivation would have produced
returns the new bytes.

* test(integrations/dav-server): cover Fs responses without ETags

Keep a loopback check for PUT, HEAD, and GET on Fs. When OpenDAL supplies only a modification time, the adapter must not synthesize an ETag. The existing native ETag tests cover normalization separately.

---------

Co-authored-by: Mola-maker <229602071+Mola-maker@users.noreply.github.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
* docs(bindings/dart): show how to run the source checkout and path dependency

* docs(bindings/dart): clarify library placement for path dependencies
…ot (apache#9114)

Detaching the connection for every ambiguous empty listing made the
vsftpd behavior suite take 118s instead of 26s, because each one forced
a reconnect and login.

Change back to the root after a successful CWD and return the
connection to the pool. A 550 reply means the directory is missing and
leaves the working directory unchanged. Any other CWD error is returned
instead of being read as a missing directory. A guard detaches the
connection when such an error occurs, when changing back fails, or when
the future is dropped in between.

Co-authored-by: Mola-maker <229602071+Mola-maker@users.noreply.github.com>
Xuanwo and others added 23 commits November 30, 2026 04:40
…on setup errors (apache#9403)

fix(bindings/cpp): run behavior tests for the configured HDFS Native service
Evaluate the retry flag before composite actions replace the inputs context. Use a completed matching retry to recover the first outcome when the Jobs API reports a tolerated failure as success.
…e#9405)

fix(ci): align remoteStorage cases with binding builds

Forward the service feature selected by the Node.js and Python behavior builds. Keep remoteStorage scheduled for bindings that can enable it. The Java and .NET behavior jobs use the service set compiled into their release libraries.
…onsumers (apache#9406)

fix(bindings/cpp): propagate Rust native libraries on Linux
* feat(bindings/c,go): generate CopyOptions from core

Generate opendal_copy_options, its _new, _free, and _set_* functions,
its conversion to core, and the Go CopyWith* options from core
CopyOptions with the C and Go options generator, as apache#9335, apache#9350,
apache#9368, apache#9379, apache#9385, and apache#9389 did for the other option structs.

The table records today's encodings: if_not_exists as a plain bool,
if_match and source_version as borrowed strings, concurrent as a count,
and source_content_length_hint and chunk as a has_* flag plus a value.
The conversion becomes an unsafe fn with a safety contract instead of a
safe From impl that read raw pointers. The core fields that C and Go do
not expose keep their defaults.

Docs come from core. A Self::x code span uses the binding name of x.
C and Go name their copy and copier functions for concurrent, and drop
the returned metadata from the source_content_length_hint doc, because
C and Go copy calls return no metadata.

No API or ABI change, and no behavior change apart from the panic
message for a copy option string that is not valid UTF-8.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! feat(bindings/c,go): generate CopyOptions from core

State in the # Safety docs of opendal_operator_copy_with,
opendal_operator_copier_with, and their _with_cancel variants that each
non-null string in opts must be a readable, nul-terminated C string until
the call returns, and that a string that is not valid UTF-8 panics, as
the read, stat, delete, and list entry points state.

Drop the zero source_content_length_hint case from TestCopyOptionsReachC,
because TestCopyWithSourceContentLengthHintZero already proves it.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! feat(bindings/c,go): generate CopyOptions from core

Say in each generated C option struct doc that a caller that declares the
struct must initialize every member, because the conversion reads every
member, also one whose has_* member is false, and that the function that
takes the options reads them and their strings only until it returns.

Say that has_x controls whether a flagged value applies, instead of
"Read only when has_x is true", which suggested that an inactive member
can stay uninitialized.

Say that a non-NULL borrowed string must point to a readable,
nul-terminated UTF-8 string, and state on opendal_operator_copier_with
and opendal_operator_copier_with_cancel that the returned copier does not
read the options.

Spell out what a wrong source_content_length_hint does: on s3 with chunk
set, a short hint copies only that many bytes and a long hint fails the
copy, and a service that does not split copies, such as fs, ignores it.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! feat(bindings/c,go): generate CopyOptions from core

Keep only the rule to initialize every member in the shared C struct
docs. The sentence that callers can free the option strings after the
call was wrong for the list start_after and delete version copies, which
the options own, so the member and setter docs keep the ownership and
lifetime rules.

Tie the short destination from a wrong source_content_length_hint to s3
multipart copy: with chunk set, s3 plans parts from the hint only when the
hint is at least the part size, chunk clamped to copy_multi_min_size and
copy_multi_max_size. A smaller hint copies the whole object in one
request.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* docs(bindings/c,go): qualify copy length hint behavior

* fixup! feat(bindings/c,go): generate CopyOptions from core

Regenerate website/data/services.json, which apache#9405 left stale when it
enabled remotestorage in the Python and Node.js bindings, so the
generated-code check passes on this branch.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
Co-authored-by: Xuanwo <github@xuanwo.io>
…ntials (apache#9407)

* fix(services/azblob): presign Blob reads with service principals

Use Reqsign to grant a read-only user delegation SAS for the requested blob. Reuse source credentials and delegation keys within each effective HTTP transport while binding a new grant to each read.

* fix(services/ghac): initialize Azure delegation state for SAS writes

The GHAC v2 upload URL already carries the SAS used by the Azure writer. Initialize the user delegation account as absent and the transport cache as empty for that path.
…pache#9409)

* docs(bindings/c): state the borrowed string rule for write options

State in the # Safety docs of opendal_operator_write_with,
opendal_operator_write_with_metadata, opendal_operator_write_with_cancel,
opendal_operator_writer_with, opendal_operator_writer_with_cancel,
opendal_operator_presign_write_with, and
opendal_operator_presign_write_with_cancel that each non-null string in
opts and each non-null key and value in its user metadata pairs must be a
readable, nul-terminated C string until the call returns, and that a
string that is not valid UTF-8 panics, as the read, stat, delete, list,
and copy entry points state.

State on the writer entry points that the returned writer does not read
the options.

No API, ABI, or behavior change.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! docs(bindings/c): state the borrowed string rule for write options

Say in the user_metadata member, setter, and pair docs that the pairs and
their strings must stay valid until the function that takes the options
returns, as the string member docs say, instead of "until the operation
that uses the options returns". A writer caller could read "operation" as
the writer's whole lifetime, which contradicts the new writer_with rule.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
* docs(core): state that concurrent 0 behaves like 1

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! docs(core): state that concurrent 0 behaves like 1

Scope the parallel-write bullet to concurrent above 1 and add the rule
to the read_with and reader_with builder docs.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
…apache#9416)

docs(services/s3): document destination copy limits on MinIO and Silo

Document the release-specific behavior reported by chitralverma in apache#9413 and the operator override that rejects affected copy options before dispatch. Explain the existing destination copy overrides in the pinned fixture actions.
* feat(bindings/nodejs): expose ListOptions glob from core

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* docs(bindings/nodejs): describe prefix paths in the list method docs

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
* feat(bindings/python): expose the ListOptions glob option

Add a glob keyword argument to Operator.list and AsyncOperator.list,
generated from core ListOptions::glob. The deprecated scan does not take
it.

The ListKwargs docstring comes from core. Python renders Self::recursive
as recursive, and replaces the dropped SimulateLayer sentence with "otherwise
OpenDAL evaluates patterns client-side". A Self:: code span that names a
field Python does not expose now fails generation.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): drop the glob recursion requirement from Python docs

Python cannot turn off recursive list simulation, so a multi-directory
glob with start_after, versions, or deleted never needs
op.capability().list_with_recursive, even when a CapabilityOverrideLayer
reports it as false. Drop that sentence from ListKwargs.glob.

Render ListKwargs on the Sphinx types page, which the list glob
parameter doc points to. Check Self:: code spans after Python drops a
sentence, so a span in a dropped sentence does not fail generation.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): limit the glob doc rewrite to the recursion sentence

The ListOptions rewrite matched the first word of the next sentence, so
rewording core's error sentence alone failed generation. Match only the
list_with_recursive sentence, and check that the ConfigInvalid sentence
comes from core.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
…ge from core (apache#9417)

* feat(bindings/nodejs): expose WriteOptions expires and content_language from core

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* test(bindings/nodejs): keep one contentLanguage test and widen the expires margin

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
…ge (apache#9418)

* feat(bindings/python): expose WriteOptions expires and content_language

Add keyword-only content_language and expires arguments to
Operator.write and AsyncOperator.write, generated from core
WriteOptions. open() accepts both in write modes. Read modes raise
TypeError for both unless the value is None.

expires takes a datetime.timedelta, the type that the default_ttl
config it overrides takes. presign_write does not take either field.

The docstrings come from core. A Metadata::x code span now reads as
Metadata.x, the property that stat() returns.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): check expires pass-through without waiting for expiry

Core behavior tests already check that writes expire. The binding tests
now check that write() and open() pass expires to core: a positive value
writes, and zero raises ConfigInvalid from write() and from close(). No
test waits for a TTL.

The open() TypeError docs now name a value that an option cannot take,
such as a negative expires.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): accept None for expires and content_language in WriteKwargs

open() takes **kwargs: Unpack[OpenKwargs], and OpenKwargs inherits
WriteKwargs. The runtime and the write() stubs accept None for both
options, but the WriteKwargs types did not, so mypy and pyright rejected
open(..., expires=ttl) with an optional ttl.

Render both types with | None. A KWARGS_ACCEPT_NONE entry that names no
generated keyword argument fails generation. The typing test covers the
sync and async open() calls.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
* feat(core): add compose to blocking::Operator

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! feat(core): add compose to blocking::Operator

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fixup! feat(core): add compose to blocking::Operator

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
…re (apache#9420)

* feat(bindings/nodejs): expose StatOptions version conditions

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/nodejs): expose the remaining ReadOptions and ReaderOptions fields

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/nodejs): expose WriteOptions and DeleteOptions version conditions and ifNotChanged

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/nodejs): accept CopyOptions and RenameOptions on copy and rename

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/nodejs): add restore and accept DeleterOptions on remove

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/nodejs): describe restore without a version and keep the bytes_range doc

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* docs(bindings/nodejs): make the copy, rename, and restore examples run as written

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* docs(bindings/nodejs): check for a version before the restore examples overwrite the file

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
…ete_many concurrency (apache#9421)

* feat(bindings/python): expose StatOptions version conditions

Add keyword-only if_version_match and if_version_not_match to sync and
async stat(), generated from core StatOptions. StatKwargs accepts None
for both. presign_stat does not take them.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): expose ReadOptions limit, version conditions, and content_length_hint

read() takes keyword-only limit, if_version_match,
if_version_not_match, and content_length_hint, generated from core
ReadOptions. open() in read mode forwards the version conditions and
content_length_hint to core ReaderOptions. It raises TypeError for a
limit other than None, because ReaderOptions has no limit. read()
raises ValueError for limit with a positive prefetch, because the
prefetch path builds a reader.

ReadKwargs accepts None for the four new keys.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): expose DeleteOptions conditions

delete() takes keyword-only if_none_match, if_version_match,
if_version_not_match, and if_not_changed, generated from core
DeleteOptions. if_not_changed takes a Metadata that stat() or list()
returned. delete() now always calls core delete_options; core delete()
is delete_options with default options.

delete_many() also takes (path, options) pairs, where options holds
delete() keyword arguments, so each entry of a batch keeps its own
conditions. An unknown option key raises TypeError before any deletion.
options.py adds DeleteEntry for the entry type.

DeleteKwargs accepts None for the four new keys.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): expose WriteOptions version conditions and if_not_changed

write() and open() in write modes take keyword-only if_version_match,
if_version_not_match, and if_not_changed, generated from core
WriteOptions. if_not_changed takes a Metadata that stat() or list()
returned. Read modes of open() raise TypeError for if_not_changed
unless it is None.

WriteKwargs accepts None for the three new keys.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): expose the remaining CopyOptions fields

copy() takes keyword-only if_match, if_none_match, if_version_match,
if_version_not_match, if_not_changed, source_version, user_metadata,
content_type, content_language, source_content_length_hint,
concurrent, and chunk, generated from core CopyOptions. if_not_changed
takes a Metadata that stat() or list() returned.

The docs name copy() arguments source and target, and drop core's
returned-metadata wording, because copy() returns None.

CopyKwargs accepts None for the twelve new keys.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): expose DeleterOptions concurrent on delete_many

delete_many() takes keyword-only concurrent, generated from core
DeleterOptions. It now builds the deleter with core deleter_options,
then deletes the entries and closes the deleter, as core delete_iter
does with default options.

DeleterKwargs accepts None for concurrent.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* feat(bindings/python): add restore with RestoreOptions

Operator.restore and AsyncOperator.restore restore a path from its
latest deleted state, or restore a selected version, through core
restore_options. They take keyword-only version and if_not_exists,
generated from core RestoreOptions.

RestoreKwargs accepts None for both keys.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* test(bindings/python): type-check the new optional keyword arguments

The typing test passes None for the new keys through OpenKwargs, takes
(path, DeleteKwargs) pairs in delete_many, and calls restore, under mypy
--strict and pyright strict.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): resolve Metadata hints and pin keyword forwarding

options.py imported Metadata only for type checkers, so
typing.get_type_hints() raised NameError for WriteKwargs, DeleteKwargs,
CopyKwargs, and OpenKwargs, which main resolves. Import it at runtime;
a test resolves the hints of every *Kwargs.

A dev test checks that each operator method sets every options field
that one of its keyword arguments names from that keyword argument, so
a dropped execution hint such as copy concurrent fails the build.

The open() docs name content_length_hint as a case that skips the
first stat, the read() docs say that a short hint returns fewer bytes,
and the restore() docs list the exceptions it raises.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): keep delete_many path order, type open() limit as None, return None from restore

delete_many() parsed every tuple entry as a (path, options) pair, so a
tuple subclass with __fspath__ deleted its first item instead of its
path. It now converts each entry as a path first, as main does, and
reads a pair only when that fails.

OpenKwargs inherited limit: int | None from ReadKwargs, so type
checkers accepted open(..., limit=4), which open() rejects in every
mode. OpenKwargs now lists the read and write keys itself and types
limit as None. Generation fails when the read and write keys of the
same name have different types.

AsyncOperator.restore() resolved to () on success. It now resolves to
None, as its stub says.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): read delete_many pairs only from tuples without __fspath__

delete_many() tried a (path, options) pair after any path conversion
error, so a tuple whose __fspath__ raised, or returned bytes or an int,
was deleted as a pair instead of failing as on main. A tuple is now a
pair only when its type has no __fspath__, the lookup that os.fspath
uses; every other entry converts as a path, as on main, and its error
reaches the caller before any deletion.

Signed-off-by: Chitral Verma <chitralverma@gmail.com>

* fix(bindings/python): preserve special path lookup in delete_many

Find __fspath__ in the type namespaces before parsing a tuple subclass as a delete entry. Let PyO3 bind the path method and propagate its conversion errors.

Signed-off-by: Xuanwo <github@xuanwo.io>

---------

Signed-off-by: Chitral Verma <chitralverma@gmail.com>
Signed-off-by: Xuanwo <github@xuanwo.io>
Co-authored-by: Xuanwo <github@xuanwo.io>
…vider (apache#9271)

* feat(services)!: upgrade reqsign to 0.21 and sign through a CryptoProvider

reqsign 0.21 (reqsign-core 4.0) no longer bundles a crypto implementation:
every signature resolves a `CryptoProvider` from the signing `Context`, or
from the process-wide provider installed with
`reqsign_core::crypto::install_default`, and fails with `ConfigInvalid`
when neither is set.

- Bump every reqsign crate to its 0.21 release line.
- Add `opendal_core::raw::reqsign_context()`, used by all signing services
  (s3, azblob, azdls, azfile, cos, gcs, gcs-grpc, ghac, obs, oss, tos) in
  place of `reqsign_core::Context::new()`. It binds reqsign's RustCrypto
  provider only when no process-wide provider is installed, the same rule
  the reqsign facade uses for `default_context()`.
- Add the `reqsign-rustcrypto` feature (on by default in `opendal`).
  Applications that sign with another provider, such as
  reqsign-crypto-boring, disable it and install their provider at startup;
  RustCrypto, sha1, hmac and rsa then leave the dependency graph.

The reqsign crates are patched to apache/reqsign main until 0.21 is on
crates.io.


* fix: enable a crypto provider in every in-tree signing build

- Enable `reqsign-rustcrypto` in builds that use `opendal` without default
  features and a signing service: the `s3_read_on_wasm` edge test and the
  Java binding.
- Add a default-on `reqsign-rustcrypto` feature to `object_store_opendal`,
  matching `opendal`.
- Move the temporary reqsign patch from `core/Cargo.toml` to the repository's
  `.cargo/config.toml`, so the bindings and integrations, which are separate
  workspaces, also build against reqsign main. It's removed once reqsign 0.21
  is on crates.io.
- Format the service manifests with taplo.


* chore: refresh committed lockfiles for the reqsign patch

- bindings/ruby: bump `ctutils` to 0.4.8, which `crypto-bigint` 0.7 (via
  `rsa` 0.10 in reqsign-crypto-rustcrypto) requires.
- dev, examples/rust/fips-tls and fixtures/webdav/dav-server: record the
  repository-wide reqsign patch as unused, so `--locked` builds pass.

Both changes go away with the patch once reqsign 0.21 is on crates.io.


* test(bindings/java): follow reqsign's S3 presign lifetime limits

reqsign 0.21 rejects SigV4 presigned URL lifetimes outside 1 to 604800
seconds (apache/reqsign#1059). Check the encoded boundaries at those limits,
and check that durations the binding accepts but S3 does not (zero and
`Long.MAX_VALUE` nanoseconds) reach the signer and fail there.


* fix(core): report a missing reqsign crypto provider as ConfigInvalid

Signing without the reqsign-rustcrypto feature and without a process-wide
CryptoProvider now fails with ErrorKind::ConfigInvalid. The message names
both remedies. The upgrade guide documents the reqsign 0.21 migration.

* fix(core): map only the missing reqsign crypto provider error

Compare a reqsign ConfigInvalid sign failure with the error reqsign returns
when no CryptoProvider is available, so other ConfigInvalid failures keep
their own cause. Fix the upgrade guide's provider example and document the
S3 presign lifetime limits.

---------

Co-authored-by: Xuanwo <github@xuanwo.io>
Port the Swift credential fields and catalog endpoint discovery from apache#7216 to Reqsign. Use the operation transport for Keystone requests and pair catalog routing with the token that supplied the endpoint.

Co-authored-by: Ben Roeder <ben.roeder@sohonet.com>
(cherry picked from commit 6bdb734224e29fcc2906674075592cdcabf2e7da)
(cherry picked from commit 8ce9e6801563bce575b3361e072e3c00093249d3)
(cherry picked from commit 4b378d574da35c89fa9a90eb8fcbafaa6187195b)
@github-actions github-actions Bot added services/swift size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 30, 2026
@Xuanwo
Xuanwo merged commit 4228f3b into apache:main Nov 30, 2026
163 of 164 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" services/swift size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Swift service should support Keystone v3 authentication