Skip to content

fix: set WorkflowOwner and OrgId on vault GetSecretsRequest in relay handler#21991

Open
nadahalli wants to merge 3 commits intodevelopfrom
tejaswi/fix-relay-vault-owner
Open

fix: set WorkflowOwner and OrgId on vault GetSecretsRequest in relay handler#21991
nadahalli wants to merge 3 commits intodevelopfrom
tejaswi/fix-relay-vault-owner

Conversation

@nadahalli
Copy link
Copy Markdown
Contributor

Summary

The confidential relay handler forwards secret-fetch requests from the enclave to the vault DON. It constructs a GetSecretsRequest but only sets the owner on each SecretIdentifier inside Requests, not on the top-level WorkflowOwner and OrgId fields.

The vault plugin's observeGetSecretsRequest reads WorkflowOwner and OrgId from the top-level request fields to validate the TDH2 ciphertext label via EnsureRightLabelOnSecret. When both are empty, expectedLabels is empty and every secret fetch fails with:

secret label [...] does not match any of the provided owner labels; expectedLabels=[]

This was introduced by #21639 which added label validation to GetSecrets (previously only on CreateSecrets).

Also bumps chainlink-common to pick up the OrgID field on SecretsRequestParams (smartcontractkit/chainlink-common#1975).

The confidential relay handler constructs a vault GetSecretsRequest when
forwarding secret fetches from the enclave, but only sets owner on each
SecretIdentifier, not on the top-level request fields. The vault plugin
validates the TDH2 label against WorkflowOwner/OrgId from the request
payload, so both must be populated for label verification to pass.

Also bumps chainlink-common to pick up the OrgID field on
SecretsRequestParams.
@nadahalli nadahalli requested review from a team as code owners April 13, 2026 12:01
Copilot AI review requested due to automatic review settings April 13, 2026 12:01
@nadahalli nadahalli requested a review from a team as a code owner April 13, 2026 12:01
@github-actions
Copy link
Copy Markdown
Contributor

👋 nadahalli, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@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 Apr 13, 2026

✅ No conflicts with other open PRs targeting develop

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

Risk Rating: MEDIUM

Fixes confidential relay secret fetches by ensuring the relay handler populates the top-level WorkflowOwner and OrgId fields on the Vault GetSecretsRequest, aligning with Vault plugin label validation introduced in #21639.

Changes:

  • Set WorkflowOwner and OrgId on the top-level vault.GetSecretsRequest in the confidential relay handler.
  • Bump chainlink-common (and update go.sum) to pick up OrgID support on SecretsRequestParams.
  • Bump chainlink-protos/cre/go to the referenced newer version.

Human review focus:

  • core/capabilities/confidentialrelay/handler.go:226-244 — confirm WorkflowOwner/OrgId values match what Vault expects for TDH2 label validation (including normalization expectations).
  • Dependency bumps (go.mod / go.sum) — ensure no unintended transitive changes affect other capabilities.

Reviewed changes

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

File Description
core/capabilities/confidentialrelay/handler.go Populate top-level Vault request identity fields needed for ciphertext label validation.
go.mod Bump chainlink-common and chainlink-protos/cre/go versions.
go.sum Update checksums to match the module version bumps.

Covers the MethodSecretsGet code path in the relay handler, verifying
that WorkflowOwner is EIP-55 normalized on the vault request and OrgId
is passed through from the incoming params.
@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 13, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CCIPTokenTransfer_EVM2Sui_ManagedTokenPool_NoRateLimit Logs ↗︎

View Full Report ↗︎Docs

@nadahalli nadahalli requested a review from a team as a code owner April 13, 2026 12:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

CORA - Pending Reviewers

Codeowners Entry Overall Num Files Owners
/core/capabilities/ 2 @smartcontractkit/keystone, @smartcontractkit/capabilities-team
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.

@cl-sonarqube-production
Copy link
Copy Markdown

vaultReq := &vault.GetSecretsRequest{
Requests: make([]*vault.SecretRequest, 0, len(params.Secrets)),
Requests: make([]*vault.SecretRequest, 0, len(params.Secrets)),
WorkflowOwner: normalizedOwner,
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.

When is this relay going to be productionized or enabled on staging?
If sometime soon, then lets keep this as a gated behavior like other places.

As examples, see these:

if orgIDGateEnabled {
metadata.OrgID = s.orgID
}

https://github.com/smartcontractkit/confidential-compute/blob/d15b1f458d2b7e85d314577bdf56dbd2dfd855a3/capabilities/framework/executor.go#L892-L899

Method: vault.MethodGetSecrets,
CapabilityId: vault.CapabilityID,
Config: values.EmptyMap(),
Metadata: capabilities.RequestMetadata{
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.

You need to set OrgID here too, and behind the same gate as this:

if orgIDGateEnabled {
metadata.OrgID = s.orgID
}

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.

3 participants