You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6d3a834
Browse filesBrowse the repository at this point in the historyBrowse files
fix(workspace): carry the validated credential and path instead of re-deriving
Round-3 review findings on #1320. Both are the same shape: a value is validated
once, then re-derived after an await gap instead of the validated value being
carried through.
Credential (ABA). The previous fix compared a credential digest before and
after `listDatamates()`, which cannot distinguish "unchanged" from "changed and
changed back" — an A->B->A switch passed the comparison while the answer had
been served as B. `req()` now accepts `actAs`, and the pin's validation request
is handed the exact credential its cache key was built from. There is nothing
left to compare when the request and the key are the same credential by
construction, so the before/after check is deleted rather than elaborated.
`actAs` is additive: every other `req()` and `listDatamates()` call site is
untouched and still resolves the ambient credential. The one behavioural
difference is documented at the option — a caller passing `actAs` skips the
`isConfigured()` gate, which is a file-existence check on the file it has just
read, so deleting the credentials file mid-flight no longer aborts that single
request.
Path. Containment was checked against the caller's directory string, then the
identifier was resolved from that same string after the credential and network
awaits. A symlink swapped in the gap would be resolved by the second call and
not the first, so the path that was authorised and the path that was used need
not be the same. `resolveWithinRoot` returns the canonical directory it
validated and the caller carries it forward. `withinRoot` stays as the boolean
predicate, now expressed in terms of it, so its contract and tests are
unchanged.
Tests: the verification request carries the captured credential; an A->B->A
swap mid-request cannot mis-attribute the answer; the canonical path is what
callers receive, including for a directory that does not exist yet.
Verified the two failures in `test/altimate/tools/datamate-list-integrations`
are pre-existing — they reproduce on a clean tree with these changes stashed.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments