Skip to content

Feature/devx 11567 signature algo - #630

Merged
dragonmantank merged 4 commits into
mainfrom
feature/DEVX-11567-signature-algo
Sep 15, 2026
Merged

dragonmantank merged 4 commits into
mainfrom
feature/DEVX-11567-signature-algo

Conversation

@dragonmantank

Copy link
Copy Markdown
Member

Allow an algorithm to be passed into the signature verification, instead of defaulting to MD5.

Also fixed some flak tests.

Contribution Checklist

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (3ce561d) to head (2a61de2).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@dragonmantank
dragonmantank merged commit 25a6e55 into main Sep 15, 2026
17 checks passed
@dragonmantank
dragonmantank deleted the feature/DEVX-11567-signature-algo branch September 15, 2026 05:27
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.

3 participants