Skip to content

Commit 22e7600

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

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

  • apps/mobile/src/features/cloud

‎apps/mobile/src/features/cloud/dpop.ts‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
computeDpopAccessTokenHash,
1313
computeDpopJwkThumbprint,
1414
DpopPublicJwk,
15+
redactDpopRequestTarget,
1516
} from "@t3tools/shared/dpop";
1617

1718
export class CloudDpopStorageError extends Schema.TaggedErrorClass<CloudDpopStorageError>()(
@@ -168,15 +169,6 @@ function base64UrlToBytes(value: string): Uint8Array {
168169
return Result.getOrThrow(Encoding.decodeBase64Url(value));
169170
}
170171

171-
function redactDpopRequestTarget(url: string): string {
172-
try {
173-
const parsed = new URL(url);
174-
return `${parsed.protocol}//${parsed.host}${parsed.pathname}`;
175-
} catch {
176-
return "<invalid-url>";
177-
}
178-
}
179-
180172
function publicJwkFromUncompressedPublicKey(publicKey: Uint8Array): DpopPublicJwk {
181173
if (publicKey.length !== 65 || publicKey[0] !== 0x04) {
182174
throw new DpopPublicKeyFormatError({

0 commit comments

Comments
 (0)