Skip to content

feat(oracle): sign caller-supplied request body headers - #953

Merged
Xuanwo merged 2 commits into
mainfrom
xuanwo/oci-body-signing
Nov 19, 2026
Merged

Xuanwo merged 2 commits into
mainfrom
xuanwo/oci-body-signing

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 19, 2026

Copy link
Copy Markdown
Member

Part of #111. The Oracle signer only signed date, (request-target), and host, so OCI IaaS POST/PUT requests with bodies could not satisfy the OCI signature contract. OCI requires content-length, content-type, and x-content-sha256 for bodied POST/PUT/PATCH requests; PutObject and UploadPart PUT requests may omit them, and any that are present must be signed.

This change signs the body metadata the caller actually supplied. It does not read the request body, compute the digest, add missing body headers, or choose object-storage behavior from the endpoint authority. Bodyless requests keep signing only date, (request-target), and host. Duplicate signed body headers are rejected before any request mutation.

Callers must prepare content-length, content-type, and x-content-sha256 before signing. The service README and provider docs document the values and the empty-body digest. Automatic body hashing / a body-aware API remains open; this PR only covers caller-supplied metadata.

Verification: cargo test -p reqsign-oracle and cargo clippy -p reqsign-oracle --all-targets -- -D warnings pass locally on the PR head. The integration tests sign through the public Signer path and use an independent verifier that reconstructs the signed fields from the Authorization header and verifies the RSA signature. Verification is synthetic; no live OCI traffic was used.

Sign content-length, content-type, and x-content-sha256 for POST, PUT, and PATCH requests when the caller has added them. Reqsign does not read the body or compute the digest; the service documentation tells callers which headers to prepare.

Object Storage PutObject and UploadPart PUT requests keep the bodyless contract when those headers are absent. Duplicate signed body headers are rejected without mutating the request.
Resolve services/oracle/README.md by keeping both the configuration profile and request body header sections.
@Xuanwo
Xuanwo merged commit 3756665 into main Nov 19, 2026
64 checks passed
@Xuanwo
Xuanwo deleted the xuanwo/oci-body-signing branch November 19, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants