Skip to content

refactor: loose client id requirement and accept azp#23

Merged
gao-sun merged 3 commits intomasterfrom
gao-loose-client-id-requirement
May 22, 2025
Merged

refactor: loose client id requirement and accept azp#23
gao-sun merged 3 commits intomasterfrom
gao-loose-client-id-requirement

Conversation

@gao-sun
Copy link
Copy Markdown
Contributor

@gao-sun gao-sun commented May 22, 2025

Summary

An update originated from mcp-auth/js#28.

Improved handling of the client_id field in the built-in JWT verifier and added support for the azp (authorized party) field. The logic now falls back to the azp field if client_id is missing or malformed. If neither field is valid, it defaults to an empty string.

@gao-sun gao-sun requested a review from Copilot May 22, 2025 01:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the JWT verification logic to loosen the requirement on the client_id field and support the azp field as a fallback. Key changes include updating the tests to account for different types of client_id values, modifying the verify_jwt function to check for azp if client_id is absent, and updating the type definitions accordingly.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/utils/create_verify_jwt_test.py Updated tests to verify client_id handling and fallback to azp
mcpauth/utils/_create_verify_jwt.py Refactored JWT verification logic for client_id/azp fallback
mcpauth/types.py Updated type definitions and documentation for client_id and azp support

@codecov
Copy link
Copy Markdown

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gao-sun gao-sun merged commit 205158c into master May 22, 2025
5 checks passed
@gao-sun gao-sun deleted the gao-loose-client-id-requirement branch May 22, 2025 01:26
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