Skip to content

Feat: add per-issuer OIDC configuration with static key file support#876

Merged
mattisonchao merged 4 commits intomainfrom
feat/oidc-per-issuer-config
Jan 29, 2026
Merged

Feat: add per-issuer OIDC configuration with static key file support#876
mattisonchao merged 4 commits intomainfrom
feat/oidc-per-issuer-config

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

@mattisonchao mattisonchao commented Jan 29, 2026

Motivation

This implementation adds support for per-issuer OIDC configuration while maintaining full backward compatibility.

Configuration format:

{
  "issuers": {
    "https://issuer1.com": {
      "allowedAudiences": "aud1,aud2",
      "userNameClaim": "sub",
      "staticKeyFile": "/path/to/key.pem"
    },
    "https://issuer2.com": {
      "allowedAudiences": "aud3",
      "userNameClaim": "email"
    }
  }
}

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 extends the OIDC authentication provider to support per-issuer configuration (including static key files) while maintaining backward compatibility with the legacy single-config format, and documents the new options on the server CLI.

Changes:

  • Introduces IssuerConfig and extends OIDCOptions to support per-issuer OIDC configuration, including staticKeyFile, and wires this into NewOIDCProvider and Authenticate.
  • Adds helper loadPublicKeysFromFile to load public keys/certificates from PEM files and uses it to build a static key-based verifier via oidc.StaticKeySet when staticKeyFile is provided.
  • Adds comprehensive unit tests for the new configuration paths and behaviors, and updates the --auth-provider-params flag help text to describe both legacy and new formats.

Reviewed changes

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

File Description
oxiad/common/rpc/auth/oidc.go Adds per-issuer OIDC configuration (IssuerConfig, Issuers map), static key file support via loadPublicKeysFromFile and oidc.StaticKeySet, and updates audience/username-claim selection logic to work with both legacy and per-issuer settings.
oxiad/common/rpc/auth/oidc_test.go Introduces tests covering validation and defaulting of OIDCOptions, legacy and per-issuer provider construction, authentication flows, static key file wiring, and public-key loading edge cases.
cmd/server/cmd.go Updates the --auth-provider-params flag help string to clearly document the deprecated legacy OIDC configuration format and the new per-issuer JSON format including staticKeyFile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattisonchao mattisonchao merged commit d6b2b81 into main Jan 29, 2026
8 checks passed
@mattisonchao mattisonchao deleted the feat/oidc-per-issuer-config branch January 29, 2026 15:07
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