Skip to content

Vault refactor to support jwt auth and allowlist auth based ownership model#22525

Open
prashantkumar1982 wants to merge 17 commits into
developfrom
vault-owner-refactor
Open

Vault refactor to support jwt auth and allowlist auth based ownership model#22525
prashantkumar1982 wants to merge 17 commits into
developfrom
vault-owner-refactor

Conversation

@prashantkumar1982
Copy link
Copy Markdown
Contributor

@prashantkumar1982 prashantkumar1982 commented May 18, 2026

Design: Vault DON design doc (new) — JWT behavior, tenant semantics, and workflow-owner derivation.

This PR implements the job-spec and runtime wiring for that model. Below is repository-specific detail (paths, deployment helpers, tests); the doc remains the authoritative design reference.

Requires smartcontractkit/chainlink-common#2068.

Tenant ID from job specs

For Vault JWT, TenantID is fetched from job-spec auth0, together with issuerURL and audience:

  • Gateway DON: vault handler method config JSON auth0.tenantIDJWTBasedAuthConfig.TenantID.
  • Vault DON: OCR vault plugin [pluginConfig.auth0] TOML tenantID (see worker-vault.tmpl).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
* 💬 11 @smartcontractkit/foundations, @smartcontractkit/core
/core/capabilities/ 💬 18 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
/core/services/ocr*/ 💬 7 @smartcontractkit/foundations, @smartcontractkit/core
/core/services/workflows/ 💬 9 @smartcontractkit/keystone
/deployment/cre/ 💬 3 @smartcontractkit/keystone, @smartcontractkit/operations-platform
go.mod 💬 6 @smartcontractkit/core, @smartcontractkit/foundations
go.sum 💬 6 @smartcontractkit/core, @smartcontractkit/foundations
integration-tests/go.mod 💬 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations
integration-tests/go.sum 💬 1 @smartcontractkit/core, @smartcontractkit/devex-tooling, @smartcontractkit/foundations

Legend: ✅ Approved | ❌ Changes Requested | 💬 Commented | 🚫 Dismissed | ⏳ Pending | ❓ Unknown

For more details, see the full review summary.

@github-actions
Copy link
Copy Markdown
Contributor

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 May 18, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 18, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@prashantkumar1982 prashantkumar1982 added the build-publish Build and Publish image to SDLC label May 19, 2026
Trigger CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@prashantkumar1982 prashantkumar1982 marked this pull request as ready for review May 19, 2026 05:57
@prashantkumar1982 prashantkumar1982 requested review from a team as code owners May 19, 2026 05:57
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

pavel-raykov
pavel-raykov previously approved these changes May 19, 2026
russell-stern
russell-stern previously approved these changes May 20, 2026
Comment on lines +233 to +240
nodeTenantID, errTenant := cresettings.Default.TenantID.GetOrDefault(ctx, v.limitsFactory.Settings)
if errTenant != nil {
v.lggr.Errorw("failed to resolve CRE TenantID setting", "method", req.Method, "requestID", req.ID, "error", errTenant)
return nil, fmt.Errorf("failed to resolve TenantID from CRE settings: %w", errTenant)
}
if claims.TenantID != nodeTenantID {
v.lggr.Debugw("JWT tenant id does not match node TenantID CRE setting", "method", req.Method, "requestID", req.ID, "orgID", claims.OrgID, "claimsTenantID", claims.TenantID, "nodeTenantID", nodeTenantID)
return nil, fmt.Errorf("%w: jwt tenant id %d node tenant id %d", ErrJWTTenantIDCresettingsMismatch, claims.TenantID, nodeTenantID)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be possible to add a type of limiter that does an equality check, though it wouldn't fit right with the numeric metrics code, so probably not worth pursuing unless we need to rely on those errors types.

@prashantkumar1982 prashantkumar1982 requested a review from a team as a code owner May 20, 2026 19:10
@cl-sonarqube-production
Copy link
Copy Markdown

@prashantkumar1982 prashantkumar1982 changed the title Vault refactor Vault refactor to support jwt auth and allowlist auth based ownership model May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-publish Build and Publish image to SDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants