Repository navigation
fix(kms): report ValidationException for wrong-length DIGEST in Sign - #58
Merged
Merged
Conversation
KMS Sign with MessageType DIGEST and a wrong-length digest rejected the request with InvalidArnException even though the key identifier was valid. Add ValidationException to KmsErrorCode (HTTP 400, matching LocalStack/AWS behavior) and map KmsError::validation to it; also register it in codegen/services/kms.toml so future model regens keep it. Regression test: test_should_report_validation_exception_for_wrong_length_digest reproduces issue #57 (Sign with 5-byte digest for ECDSA_SHA_256). Fixes #57.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0d827c537
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #57:
SignandVerifyrequests usingECC_SECG_P256K1,ECDSA_SHA_256, and a wrong-lengthDIGESTnow return HTTP 400ValidationExceptionwith the required digest length, instead of incorrectly reportingInvalidArnExceptionfor a valid key identifier.Changes
ValidationExceptionin the KMS codegen configuration and mapKmsError::validationto it. Regenerating into a temporary directory confirms the default variant, wire name, HTTP status, and validation helper are preserved.fetch_updatewith the equivalenttry_update, pin the toolchain and align the Docker builder with it, and update existing empty-value test assertions for the new Clippy lint without suppressing it. Patch the locked rustls version to 0.23.45 so the dependency security checks pass.Validation
On the final branch (CI: 30 checks passed; 4 optional compatibility jobs skipped):
cargo build --lockedcargo test --all-features --locked: 121 suites, 1705 passed, 0 failed, 399 ignored (server-dependent tests and ignored documentation examples)cargo clippy --keep-going --all-targets --all-features -- -D warnings(workspace pedantic lints and established exceptions)cargo clippy -p rustack-auth --all-targets -- -D warningscargo +nightly fmt -- --check, stablecargo fmt --all -- --check, andgit diff --checkcargo auditandcargo deny checkrust:1.99.0-slimtag verified in the official registry for amd64 and arm64; Docker build/health checks run in CIThe KMS production change only corrects the error mapping; it adds no work to successful signing or verification. Algorithm support and other explicit uses of
InvalidArnExceptionremain outside this fix.