Files
floci/src/main/java
Priamo Germosen bd13c7f9ce refactor(s3): point PreSignedUrlFilter at the shared SigV4RequestValidator crypto helpers (#3596)
S3's PreSignedUrlFilter carried its own private copy of deriveSigningKey/hmacSha256/
sha256Hex/hexEncode, the same SigV4 signing-key derivation block that SigV4Validator
(ElastiCache) and RdsSigV4Validator (RDS) used to carry independently before #3581
consolidated those two into core.common.auth.SigV4RequestValidator. S3's copy was out
of scope there and left as a third independent copy of the same crypto logic.

S3's canonical-request construction is real REST SigV4 (method/path/headers/payload
hash), a different shape from SigV4RequestValidator's own validate() method, which
handles the simplified query-token form ElastiCache/RDS presigned URLs use. So this
doesn't reuse validate() itself, only the four low-level crypto primitives, now made
public on SigV4RequestValidator for exactly this kind of reuse. PreSignedUrlFilter's
own copies are removed and its one call site now delegates to the shared methods.

S3HeaderSignatureFilter, which reused PreSignedUrlFilter's helpers directly (they were
package-private), is updated to call the shared class as well.

Adds SigV4RequestValidatorTest: the shared crypto primitives were previously only
exercised indirectly through each caller's own request flow. Now that they're public
specifically for cross-service reuse, this pins them directly against an independently
computed value (cross-checked with Python's hmac/hashlib, not derived from this code).

No behavior change otherwise. Full S3 test suite (over 1000 tests across all S3 files)
and the ElastiCache/RDS/Redshift SigV4 validator tests pass unchanged.
2026-09-14 21:54:13 -04:00
..