From 643d5fe9bf7beb384546b77ee51c079a262925c7 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 19 Jun 2026 16:11:13 +0000 Subject: [PATCH] Fix DPoP schema export types Co-authored-by: Julius Marminge --- packages/shared/src/dpop.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/shared/src/dpop.ts b/packages/shared/src/dpop.ts index 0d028fb3aa..4d671eab75 100644 --- a/packages/shared/src/dpop.ts +++ b/packages/shared/src/dpop.ts @@ -6,37 +6,32 @@ import * as Result from "effect/Result"; import * as Schema from "effect/Schema"; import { - DpopPublicJwk, + DpopPublicJwk as DpopPublicJwkSchema, normalizeDpopHtuOption, type DpopPublicJwk as DpopPublicJwkType, } from "./dpopCommon.ts"; import { stableStringify } from "./relaySigning.ts"; -export { DpopPublicJwk, normalizeDpopHtu, normalizeDpopHtuOption } from "./dpopCommon.ts"; -export type { DpopPublicJwk } from "./dpopCommon.ts"; +export const DpopPublicJwk = DpopPublicJwkSchema; +export type DpopPublicJwk = DpopPublicJwkType; +export { normalizeDpopHtu, normalizeDpopHtuOption } from "./dpopCommon.ts"; const DPOP_TYP = "dpop+jwt"; const DPOP_ALG = "ES256"; const DEFAULT_MAX_AGE_SECONDS = 300; -interface DpopJwtHeader { - readonly typ: string; - readonly alg: string; - readonly jwk: DpopPublicJwkType; -} - interface DpopJwtPayload { readonly htm: string; readonly htu: string; readonly jti: string; readonly iat: number; - readonly ath?: string; + readonly ath?: string | undefined; } const DpopJwtHeaderSchema = Schema.Struct({ typ: Schema.Literal(DPOP_TYP), alg: Schema.Literal(DPOP_ALG), - jwk: DpopPublicJwk, + jwk: DpopPublicJwkSchema, }); const decodeDpopJwtHeader = Schema.decodeUnknownOption(DpopJwtHeaderSchema);