Skip to content

Commit 39278ad

Browse files
committed
fix(server): use Node hashing with pinned Effect crypto
1 parent 5d62cde commit 39278ad

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/server/src/peer/PeerLinks.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// @effect-diagnostics-next-line nodeBuiltinImport:off -- The pinned Effect Crypto service has no digest API.
2+
import * as NodeCrypto from "node:crypto";
13
import {
24
AuthMcpClientAccess,
35
AuthMcpRegistrationError,
@@ -192,9 +194,7 @@ const make = Effect.gen(function* () {
192194
// Relinking replaces the destination OAuth namespace. A pending launch may
193195
// replay only through its original grant, even when its environment is unchanged.
194196
const launchIdentity = (secretName: string) =>
195-
crypto
196-
.digest("SHA-256", new TextEncoder().encode(secretName))
197-
.pipe(Effect.map(Hex.encode), Effect.orDie);
197+
Effect.sync(() => NodeCrypto.createHash("sha256").update(secretName).digest("hex"));
198198

199199
// Only the origin `peerOrigin` checked may receive a pairing code or token:
200200
// a redirect could forward them anywhere, including plain http.

0 commit comments

Comments
 (0)