Skip to content

Allign local secrets with worker by JSON-parsing string values.#293

Open
nvyasadobe wants to merge 3 commits intodevelopfrom
CEXT-6008-local-secrets-parsing
Open

Allign local secrets with worker by JSON-parsing string values.#293
nvyasadobe wants to merge 3 commits intodevelopfrom
CEXT-6008-local-secrets-parsing

Conversation

@nvyasadobe
Copy link
Copy Markdown
Contributor

@nvyasadobe nvyasadobe commented Apr 7, 2026

Description

Local aio api-mesh run loads secrets from .mesh/secrets.yaml, stringifies them into the SECRETS env var, and the dev server parses that JSON.
String values stayed strings, so paths like context.secrets.TOKEN.COMMERCE failed when TOKEN was authored as a JSON blob in YAML (e.g. TOKEN: '{"COMMERCE": "dummy-value"}').

On the deployed tenant worker, each SECRETS__* binding is passed through JSON.parse when possible, so the same YAML shape becomes a nested object at runtime and those paths work.

Related Issue

https://jira.corp.adobe.com/browse/CEXT-6008

Motivation and Context

How Has This Been Tested?

  • Validated by making a local link of CLI and confirm that JSON in YAML is working same as tenant worker.
  • In secrets.yaml => TOKEN: '{"COMMERCE": "dummy-value"}'
  • In mesh.json => "secret3": "{context.secrets.TOKEN.COMMERCE}"
  • When query mesh secret3 resolves in: "secret3": "dummy-value"

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

romario-0
romario-0 previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Contributor

@AjazSumaiya AjazSumaiya left a comment

Choose a reason for hiding this comment

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

@nvyasadobe does this change has any tests added

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.

4 participants