Repository navigation
Feature/devx 11567 signature algo - #630
Merged
Merged
Conversation
The only publicly accessible RequestSigning.verifyRequestSignature overload was hardcoded to HashType.MD5, and the algorithm-aware overload was package-private. Callers outside com.vonage.client.auth therefore could not verify callbacks signed with HMAC_SHA256 (or SHA1/HMAC_MD5/SHA512), despite HashUtil already supporting them. Adds a public overload taking a HashType. Existing overloads are untouched and still default to MD5, so this is additive only. DEVX-11567
Additive public API addition (RequestSigning.verifyRequestSignature overload accepting HashType) requires a MINOR bump under SemVer. Ran the equivalent of bumpversion.sh: mvn versions:set followed by mvn validate, which propagates the version into HttpWrapper's CLIENT_VERSION and the README install snippets. DEVX-11567
DynamicEndpointTest shares one static HttpWrapper across all test methods, and junit-platform.properties sets parallel.mode.default = concurrent. The methods stub responses on that shared instance and then execute against it, so run concurrently they consume each other's stubs: testBinaryRequest expected "OK" but got the URI stubbed by testRedirectHandling, and testRedirectHandling saw an empty response. Reproduced on an unmodified checkout: 5/5 failures with parallelism enabled, 5/5 passes with parallel.enabled=false. CI does not catch this because JUnit sizes its thread pool from availableProcessors, and the 2-4 vCPU hosted runners effectively serialise the class. The race is latent there, not absent. Applies the same annotation ConversationsClientTest already uses for this reason. DEVX-11567
EVENT_ID drew from [0,100), so roughly 1 run in 100 produced 0. The two dependent draws then threw IllegalArgumentException: bound must be positive - nextInt(0) and nextInt(0, 0) - inside the static initialiser. That surfaced as NoClassDefFoundError across every test extending AbstractEventTest, failing ~120 tests in the conversations package at once. Drawing from [1,100) makes the failure impossible by construction: for any EVENT_ID >= 1, nextInt(EVENT_ID) has a positive bound and EVENT_ID < EVENT_ID * 12 holds. The intended ordering EVENT_START_ID < EVENT_ID <= EVENT_END_ID is preserved. DEVX-11567
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #630 +/- ##
=========================================
Coverage 99.07% 99.07%
- Complexity 3654 3656 +2
=========================================
Files 549 549
Lines 8067 8069 +2
Branches 446 446
=========================================
+ Hits 7992 7994 +2
Misses 55 55
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The new overload correctly delegates to existing verified behavior, preserves compatibility, and has appropriate tests.
Pull request overview
Adds configurable signature algorithms to public request verification while retaining MD5 defaults and stabilizing flaky tests.
Changes:
- Adds and tests a
HashType-aware verification overload. - Stabilizes parallel and randomized tests.
- Bumps the SDK version to 9.14.0 and updates release documentation.
File summaries
| File | Description |
|---|---|
RequestSigning.java |
Adds the algorithm-aware public overload. |
RequestSigningTest.java |
Tests HMAC-SHA256 and MD5 compatibility. |
DynamicEndpointTest.java |
Serializes tests sharing mutable state. |
ConversationsClientTest.java |
Prevents zero-valued random event IDs. |
HttpWrapper.java |
Updates the client version. |
pom.xml |
Updates the project version. |
README.md |
Updates dependency examples. |
CHANGELOG.md |
Documents the new API. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Allow an algorithm to be passed into the signature verification, instead of defaulting to MD5.
Also fixed some flak tests.
Contribution Checklist