Files
coder/coderd
Steven Masley b16153960d fix(coderd): normalize workspace secret path comparisons (#32868)
## Why

`~/.token` and `~//.token` point to the same file, but a workspace build
could accept a different secret for each spelling. Replacing a secret on
a later build could leave the old value active alongside its
replacement.

## How

Validation, carry-forward, and delivery now use the same key to compare
file paths. The stored paths stay as entered, so existing secrets need
no migration.

<details>
<summary>Decision and regression coverage</summary>

Comparison is lexical: `~/../~/x` and `~/x` count as a collision even if
they would resolve to different files on the agent. A regression test
pins that behavior. The database still indexes the original spelling, so
existing aliases can carry forward together until a new secret claims
their target. Regression tests check the field-specific validation error
and verify that only the replacement survives a later build.

Original report:
https://github.com/coder/coder/pull/30250#discussion_r4272372439
(RELAY-64).

</details>

Created by Coder Agents on behalf of @Emyrk.
2026-12-03 09:49:43 -06:00
..