Skip to content

Add RFC 8693 token exchange provider with OpenAI WIF support#10

Merged
waynz0r merged 1 commit into
mainfrom
openai-wid
Jun 1, 2026
Merged

Add RFC 8693 token exchange provider with OpenAI WIF support#10
waynz0r merged 1 commit into
mainfrom
openai-wid

Conversation

@waynz0r

@waynz0r waynz0r commented May 29, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new RFC 8693 (OAuth2 Token Exchange) credentials provider to the codebase, enabling standardized token exchange flows and supporting integration with OpenAI's Workload Identity Federation (WIF). The implementation includes robust configuration and option handling, a refresh loop for credential lifecycle management, and comprehensive unit tests. Several new dependencies are added to support testing and JSON handling.

Key changes:

RFC 8693 Credentials Provider Implementation

  • Added a new rfc8693 package implementing an OAuth2 token exchange provider as per RFC 8693, including the exchange logic, configuration, and refresh loop for automatic token renewal. (pkg/rfc8693/rfc8693.go)
  • Introduced a flexible options system for credentials configuration, supporting custom token endpoints, token providers, audience, scopes, HTTP clients, and additional fields. (pkg/rfc8693/option.go)

OpenAI Workload Identity Federation (WIF) Support

  • Added GetOpenAICredentials and OpenAIWIFConfig to simplify obtaining OpenAI credentials via WIF, ensuring the correct request shape and field merging. (pkg/rfc8693/openai.go)

Testing

  • Added comprehensive unit tests for the RFC 8693 provider, including token exchange flows, error handling, and OpenAI integration. (pkg/rfc8693/rfc8693_test.go)

@waynz0r waynz0r requested a review from stoader May 29, 2026 11:38
@stoader stoader requested review from baluchicken and rappizs May 29, 2026 12:10
@waynz0r waynz0r merged commit dee05f8 into main Jun 1, 2026
1 check passed
@waynz0r waynz0r deleted the openai-wid branch June 1, 2026 09:38
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.

4 participants