Skip to content

feat: add VaultJWTAuthEnabled and VaultOrgIdAsSecretOwnerEnabled feature gates and vault proto fields for JWT auth#1921

Open
prashantkumar1982 wants to merge 3 commits intomainfrom
feat/vault-jwt-auth-gate-proto
Open

feat: add VaultJWTAuthEnabled and VaultOrgIdAsSecretOwnerEnabled feature gates and vault proto fields for JWT auth#1921
prashantkumar1982 wants to merge 3 commits intomainfrom
feat/vault-jwt-auth-gate-proto

Conversation

@prashantkumar1982
Copy link
Contributor

@prashantkumar1982 prashantkumar1982 commented Mar 24, 2026

Summary

  • Adds VaultJWTAuthEnabled boolean setting (default: false) to cresettings, gating the upcoming JWT-based authorization flow for Vault requests.
  • Adds VaultOrgIdAsSecretOwnerEnabled boolean setting (default: false) to cresettings, gating the use of org_id as the secret owner for Vault instead of workflow_owner.
  • Adds org_id and workflow_owner fields to four vault proto request messages: CreateSecretsRequest, UpdateSecretsRequest, DeleteSecretsRequest, and ListSecretIdentifiersRequest.
  • Regenerated proto Go code.
  • Updated golden files (defaults.json, defaults.toml), README flowchart, and test assertions.

No behavior change — new proto fields default to empty strings, and both feature gates default to false.

This is PR 1 of the Vault JWT Auth rollout plan. All subsequent PRs depend on the gate settings and/or proto fields introduced here.

@github-actions
Copy link

github-actions bot commented Mar 24, 2026

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (18)

pkg/capabilities/actions/vault.(*CreateSecretsRequest) (2)
  • GetOrgId — ➕ Added

  • GetWorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.(*DeleteSecretsRequest) (2)
  • GetOrgId — ➕ Added

  • GetWorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.(*ListSecretIdentifiersRequest) (2)
  • GetOrgId — ➕ Added

  • GetWorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.(*UpdateSecretsRequest) (2)
  • GetOrgId — ➕ Added

  • GetWorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.CreateSecretsRequest (2)
  • OrgId — ➕ Added

  • WorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.DeleteSecretsRequest (2)
  • OrgId — ➕ Added

  • WorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.ListSecretIdentifiersRequest (2)
  • OrgId — ➕ Added

  • WorkflowOwner — ➕ Added

pkg/capabilities/actions/vault.UpdateSecretsRequest (2)
  • OrgId — ➕ Added

  • WorkflowOwner — ➕ Added

pkg/settings/cresettings.Schema (2)
  • VaultJWTAuthEnabled — ➕ Added

  • VaultOrgIdAsSecretOwnerEnabled — ➕ Added


📄 View full apidiff report

… JWT auth

Add org_id and workflow_owner fields to CreateSecretsRequest,
UpdateSecretsRequest, DeleteSecretsRequest, and
ListSecretIdentifiersRequest proto messages. Add VaultJWTAuthEnabled
boolean setting (default: false) to cresettings. No behavior change —
new proto fields default to empty strings and the gate is off.

Made-with: Cursor
Add VaultOrgIdAsSecretOwnerEnabled boolean setting (default: false) to
cresettings, gating the upcoming org-id-as-secret-owner behavior for
Vault requests. No behavior change — the gate defaults to off.

Updated golden files (defaults.json, defaults.toml), README flowchart,
and test assertions.

Made-with: Cursor
@prashantkumar1982 prashantkumar1982 changed the title feat: add VaultJWTAuthEnabled feature gate and vault proto fields for JWT auth feat: add VaultJWTAuthEnabled and VaultOrgIdAsSecretOwnerEnabled feature gates and vault proto fields for JWT auth Mar 25, 2026
string request_id = 1;
repeated EncryptedSecret encrypted_secrets = 2;
string org_id = 3;
string workflow_owner = 4;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmmmm -- I'm not following: why do we need the org_id and workflow_owner here? Shouldn't it live on the SecretIdentifier message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need both till we are in migration phase.
Where would you put them instead?
Inside each SecretIdentifier item as additional field?
We could do that, but seems less elegant.

Also, I am thinking, after the migration, we should move owner field to outside of Identifier.
It is more of a request level attribute than per-secret attribute.

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens once we introduce policies over secrets though? I think it's useful to distinguish between the owner making the request and the owner of the secret.

Are we expecting that the CLI will provide both values? Also one thing to bear in mind is that these messages are used across multiple layers (plugin, gateway -> node, user -> gateway); maybe this is an opportunity to start separating between what we expect the user to provide and what we add on the way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we introduce policies, I assume more things will change. Like sub-owners, roles.
But even in that model, orgId will still be an overall customer level field, not per secret field.
In any case, I don't want to think about forward compatibility with policies support, since that will be a bigger change anyways.

The workflow_owner we will likely get rid of here in future.

maybe this is an opportunity to start separating between what we expect the user to provide and what we add on the way
Yes, this sounds like a good refactor to do. Basically split the protos/messages we pass between each layer. But that will be more disruptive, and I would like to do it separately in a different set of PRs.
At this point, we need a way to pass trusted orgId and workflowOwner from Vault Gateway handler to the Capability/Plugin.
What do you think? I am open to doing this refactor now too, as a pre-req before other changes. But will likely act on it immediately as it blocks all other work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are we expecting that the CLI will provide both values?
No, the CLI will provide different things:

  1. Allowlist based auth: CLI provides verified workflowOwner only.
  2. jwt based auth: CLI provides orgID, and optionally an untrusted workflowOwner

Our Vault Cap node will derive both OrgID and WorkflowOwner in a trusted manner, and then pass them to the plugin.

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