Skip to content

Allow dot-separated paths into nested JSON in awsSecret and awsParam - #1291

Merged
theoephraim merged 4 commits into
dmno-dev:mainfrom
jsskeen-utah:feat/aws-secrets-nested-json-keys
Nov 12, 2026
Merged

theoephraim merged 4 commits into
dmno-dev:mainfrom
jsskeen-utah:feat/aws-secrets-nested-json-keys

Conversation

@jsskeen-utah

@jsskeen-utah jsskeen-utah commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

awsSecret() and awsParam() can now read nested JSON with a dot-separated key:

# secret: {"db": {"host": "db.example.com"}}
DB_HOST=awsSecret("db-config#db.host")

Secrets Manager secrets are usually flat key-value JSON, and that stays the default. Nested objects are useful when one secret describes one thing with several parts, such as a database connection or a set of feature flags. Before this change, the plugin could only read top-level keys, so nested values had to be flattened or read in application code.

An exact top-level key with the same name still wins, so existing keys that contain dots keep working. Object and array values come back as JSON text instead of [object Object].

The lookup is in src/json-key.ts so it can be unit tested. Error messages and tips are unchanged, except that a missing nested key lists the keys at the level where the path stopped.

The website docs include a worked example: a secret with nested db and featureFlags sections and the schema that reads its values.

An exact top-level key still wins, so existing keys with dots keep working. Object and array values are returned as JSON text instead of [object Object].

@pullfrog pullfrog Bot left a comment

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.

✅ No new issues found.

Reviewed changes: Reviewed nested JSON extraction for both AWS resolvers, including cached and uncached call paths.

  • JSON lookup: Adds dot-separated traversal with exact top-level key precedence and JSON serialization for object and array values.
  • Resolver integration: Shares lookup logic between awsSecret() and awsParam() while retaining service-specific errors.
  • Tests and documentation: Adds 11 passing lookup tests and documents the behavior; plugin typechecking also passes.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@pullfrog pullfrog Bot left a comment

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.

ℹ️ No runtime concerns found. Two minor documentation corrections are noted inline.

Reviewed changes: Reviewed the documentation added since the previous Pullfrog review.

  • Added a worked example: Documented nested database settings and feature flags with corresponding typed .env.schema entries.
  • Explained lookup behavior: Added guidance on named keys, JSON serialization, missing-path hints, and key precedence.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

@theoephraim
theoephraim merged commit d3b12c4 into dmno-dev:main Nov 12, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants