Conversation
79ee0a7 to
de763ef
Compare
phlogistonjohn
left a comment
There was a problem hiding this comment.
looks OK to me, but of course RGW is my weak area so take this with a grain of salt.
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Thanks for upstreaming this — it'd let downstream consumers drop a good chunk of custom SNS/SigV4 plumbing, so I'd love to see it land solid. Two issues I ran into implementing the same against RGW (confirmed on Tentacle 20.2.4), plus a couple of minor notes:
Every entry overwrites entry.1, so only one (map-order-dependent) attribute is ever sent — it needs an incrementing index (entry.1, entry.2, …). Topics commonly set several attributes at once.
Minor / optional:
|
|
Real-world topics almost always carry several attributes at once. A few examples from our downstream provider's acceptance suite, expressed against this API — with the current loop each of these keeps only one (map-order-dependent) attribute: With the fixed entry.1 index only one of these survives per call and even that is dropped while it's sent in the query string. An incrementing index + POST-body encoding makes all of them round-trip. |
de763ef to
a17b5f0
Compare
Pull request has been modified.
|
@fitbeard Thanks for the thorough review - both issues were real and are now hopefully fixed:
The test has been updated to create a topic with two attributes ('push-endpoint' + 'persistent') and assert they both appear in GetTopicAttributes, which would have caught both bugs. handleStatusError parses S3-style XML error bodies, so callers get meaningful codes/messages. I haven't added retry/backoff for transient errors in the integration tests yet, but agree it's worth considering if we see flakes. |
|
The incrementing/sorted-keys fix, the POST-body switch, and the round-trip assertion in the test all look good — thanks for the quick turnaround. One regression the fix introduced, which is what's currently failing the reef and quincy jobs: In callSNS, the now non-empty body is signed with the hash of an empty string: So Two separate things here:
|
|
For the callSNS signing issue above — here's a minimal fix that keeps the signed-payload approach but hashes the actual encoded body and drops the PayloadHash field: Key changes: compute payloadHash from body after Alternatively, mirror callNotification exactly: drop both payloadHash lines and return |
a17b5f0 to
2d933e2
Compare
|
@fitbeard Updated to hash the actual body with sha256Hex(body) instead. Thanks for the insights. Regarding the |
4cfbd70 to
11fbc45
Compare
11fbc45 to
2e73f49
Compare
Extract the common sign-send-read logic into a new doRequest method. The call method now builds the request and delegates to doRequest. This reduces duplication for upcoming API helpers. Assisted-by: OpenCode Zen:MiMo-v2.5 Signed-off-by: Anoop C S <anoopcs@disroot.org>
Add SNS-compatible topic management APIs. These APIs are required before creating bucket notifications, as notifications reference topics by ARN. Assisted-by: OpenCode Zen:MiMo-v2.5 Signed-off-by: Anoop C S <anoopcs@disroot.org>
Add integration tests for topic management APIs Assisted-by: OpenCode Zen:MiMo-v2.5 Signed-off-by: Anoop C S <anoopcs@disroot.org>
Signed-off-by: Anoop C S <anoopcs@disroot.org>
Add support for S3 bucket notification APIs. Adds callNotification helper and the notification configuration types and API functions. Assisted-by: OpenCode Zen:MiMo-v2.5 Signed-off-by: Anoop C S <anoopcs@disroot.org>
Add integration tests for bucket notification APIs. Assisted-by: OpenCode Zen:MiMo-v2.5 Signed-off-by: Anoop C S <anoopcs@disroot.org>
Signed-off-by: Anoop C S <anoopcs@disroot.org>
|
@Mergifyio rebase |
❌ This pull request comes from a fork and cannot be rebasedDetailsGitHub refuses an OAuth token on its rebase API for a fork, so rebasing one means impersonating a GitHub user to force-push the contributor's branch. Mergify does not do that. Use the |
2e73f49 to
49b5006
Compare
|
@anoopcs9 Thanks for the quick iterations! |
Adds SNS topic management and S3 bucket notification API support to the rgw admin client. It also introduces a doRequest() helper to share sign+send+read logic across all call variants.
fixes #547
fixes #548
Checklist
//go:build ceph_previewmake api-updateto record new APIs