Skip to content

feat: Support custom HttpClient for signature validation - #3272

Merged
amanda-tarafa merged 4 commits into
googleapis:mainfrom
amanda-tarafa:issue-3271
Oct 27, 2026
Merged

amanda-tarafa merged 4 commits into
googleapis:mainfrom
amanda-tarafa:issue-3271

Conversation

@amanda-tarafa

Copy link
Copy Markdown
Contributor

Closes #3271

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the ability to use a custom 'IHttpClientFactory' when fetching certificates for signature verification in 'GoogleJsonWebSignature' and 'SignedTokenVerification'. It adds the 'HttpClientFactory' property to 'ValidationSettings' and 'SignedTokenVerificationOptions', updates 'CertificateCache' to utilize this factory if provided, and includes comprehensive unit tests to verify the new functionality. There are no review comments, so I have no feedback to provide.

@amanda-tarafa
amanda-tarafa marked this pull request as ready for review October 23, 2026 20:53
@amanda-tarafa
amanda-tarafa requested a review from a team as a code owner October 23, 2026 20:53
@amanda-tarafa

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the ability to use a custom IHttpClientFactory when fetching certificates for signature verification in GoogleJsonWebSignature and SignedTokenVerification. It adds an HttpClientFactory property to ValidationSettings and SignedTokenVerificationOptions, and updates CertificateCache to utilize this factory when creating HTTP clients. Additionally, it updates the signature of GetCertificatesAsync and FetchCertificatesAsync to accept SignedTokenVerificationOptions instead of a boolean flag, and adds comprehensive unit tests to verify the new functionality. There are no review comments, so I have no feedback to provide.

@efevans efevans 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.

LGTM

Assert.Same(firstCall, secondCall);
Assert.Equal(1, factory.Calls);

// Force refresh: should call factory again

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.

nice

@amanda-tarafa
amanda-tarafa merged commit 322b355 into googleapis:main Oct 27, 2026
10 checks passed
@amanda-tarafa
amanda-tarafa deleted the issue-3271 branch October 27, 2026 15:49
amanda-tarafa added a commit that referenced this pull request Oct 30, 2026
Features:

- #3272 Support custom HttpClient for signature validation
- #3277 Honor Retry-After header in BackOffHandler
This was referenced Nov 21, 2026
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.

Add support for supplying an IHttpClientFactory when calling GoogleJsonWebSignature.ValidateAsync

2 participants