Skip to content

Commit 3bdf109

Browse files
radroidclaude
andcommitted
fix(coil): report the DPoP failure reason on the auto-resume route
`authenticateWithOperateScope` mirrors upstream's module-private `authenticateRawRouteWithScope`, which grew a second argument in this range. The parameter is optional, so the stale one-argument call compiled and drifted silently: a relay client whose DPoP proof failed got a precise, actionable reason from every environment endpoint except this one, because `mapRemoteDpopEnvironmentError` reads a field the fork's route never set. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 88d5e24 commit 3bdf109

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • apps/server/src/coil/autoResume

‎apps/server/src/coil/autoResume/http.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ const authenticateWithOperateScope = Effect.gen(function* () {
4747
const serverAuth = yield* EnvironmentAuth.EnvironmentAuth;
4848
const session = yield* serverAuth.authenticateHttpRequest(request).pipe(
4949
Effect.catchIf(EnvironmentAuth.isServerAuthCredentialError, (error) =>
50-
failEnvironmentAuthInvalid(EnvironmentAuth.serverAuthCredentialReason(error)),
50+
// Second argument tracks upstream's `authenticateRawRouteWithScope`, which
51+
// this mirrors. `dpopFailureReason` is optional, so dropping it compiles —
52+
// it just costs a relay client the precise reason (clock skew being the
53+
// motivating case) that every other environment endpoint reports.
54+
failEnvironmentAuthInvalid(
55+
EnvironmentAuth.serverAuthCredentialReason(error),
56+
EnvironmentAuth.serverAuthDpopFailureReason(error),
57+
),
5158
),
5259
Effect.catchIf(EnvironmentAuth.isServerAuthInternalError, (error) =>
5360
failEnvironmentInternal("internal_error", error),

0 commit comments

Comments
 (0)