Skip to content

Commit d8a8df1

Browse files
juliusmarmingecodex
andcommitted
Reuse shared DPoP request redaction
Co-authored-by: codex <[email protected]>
1 parent fc83f36 commit d8a8df1

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

‎apps/web/src/cloud/dpop.ts‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
computeDpopAccessTokenHash,
33
computeDpopJwkThumbprint,
44
DpopPublicJwk,
5+
redactDpopRequestTarget,
56
} from "@t3tools/shared/dpop";
67
import * as Crypto from "effect/Crypto";
78
import * as Effect from "effect/Effect";
@@ -78,15 +79,6 @@ const DPOP_KEY_STORE_NAME = "keys";
7879
const DPOP_KEY_ID = "relay-dpop-proof-key";
7980
const decodeDpopPublicJwk = Schema.decodeUnknownEffect(DpopPublicJwk);
8081

81-
function redactDpopRequestTarget(url: string): string {
82-
try {
83-
const parsedUrl = new URL(url);
84-
return `${parsedUrl.protocol}//${parsedUrl.host}${parsedUrl.pathname}`;
85-
} catch {
86-
return "<invalid-url>";
87-
}
88-
}
89-
9082
export const browserCryptoLayer = Layer.succeed(
9183
Crypto.Crypto,
9284
Crypto.make({

0 commit comments

Comments
 (0)