Skip to content

Conversation

@pflynn-virtru
Copy link
Member

Enhanced the verify method to support assertion verification using JWK and X.509 certificates from JWT headers. Included unit tests to validate this functionality.

Enhanced `verify` to handle JWK and X.509 certificates from JWT headers. Added corresponding unit tests to verify the functionality.
@pflynn-virtru pflynn-virtru requested a review from a team as a code owner January 5, 2026 17:04
@gemini-code-assist
Copy link

Summary of Changes

Hello @pflynn-virtru, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the assertion verification process by enabling the verify method to dynamically resolve public keys from JSON Web Key (JWK) or X.509 certificate chain information embedded within JWT headers. This change improves the system's interoperability and flexibility when handling assertions, allowing for more diverse key management strategies without requiring the verification key to be explicitly passed if it's available in the JWT header. Comprehensive unit tests ensure the robustness of these new verification capabilities and the proper fallback behavior.

Highlights

  • Enhanced Assertion Verification: The verify method now supports extracting public keys directly from JWT headers for assertion verification, specifically handling JSON Web Key (JWK) and X.509 certificate chain (x5c) information.
  • Dynamic Key Resolution: The jwtVerify function has been updated to use an asynchronous key resolver, allowing it to dynamically import keys from the JWT header or fall back to a provided key if no header key material is present.
  • Comprehensive Unit Tests: New unit tests have been added to validate the new verification logic, covering scenarios where JWK is present in the header and where the system correctly falls back to a provided key.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

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

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 enhances assertion verification by adding support for JSON Web Keys (JWK) and X.509 certificates embedded in the JWT header. The implementation correctly uses jose library functions to import these keys. However, I've identified a critical security vulnerability in how these keys are handled. The current code blindly trusts the public key provided within the JWT header, which allows an attacker to forge valid assertions. My review includes a detailed explanation of this vulnerability and recommendations for remediation. The accompanying unit tests confirm the new functionality but also highlight the security flaw by design. It is crucial to address this security issue before merging.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

X-Test Failure Report

opentdf-sdk-lib
opentdf-ctl
❌ go-main
❌ java-main
❌ js-main

@pflynn-virtru pflynn-virtru changed the title feat: Add JWK and X.509 support for assertion verification feat: Assertion verification JWK and X.509 Jan 7, 2026
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

X-Test Failure Report

opentdf-sdk-lib
opentdf-ctl
❌ go-main
❌ java-main
❌ js-main

@github-actions
Copy link

github-actions bot commented Jan 7, 2026

X-Test Failure Report

opentdf-sdk-lib
opentdf-ctl
❌ go-main
❌ java-main
❌ js-main

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
68.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

@pflynn-virtru pflynn-virtru merged commit f5a8f5e into main Jan 9, 2026
57 of 87 checks passed
@pflynn-virtru pflynn-virtru deleted the feature/assertion-jwk-x5c-verify branch January 9, 2026 17:13
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