Repository navigation
fix(flowVaultConnections): stop exporting read-only account_name and ready - #1532
Conversation
…ready Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1532 +/- ##
==========================================
+ Coverage 82.58% 82.64% +0.06%
==========================================
Files 193 193
Lines 9301 9301
Branches 2061 2061
==========================================
+ Hits 7681 7687 +6
+ Misses 819 816 -3
+ Partials 801 798 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…n dump tests Co-Authored-By: Claude <noreply@anthropic.com>
| } | ||
| ``` | ||
|
|
||
| Because `setup` is never exported, running an export over the same files removes it. Keep it in version control or re-add it afterwards. |
There was a problem hiding this comment.
Maybe worth adding here that a config with setup will show as an UPDATE on every dry run, since it's never exported?
There was a problem hiding this comment.
Added. Also noted AUTH0_IGNORE_DRY_RUN_FIELDS with { "flowVaultConnections": ["setup"] } to hide it from the preview.
Co-Authored-By: Claude <noreply@anthropic.com>
ankita10119
left a comment
There was a problem hiding this comment.
Approving. One optional follow-up: an old export with an edited account_name or ready still shows an UPDATE in dry run that import drops. Adding ignoreDryRunFields: ['account_name', 'ready'] to the handler (like clientGrants) would hide it. Happy for that to go in here or later.
Done, added |
Co-Authored-By: Claude <noreply@anthropic.com>
🔧 Changes
Flow vault connection export wrote
account_nameandreadyintoflow-vault-connections/*.jsonandtenant.yaml, but the Management API accepts neither field on create or update. Import already drops them, so a value (or a keyword mapping) set on those fields in an exported file looked editable but was silently discarded.Both dump handlers (directory and YAML) now leave
account_nameandreadyout of the export. Import is unchanged, so older exports that still contain them import as before and the fields are ignored. Added a short "Flow Vault Connections" note todocs/resource-specific-documentation.md.The docs also explain how to manage
setup: it is not exported, it accepts keyword replacement in both formats (##KEY##for a string, a quoted'@@KEY@@'for a whole object), and a later export over the same files removes it.This changes export output for this resource. Anyone who commits their exports will see a one-time diff removing those two lines. Deploys are not affected.
Dry-run also ignores
account_nameandreadyfor flow vault connections. Import never sends them, so an old export with edited values no longer shows a dry-run UPDATE that the import would discard.Shape
Directory, before:
{ "name": "My Connection", "app_id": "HTTP", "account_name": "Bearer tok***one", "ready": true }Directory, after:
{ "name": "My Connection", "app_id": "HTTP" }YAML, before:
YAML, after:
📚 References
Fixes #1523
🔬 Testing
Unit tests
Updated in
test/context/directory/flowVaultConnections.test.jsandtest/context/yaml/flowVaultConnections.test.js:account_nameandreadywrites onlynameandapp_id. The directory "sanitized" test and the YAML dump test assert this against literal output. The earlier directory dump test compared the file against the objectdumpmutates in place, so it could not fail. It duplicated the sanitized test, so it was removed.setupworks in both formats:##KEY##as a string value and'@@KEY@@'as a whole object.account_nameorreadydiffer, but still reports one when a real field such asapp_idchanges.Updated in
test/tools/auth0/handlers/flowVaultConnections.tests.js:account_nameandreadyare not sent. This guards existing import behavior, which the docs now describe.Manual verification
Against a live tenant with no flow vault connections, after
npm run build:HTTPconnection with a bearersetuptoken, plusaccount_nameandreadyset in the file. The dry-run lists a CREATE and the real import creates it. Reading it back from the Management API showsaccount_namegenerated by the API (for exampleBearer tok***one), not the value from the file.account_nameis absent from the connection files.setupis still not exported, as before.readyandaccount_namedo not change.account_nameandreadyare hand-edited andsetupis absent. It shows no flow vault change, where it previously showed an UPDATE.Not covered: the
readyremoval was added after this live pass, so it is covered by the unit tests only. AnAUTH0connection withOAUTH_APPsetup could not be created on the test tenant (the API returned 400 "Failed to create OAuth session", also when called directly), soaccount_namefor that type is unverified.📝 Checklist