Bug #82242
openrgw/swift: 401 Unauthorized responses do not include WWW-Authenticate
0%
Description
Summary¶
RFC 9110 section 15.5.2: a server generating 401 MUST send a WWW-Authenticate header with at least one challenge. RGW's Swift API answers authentication failures with 401 but never sends the header.
Repro gist: https://gist.github.com/RaminNietzsche/818ad8dd6b8d8093560183cd09d2b169 (T6 cases).
Fix¶
When RGW_REST_SWIFT is set and the HTTP status is 401, emit WWW-Authenticate: Swift realm="…" (account from the request path, or unknown), and Keystone uri="…" when rgw_keystone_url is configured.
Testing¶
qa/workunits/rgw/test-swift-www-authenticate.pyon vstart.
JI Updated by J. Eric Ivancich about 1 month ago
@Ramin Najarbashi Are you interested in putting up a PR for this tracker? I see you have other PRs.
RN Updated by Ramin Najarbashi about 1 month ago
- Status changed from New to Fix Under Review
- Assignee set to Ramin Najarbashi
- Pull request ID set to 73209
@J. Eric Ivancich Yes — the fix is already up for review: https://github.com/ceph/ceph/pull/73209 (Swift 401 + WWW-Authenticate, RFC 9110). Includes qa/workunits/rgw/test-swift-www-authenticate.py. Moving this ticket to Fix Under Review and linking the PR field.