Skip to content

Conversation

@DevelopmentCats
Copy link
Contributor

@DevelopmentCats DevelopmentCats commented Nov 14, 2025

Description

Add username extraction from jfrog JWT OAuth token with fallback to coder username.

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder/modules/jfrog-oauth
New version: v1.2.2
Breaking change: [ ] Yes [X] No

Template Information

Path: registry/[namespace]/templates/[template-name]

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun fmt)
  • Changes tested locally

Related Issues

Copy link
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 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.external resource 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

Copy link
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Copy link
Member

@matifali matifali left a 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.

Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

LGTM.

@DevelopmentCats DevelopmentCats merged commit 71c84a8 into main Nov 17, 2025
4 checks passed
@DevelopmentCats DevelopmentCats deleted the cat/jfrog-oauth-fix branch November 17, 2025 18:28
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.

2 participants