-
Notifications
You must be signed in to change notification settings - Fork 81
fix: jfrog oauth username extraction from oauth jwt token #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…name extraction from oauth
…e username extraction
There was a problem hiding this 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 fixes username extraction from JFrog OAuth JWT tokens to preserve special characters that Coder normalizes in usernames (dots, hyphens, accented characters). The implementation adds JWT payload parsing with a fallback to the existing username_field logic.
Key changes:
- Added JWT token parsing via
data.externalresource to extract username from OAuth token payload - Updated username resolution logic to prioritize JWT-extracted username with fallback to Coder username/email
- Added documentation explaining the new username handling priority order
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| registry/coder/modules/jfrog-oauth/main.tf | Implements JWT username extraction using bash script in data.external resource and updates username resolution logic with coalesce for proper fallback handling |
| registry/coder/modules/jfrog-oauth/README.md | Documents the new username handling behavior, explaining JWT extraction priority and fallback mechanism |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
matifali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming this has been tested.
matifali
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Description
Add username extraction from jfrog JWT OAuth token with fallback to coder username.
Type of Change
Module Information
Path:
registry/coder/modules/jfrog-oauthNew version:
v1.2.2Breaking change: [ ] Yes [X] No
Template Information
Path:
registry/[namespace]/templates/[template-name]Testing & Validation
bun test)bun fmt)Related Issues