Skip to content

vault: add generic authorizer with jwt auth support#21836

Closed
prashantkumar1982 wants to merge 1 commit intodevelopfrom
codex/vault-gwt-auth-authorizer-clean
Closed

vault: add generic authorizer with jwt auth support#21836
prashantkumar1982 wants to merge 1 commit intodevelopfrom
codex/vault-gwt-auth-authorizer-clean

Conversation

@prashantkumar1982
Copy link
Copy Markdown
Contributor

@prashantkumar1982 prashantkumar1982 commented Apr 2, 2026

Summary

  • add a generic vault authorizer that selects between AllowListBasedAuth and JWTBasedAuth
  • wire the authorizer through both gateway handler layers while keeping JWT auth disabled behind VaultJWTAuthEnabled
  • add request replay protection, JWT validation, background JWKS refresh, and the related unit tests

Notes

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

✅ No conflicts with other open PRs targeting develop

@prashantkumar1982 prashantkumar1982 marked this pull request as draft April 2, 2026 16:56
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45f2fc131c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// NewHandler creates the gateway-side Vault handler with internal auth wiring.
func NewHandler(methodConfig json.RawMessage, donConfig *config.DONConfig, don gwhandlers.DON, capabilitiesRegistry capabilitiesRegistry, workflowRegistrySyncer workflowsyncerv2.WorkflowRegistrySyncer, lggr logger.Logger, clock clockwork.Clock, limitsFactory limits.Factory) (*handler, error) {
allowListBasedAuth := vaultcap.NewAllowListBasedAuth(lggr, workflowRegistrySyncer)
jwtBasedAuth, err := vaultcap.NewJWTBasedAuth(vaultcap.JWTBasedAuthConfig{}, limitsFactory, lggr, vaultcap.WithDisabledJWTBasedAuth())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove unconditional WithDisabledJWTBasedAuth wiring

NewHandler constructs JWT auth with WithDisabledJWTBasedAuth(), which hard-sets the gate limiter to false (see jwt_based_auth.go) instead of honoring VaultJWTAuthEnabled. As a result, requests that include req.Auth are always rejected as disabled, so enabling the setting cannot actually turn on JWT auth in this runtime path; the same hard-disable pattern is also present in core/capabilities/vault/gw_handler.go. Runtime wiring should use the normal JWT constructor (with real issuer/audience config) and reserve WithDisabledJWTBasedAuth for tests only.

Useful? React with 👍 / 👎.

@cl-sonarqube-production
Copy link
Copy Markdown

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 2, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@prashantkumar1982 prashantkumar1982 deleted the codex/vault-gwt-auth-authorizer-clean branch April 2, 2026 21:13
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.

1 participant