Escape store auth session keys#7864
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| } | ||
|
|
||
| function escapeStoreAuthSessionKeySegment(value: string): string { | ||
| return value.replace(/\./g, '\\.') |
There was a problem hiding this comment.
is it better to escape or to replace them? maybe is safer to use -?
There was a problem hiding this comment.
I think escaping is safer here than replacing with -: - is valid in store domains, so replacement can create collisions between distinct domains. dot-prop explicitly supports escaped dots for this exact case, and the persisted JSON key remains the original domain string rather than an encoded/replaced value. If we want to avoid relying on dot-prop escaping semantics entirely, I think encodeURIComponent(store) would be the safer alternative over - replacement.
a571bc3 to
9e2c4f3
Compare
067f712 to
57d47f2
Compare
4513bd6 to
a868c3a
Compare
Assisted-By: devx/a802aefd-9486-4d1e-bf5d-9541c093b99d
a868c3a to
c324278
Compare
57d47f2 to
3f7e81a
Compare

WHY are these changes introduced?
Follow-up to discussion on #7709 about avoiding recursive crawling of
confstorage for store-auth sessions.WHAT is this pull request doing?
Escapes dots in store-auth session keys before passing them to
conf, so a store domain is persisted as one top-level key instead of a nested dotted path. The listing code now scans only top-level store-auth buckets and ignores legacy nested entries.This intentionally means stores authenticated with the old nested key format may need to be re-authenticated.
How to test your changes?
Post-release steps
None.
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add