Skip to content

feat(secret-paths): derive and publish credential masking paths - #5641

Merged
shekhar-rudder merged 18 commits into
developfrom
harness/RUD-3250-feat-secret-paths-derive-and-pu-1129b831
Oct 9, 2026
Merged

shekhar-rudder merged 18 commits into
developfrom
harness/RUD-3250-feat-secret-paths-derive-and-pu-1129b831

Conversation

@rudder-devbox

@rudder-devbox rudder-devbox Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Write a brief explainer on your code changes.

This PR derives destination credential locations from component fixtures and rudder-integrations-config secretKeys, commits the deterministic direct-map artifact, and publishes it through the cached GET /features response.

What is the related Linear task?

Resolves RUD-3250

Please explain the objectives of your changes below

  • Derive configured and runtime credential paths with two unchanged baselines and two distinct format-preserving decoys.
  • Treat direct containment of runtime-bag credentials as evidence, including OAuth1 headers and non-HTTP delivered payload fields.
  • Fail generation instead of publishing a partial result when substitutions are unstable or output cannot be addressed safely.
  • Restrict published paths to delivered request fields and centrally exclude endpoint.
  • Publish the committed map directly through GET /features and cache its serialized response.
  • Gate PRs on deterministic regeneration against rudder-integrations-config develop.

The committed artifact currently covers 189 destinations: 126 have derived paths and 63 have nothing maskable in the exercised corpus. The map is the wire-format Record<string, string[]> itself, with no timestamps, source refs, hashes, or diagnostic envelope.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes?

GET /features now includes secretPaths. Existing capability fields are unchanged. Derivation only runs in tooling/CI; runtime imports the committed artifact once and serves pre-serialized feature bytes.

Any new dependencies introduced with this change?

N/A

Any new generic utility introduced or modified. Please explain the changes.

Added shared gjson/sjson path escaping and normalization, fixture request traversal, deterministic artifact validation, and Jest-hosted generator tooling under src/secretPaths/tooling (excluded from the production TypeScript build).

Any technical or performance related pointers to consider with the change?

The frequently-polled /features response is serialized once at module initialization. No fixture replay, destination-definition read, validation, or other derivation work runs per request.


Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change?
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?
  • Verified that there are no credentials or confidential data exposed with the changes.

Validation

  • npm run lint — passed
  • Secret-path focused Jest suites — passed (37 tests)
  • X_AUDIENCE component suite — passed (6 tests)
  • TWITTER_ADS component suite — passed (25 tests)
  • GOOGLE_ADWORDS_REMARKETING_LISTS component suite — passed (81 tests)
  • npm run check:secret-paths against the integrations-config destination definitions — passed; committed bytes match fresh derivation across all 189 destinations
  • npm run format:ci — passed
  • git diff --check — passed

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

👋 I'm rudder-devbox. I opened this PR from a Linear ticket.

Mention @devbox or @rudder-devbox and I'll act on it — on a top-level PR comment,
in a review summary, or on an inline comment on the diff. Without a mention I won't see it.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6fb708d2-729f-4ebc-a957-31077ddec5b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

The generated-secret-path job failed before running its checks: the log shows actions/checkout retrying refs/heads/develop for rudder-integrations-config three times, then exiting 1 because that repository exposes main, not develop.

I updated the workflow checkout name and ref to main, verified that upstream branch exists, ran Prettier and git diff --check, and pushed the fix.

Commit: 753e959

@rudder-devbox

rudder-devbox Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.78689% with 533 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.11%. Comparing base (11d917f) to head (8460431).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/secretPaths/tooling/generate.ts 31.81% 330 Missing ⚠️
src/secretPaths/tooling/harness.ts 29.85% 148 Missing ⚠️
src/secretPaths/tooling/declared.ts 17.91% 55 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5641      +/-   ##
===========================================
- Coverage    93.32%   92.11%   -1.22%     
===========================================
  Files          703      708       +5     
  Lines        38742    39534     +792     
  Branches      9007     9272     +265     
===========================================
+ Hits         36157    36416     +259     
- Misses        2400     2933     +533     
  Partials       185      185              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- run the fetched-credential pass once per destination instead of twice on the rescue path
- reuse hasSameShape/locationsForKey in the fetched-credential pass instead of an inline copy
- fold the two decoy runs into one loop and add a debug() helper
- use parsePath/formatPath in collapseKeyFamily and validateSecretPaths instead of a lookbehind split
- share SecretPaths type and implemented-destination list; drop write-only state and dead helpers
- fix argOf truncating values containing '='; restore the features.ts section banner

Regenerated artifact is byte-identical; validation reports zero survivor drift.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/secretPaths/index.ts Resolved
Comment thread test/secret-paths/run.js Resolved
Comment thread test/secret-paths/harness.ts Resolved
Comment thread test/secret-paths/generate.ts Resolved
Comment thread test/secret-paths/validate.ts Resolved
Comment thread tsconfig.secret-paths.json Resolved
Comment thread test/secret-paths/args.ts Resolved
shekhar-rudder and others added 2 commits October 9, 2026 16:29
…passes

- one runCorroboratedDecoys helper for the config and fetched-credential passes
- locationsForKey takes source as an optional last argument
- debug() takes a thunk so messages are only built when debugging
- round-trip test exercises formatPath

Regenerated artifact is byte-identical; validation reports zero survivor drift.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 11:23
Comment thread tsconfig.secret-paths.json Resolved
Comment thread .prettierignore Resolved
Comment thread test/secret-paths/generate.ts Resolved
Comment thread src/secretPaths/tooling/generate.ts Resolved
Comment thread .github/workflows/verify.yml Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 12:18
Comment thread src/secretPaths/tooling/generate.ts Resolved
Comment thread src/secretPaths/tooling/generate.ts Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 12:30
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

Comment thread tsconfig.secret-paths.json Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

Comment thread tsconfig.json Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Task failed — check control-plane logs for details.

@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 15:29
shekhar-rudder and others added 2 commits October 9, 2026 21:07
- load each destination's derivable fixtures once and share them across passes
- run the fetched-credential pass once, with one unstable-source decision
- drop Movement.source, keep comparison evidence only for the endpoint, remove withoutUnreadEvidence
- one header-name-from-config check; inline the header collapse into toSecretPaths
- replace the outcome recorder with direct empty/failure writes; stop the harness in finally
- cache serialised mocks per destination; preload only requested destinations' fixtures
- move path.ts under tooling (only the generator uses it); lint tooling via tsconfig.test.json
  and delete tsconfig.secret-paths.json; check:secret-paths reuses generate:secret-paths
- fix stale comments (fail-closed wording, SALESFORCE_OAUTH story, README branch)

Regenerated artifact is unchanged; check:secret-paths passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- parse SECRET_PATHS_DESTINATION once and share it between the fixture preload and main
- serialise mocks lazily, only for the destination currently being derived
- one guard for an unstable source; drop the failUnstable closure and the unused EmptyReason
- rename withConfigHeaderEvidence to markConfigHeader (it attaches no evidence)

Regenerated artifact is unchanged; check:secret-paths passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/secretPaths/tooling/generate.ts Resolved
Comment thread src/secretPaths/secretPaths.json Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 16:05
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

- declare the request payload fields once in path.ts; derive the delivered, maskable and
  wrapper sets from it (maskable is a Set, so validateSecretPaths needs no cast or # clause)
- one carriesAnySecret helper shared by the runtime-bag, non-http and mock-response checks
- nonHttpSecretCarriersIn: one walker over isObj instead of two mutually recursive ones
- scan non-http outputs only when no case built a request; skip the unused second transform
  in runBaseline when the first built nothing
- recordNonHttp helper in main instead of a callback-and-boolean function
- README: drop the repeated bag sentence and the diagnostics that are not reason codes

Regenerated artifact is unchanged; check:secret-paths passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@shekhar-rudder
shekhar-rudder marked this pull request as ready for review October 9, 2026 16:27
@shekhar-rudder
shekhar-rudder requested review from a team as code owners October 9, 2026 16:27
Comment thread src/secretPaths/secretPaths.json Resolved
Comment thread src/secretPaths/secretPaths.json Resolved
@rudder-devbox

rudder-devbox Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Knowledge distillation completed

@rudder-devbox
rudder-devbox Bot requested a review from shekhar-rudder October 9, 2026 16:42
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@shekhar-rudder
shekhar-rudder merged commit 25fca9d into develop Oct 9, 2026
48 of 49 checks passed
@shekhar-rudder
shekhar-rudder deleted the harness/RUD-3250-feat-secret-paths-derive-and-pu-1129b831 branch October 9, 2026 17:11
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