@atlasauth/pca-dpop 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,136 @@
1
+ /**
2
+ * `@atlasauth/pca-dpop` — sender-constrained proof-of-possession for PCA.
3
+ *
4
+ * Two PoP mechanisms, bound to a PCActn's REAL holder key so an action is tied to the holder it was
5
+ * delegated to and interops with OAuth proof-of-possession:
6
+ *
7
+ * - **RFC 9449 DPoP**: a holder-key-signed `dpop+jwt` proof over the HTTP method + target URI. The
8
+ * public key rides in the proof header (`jwk`); its RFC 7638 thumbprint is the `jkt`.
9
+ * - **RFC 8705 mTLS**: an `x5t#S256` certificate-thumbprint confirmation for the mutual-TLS channel.
10
+ *
11
+ * The PCActn's bound holder key is the LEAF of its capability chain — `cap_chain[last].holder` — a
12
+ * base64url (no-pad) Ed25519 public key (see `@atlasauth/pca` `Capability.holder`, which the core leaf
13
+ * signature is verified under). That raw key is exactly an OKP/Ed25519 JWK with `x = holder`, so a DPoP
14
+ * proof signed by the holder key, embedding that OKP JWK, has a `jkt` equal to the PCActn's binding —
15
+ * {@link bindPcaToDpop} computes that binding and {@link assertPcaDpop} enforces it against a proof.
16
+ */
17
+ import type { JWK, JWTPayload, KeyLike } from 'jose';
18
+ import { type PCActn } from '@atlasauth/pca';
19
+ /** JWS algorithms a DPoP proof may use: asymmetric only, never `none` or a MAC (RFC 9449 §4.2). */
20
+ export declare const DPOP_ALLOWED_ALGS: readonly ["EdDSA", "ES256", "ES384", "ES512", "PS256", "RS256"];
21
+ export type DpopAlg = (typeof DPOP_ALLOWED_ALGS)[number];
22
+ /** DPoP proof type header (`typ`), RFC 9449 §4.2. */
23
+ export declare const DPOP_JWT_TYP = "dpop+jwt";
24
+ /** Default accepted proof age (seconds) when a caller does not pass `maxAgeSec`. */
25
+ export declare const DPOP_DEFAULT_MAX_AGE_SEC = 300;
26
+ /** Clock-skew allowance (seconds) for a proof whose `iat` is slightly ahead of the verifier. */
27
+ export declare const DPOP_CLOCK_SKEW_SEC = 5;
28
+ /** A DPoP proof (or PCActn↔DPoP binding) that failed to verify. `code` names the specific check. */
29
+ export declare class DpopVerificationError extends Error {
30
+ readonly code: string;
31
+ constructor(code: string, message: string);
32
+ }
33
+ /** The claim set carried by a DPoP proof JWT (RFC 9449 §4.2), with the always-present claims typed. */
34
+ export interface DpopClaims extends JWTPayload {
35
+ /** HTTP method of the request the proof is for (uppercase). */
36
+ htm: string;
37
+ /** HTTP target URI, query + fragment stripped (RFC 9449 §4.3). */
38
+ htu: string;
39
+ /** Issued-at, epoch SECONDS. */
40
+ iat: number;
41
+ /** Unique proof id (replay token). */
42
+ jti: string;
43
+ /** Optional server-provided DPoP nonce. */
44
+ nonce?: string;
45
+ /** Optional access-token hash: base64url(sha256(access token)). */
46
+ ath?: string;
47
+ }
48
+ /** A replay store for `jti` values. A plain `Set<string>` satisfies this. */
49
+ export interface JtiSeenSet {
50
+ has(jti: string): boolean;
51
+ add(jti: string): unknown;
52
+ }
53
+ export interface CreateDpopProofInput {
54
+ /** HTTP method (case-insensitive in; stored uppercased as `htm`). */
55
+ method: string;
56
+ /** Full request URL; `htu` is this with query + fragment removed. */
57
+ url: string;
58
+ /** The holder's PRIVATE key that signs the proof. */
59
+ privateKey: KeyLike | Uint8Array | JWK;
60
+ /** The holder's PUBLIC JWK, embedded in the proof header (`jwk`); drives the `alg`. */
61
+ publicJwk: JWK;
62
+ /** Optional server-issued DPoP nonce. */
63
+ nonce?: string;
64
+ /** Optional access-token hash (see {@link athFor}). */
65
+ ath?: string;
66
+ /** Override the issued-at (epoch seconds); default `now`. */
67
+ iat?: number;
68
+ /** Override the proof id; default a random UUID. */
69
+ jti?: string;
70
+ }
71
+ export interface VerifyDpopProofOptions {
72
+ method: string;
73
+ url: string;
74
+ /** Maximum accepted proof age in seconds (from `iat` to now). */
75
+ maxAgeSec: number;
76
+ /** If given, the embedded key's RFC 7638 thumbprint MUST equal this `jkt`. */
77
+ expectedJkt?: string;
78
+ /** If given, a repeated `jti` is rejected and a fresh one is recorded. */
79
+ seenJti?: JtiSeenSet;
80
+ /** Override "now" (epoch seconds) — for tests / fixed clocks. */
81
+ nowSec?: number;
82
+ }
83
+ export interface DpopVerifyResult {
84
+ /** The verified, type-checked DPoP claims. */
85
+ claims: DpopClaims;
86
+ /** The public JWK the proof was signed with (from the header). */
87
+ jwk: JWK;
88
+ /** RFC 7638 SHA-256 thumbprint of {@link DpopVerifyResult.jwk}. */
89
+ jkt: string;
90
+ }
91
+ /** RFC 8705 §3.1 confirmation: the client certificate's SHA-256 thumbprint. */
92
+ export interface MtlsCnf {
93
+ 'x5t#S256': string;
94
+ }
95
+ /** RFC 7638 JWK SHA-256 thumbprint (base64url), via jose. */
96
+ export declare function jwkThumbprint(jwk: JWK, digest?: 'sha256' | 'sha384' | 'sha512'): Promise<string>;
97
+ /** The JWS `alg` for a key, derived from its JWK `kty`/`crv`. Throws for unsupported/MAC keys. */
98
+ export declare function dpopAlgForJwk(jwk: JWK): DpopAlg;
99
+ /** The HTTP target URI with query + fragment stripped (RFC 9449 §4.3), e.g. `https://host:443/path`. */
100
+ export declare function normalizeHtu(url: string): string;
101
+ /** The DPoP access-token hash `ath`: base64url(SHA-256(access token)), RFC 9449 §4.2. */
102
+ export declare function athFor(accessToken: string): string;
103
+ /** Build and sign a DPoP proof JWT (`typ: dpop+jwt`, embedded public `jwk`, claims htm/htu/iat/jti …). */
104
+ export declare function createDpopProof(input: CreateDpopProofInput): Promise<string>;
105
+ /**
106
+ * Verify a DPoP proof: signature under the embedded `jwk`, `typ`, that `htm`/`htu` match the request,
107
+ * `iat` freshness, optional `jkt` match and optional `jti` replay rejection. Throws
108
+ * {@link DpopVerificationError} on any failure; returns the verified claims + key thumbprint on success.
109
+ */
110
+ export declare function verifyDpopProof(proof: string, opts: VerifyDpopProofOptions): Promise<DpopVerifyResult>;
111
+ /**
112
+ * RFC 8705 §3.1 `cnf` confirmation for a mutual-TLS client certificate: `{ "x5t#S256": b64u(sha256(DER)) }`.
113
+ * Accepts the certificate as DER bytes or as a PEM string.
114
+ */
115
+ export declare function mtlsCnf(certDerOrPem: Uint8Array | string): MtlsCnf;
116
+ /**
117
+ * The OKP/Ed25519 public JWK of the PCActn's bound holder key — the LEAF of its capability chain
118
+ * (`cap_chain[last].holder`, a base64url Ed25519 public key). Throws if the chain is empty.
119
+ */
120
+ export declare function leafHolderJwk(p: PCActn): JWK;
121
+ /** The `cnf: { jkt }` confirmation for a PCActn's bound holder key (RFC 9449 §6 jkt binding). */
122
+ export declare function bindPcaToDpop(p: PCActn): Promise<{
123
+ jkt: string;
124
+ }>;
125
+ /**
126
+ * Confirm a presented DPoP proof is held by the PCActn's bound holder key AND is for the given HTTP
127
+ * target: verifies the proof with `expectedJkt` fixed to the PCActn's leaf-holder thumbprint. Throws
128
+ * {@link DpopVerificationError} on any mismatch; returns the verified result on success.
129
+ */
130
+ export declare function assertPcaDpop(p: PCActn, dpopProof: string, opts: {
131
+ method: string;
132
+ url: string;
133
+ maxAgeSec?: number;
134
+ seenJti?: JtiSeenSet;
135
+ nowSec?: number;
136
+ }): Promise<DpopVerifyResult>;
package/dist/index.js ADDED
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ /**
3
+ * `@atlasauth/pca-dpop` — sender-constrained proof-of-possession for PCA.
4
+ *
5
+ * Two PoP mechanisms, bound to a PCActn's REAL holder key so an action is tied to the holder it was
6
+ * delegated to and interops with OAuth proof-of-possession:
7
+ *
8
+ * - **RFC 9449 DPoP**: a holder-key-signed `dpop+jwt` proof over the HTTP method + target URI. The
9
+ * public key rides in the proof header (`jwk`); its RFC 7638 thumbprint is the `jkt`.
10
+ * - **RFC 8705 mTLS**: an `x5t#S256` certificate-thumbprint confirmation for the mutual-TLS channel.
11
+ *
12
+ * The PCActn's bound holder key is the LEAF of its capability chain — `cap_chain[last].holder` — a
13
+ * base64url (no-pad) Ed25519 public key (see `@atlasauth/pca` `Capability.holder`, which the core leaf
14
+ * signature is verified under). That raw key is exactly an OKP/Ed25519 JWK with `x = holder`, so a DPoP
15
+ * proof signed by the holder key, embedding that OKP JWK, has a `jkt` equal to the PCActn's binding —
16
+ * {@link bindPcaToDpop} computes that binding and {@link assertPcaDpop} enforces it against a proof.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.DpopVerificationError = exports.DPOP_CLOCK_SKEW_SEC = exports.DPOP_DEFAULT_MAX_AGE_SEC = exports.DPOP_JWT_TYP = exports.DPOP_ALLOWED_ALGS = void 0;
20
+ exports.jwkThumbprint = jwkThumbprint;
21
+ exports.dpopAlgForJwk = dpopAlgForJwk;
22
+ exports.normalizeHtu = normalizeHtu;
23
+ exports.athFor = athFor;
24
+ exports.createDpopProof = createDpopProof;
25
+ exports.verifyDpopProof = verifyDpopProof;
26
+ exports.mtlsCnf = mtlsCnf;
27
+ exports.leafHolderJwk = leafHolderJwk;
28
+ exports.bindPcaToDpop = bindPcaToDpop;
29
+ exports.assertPcaDpop = assertPcaDpop;
30
+ const jose_1 = require("jose");
31
+ const pca_1 = require("@atlasauth/pca");
32
+ // ---- constants ---------------------------------------------------------------------------------
33
+ /** JWS algorithms a DPoP proof may use: asymmetric only, never `none` or a MAC (RFC 9449 §4.2). */
34
+ exports.DPOP_ALLOWED_ALGS = ['EdDSA', 'ES256', 'ES384', 'ES512', 'PS256', 'RS256'];
35
+ /** DPoP proof type header (`typ`), RFC 9449 §4.2. */
36
+ exports.DPOP_JWT_TYP = 'dpop+jwt';
37
+ /** Default accepted proof age (seconds) when a caller does not pass `maxAgeSec`. */
38
+ exports.DPOP_DEFAULT_MAX_AGE_SEC = 300;
39
+ /** Clock-skew allowance (seconds) for a proof whose `iat` is slightly ahead of the verifier. */
40
+ exports.DPOP_CLOCK_SKEW_SEC = 5;
41
+ // ---- errors ------------------------------------------------------------------------------------
42
+ /** A DPoP proof (or PCActn↔DPoP binding) that failed to verify. `code` names the specific check. */
43
+ class DpopVerificationError extends Error {
44
+ code;
45
+ constructor(code, message) {
46
+ super(message);
47
+ this.name = 'DpopVerificationError';
48
+ this.code = code;
49
+ }
50
+ }
51
+ exports.DpopVerificationError = DpopVerificationError;
52
+ // ---- helpers -----------------------------------------------------------------------------------
53
+ /** RFC 7638 JWK SHA-256 thumbprint (base64url), via jose. */
54
+ function jwkThumbprint(jwk, digest = 'sha256') {
55
+ return (0, jose_1.calculateJwkThumbprint)(jwk, digest);
56
+ }
57
+ /** The JWS `alg` for a key, derived from its JWK `kty`/`crv`. Throws for unsupported/MAC keys. */
58
+ function dpopAlgForJwk(jwk) {
59
+ switch (jwk.kty) {
60
+ case 'OKP':
61
+ if (jwk.crv === 'Ed25519' || jwk.crv === 'Ed448')
62
+ return 'EdDSA';
63
+ throw new DpopVerificationError('unsupported_key', `unsupported OKP curve '${String(jwk.crv)}' for DPoP`);
64
+ case 'EC':
65
+ if (jwk.crv === 'P-256')
66
+ return 'ES256';
67
+ if (jwk.crv === 'P-384')
68
+ return 'ES384';
69
+ if (jwk.crv === 'P-521')
70
+ return 'ES512';
71
+ throw new DpopVerificationError('unsupported_key', `unsupported EC curve '${String(jwk.crv)}' for DPoP`);
72
+ case 'RSA':
73
+ return 'PS256';
74
+ default:
75
+ throw new DpopVerificationError('unsupported_key', `unsupported key type '${String(jwk.kty)}' for DPoP`);
76
+ }
77
+ }
78
+ /** Project a JWK down to its PUBLIC members, so no private material is ever embedded in a proof. */
79
+ function toPublicJwk(jwk) {
80
+ const pub = { kty: jwk.kty };
81
+ if (jwk.crv !== undefined)
82
+ pub.crv = jwk.crv;
83
+ if (jwk.x !== undefined)
84
+ pub.x = jwk.x;
85
+ if (jwk.y !== undefined)
86
+ pub.y = jwk.y;
87
+ if (jwk.n !== undefined)
88
+ pub.n = jwk.n;
89
+ if (jwk.e !== undefined)
90
+ pub.e = jwk.e;
91
+ return pub;
92
+ }
93
+ /** The HTTP target URI with query + fragment stripped (RFC 9449 §4.3), e.g. `https://host:443/path`. */
94
+ function normalizeHtu(url) {
95
+ const u = new URL(url);
96
+ return `${u.protocol}//${u.host}${u.pathname}`;
97
+ }
98
+ /** The DPoP access-token hash `ath`: base64url(SHA-256(access token)), RFC 9449 §4.2. */
99
+ function athFor(accessToken) {
100
+ return (0, pca_1.b64u)((0, pca_1.sha256)(new TextEncoder().encode(accessToken)));
101
+ }
102
+ function freshJti() {
103
+ return globalThis.crypto.randomUUID();
104
+ }
105
+ /** Message of a caught `unknown` without asserting its type. */
106
+ function errMsg(e) {
107
+ return e instanceof Error ? e.message : String(e);
108
+ }
109
+ // ---- DPoP proof: create / verify --------------------------------------------------------------
110
+ /** Build and sign a DPoP proof JWT (`typ: dpop+jwt`, embedded public `jwk`, claims htm/htu/iat/jti …). */
111
+ async function createDpopProof(input) {
112
+ const publicJwk = toPublicJwk(input.publicJwk);
113
+ const alg = dpopAlgForJwk(publicJwk);
114
+ const iat = input.iat ?? Math.floor(Date.now() / 1000);
115
+ const claims = {
116
+ htm: input.method.toUpperCase(),
117
+ htu: normalizeHtu(input.url),
118
+ iat,
119
+ jti: input.jti ?? freshJti(),
120
+ ...(input.nonce !== undefined ? { nonce: input.nonce } : {}),
121
+ ...(input.ath !== undefined ? { ath: input.ath } : {}),
122
+ };
123
+ return new jose_1.SignJWT(claims).setProtectedHeader({ typ: exports.DPOP_JWT_TYP, alg, jwk: publicJwk }).sign(input.privateKey);
124
+ }
125
+ /**
126
+ * Verify a DPoP proof: signature under the embedded `jwk`, `typ`, that `htm`/`htu` match the request,
127
+ * `iat` freshness, optional `jkt` match and optional `jti` replay rejection. Throws
128
+ * {@link DpopVerificationError} on any failure; returns the verified claims + key thumbprint on success.
129
+ */
130
+ async function verifyDpopProof(proof, opts) {
131
+ // Reject a missing / non-public / absent-`jwk` header before trusting the signature.
132
+ let header;
133
+ try {
134
+ header = (0, jose_1.decodeProtectedHeader)(proof);
135
+ }
136
+ catch (e) {
137
+ throw new DpopVerificationError('malformed', `not a JWS: ${errMsg(e)}`);
138
+ }
139
+ if (header.typ !== exports.DPOP_JWT_TYP) {
140
+ throw new DpopVerificationError('typ', `header typ must be '${exports.DPOP_JWT_TYP}', got '${String(header.typ)}'`);
141
+ }
142
+ if (header.jwk === undefined)
143
+ throw new DpopVerificationError('no_jwk', 'proof header has no embedded jwk');
144
+ // Signature: EmbeddedJWK verifies under the header `jwk`; `algorithms` pins the asymmetric suite.
145
+ let payload;
146
+ let jwk;
147
+ try {
148
+ const res = await (0, jose_1.jwtVerify)(proof, jose_1.EmbeddedJWK, { algorithms: [...exports.DPOP_ALLOWED_ALGS], typ: exports.DPOP_JWT_TYP });
149
+ payload = res.payload;
150
+ const resolved = res.protectedHeader.jwk;
151
+ if (resolved === undefined)
152
+ throw new DpopVerificationError('no_jwk', 'verified header has no embedded jwk');
153
+ jwk = resolved;
154
+ }
155
+ catch (e) {
156
+ if (e instanceof DpopVerificationError)
157
+ throw e;
158
+ throw new DpopVerificationError('signature', `DPoP signature did not verify: ${errMsg(e)}`);
159
+ }
160
+ // Claim shapes.
161
+ const { htm, htu, iat, jti } = payload;
162
+ if (typeof htm !== 'string')
163
+ throw new DpopVerificationError('htm', 'htm is missing or not a string');
164
+ if (typeof htu !== 'string')
165
+ throw new DpopVerificationError('htu', 'htu is missing or not a string');
166
+ if (typeof iat !== 'number' || !Number.isFinite(iat))
167
+ throw new DpopVerificationError('iat', 'iat is missing or not a number');
168
+ if (typeof jti !== 'string' || jti.length === 0)
169
+ throw new DpopVerificationError('jti', 'jti is missing or empty');
170
+ // htm / htu bind the proof to this exact request.
171
+ if (htm !== opts.method.toUpperCase())
172
+ throw new DpopVerificationError('htm', `htm '${htm}' does not match request method`);
173
+ if (htu !== normalizeHtu(opts.url))
174
+ throw new DpopVerificationError('htu', `htu '${htu}' does not match request URL`);
175
+ // Freshness.
176
+ const now = opts.nowSec ?? Math.floor(Date.now() / 1000);
177
+ if (iat > now + exports.DPOP_CLOCK_SKEW_SEC)
178
+ throw new DpopVerificationError('iat_future', 'iat is in the future');
179
+ if (now - iat > opts.maxAgeSec)
180
+ throw new DpopVerificationError('iat_stale', `proof is older than ${opts.maxAgeSec}s`);
181
+ // Key binding.
182
+ const jkt = await jwkThumbprint(jwk);
183
+ if (opts.expectedJkt !== undefined && jkt !== opts.expectedJkt) {
184
+ throw new DpopVerificationError('jkt', 'embedded key thumbprint does not match expected jkt');
185
+ }
186
+ // Replay: reject a reused jti, then record this one.
187
+ if (opts.seenJti !== undefined) {
188
+ if (opts.seenJti.has(jti))
189
+ throw new DpopVerificationError('jti_replay', `jti '${jti}' has already been seen`);
190
+ opts.seenJti.add(jti);
191
+ }
192
+ const nonce = typeof payload.nonce === 'string' ? payload.nonce : undefined;
193
+ const ath = typeof payload.ath === 'string' ? payload.ath : undefined;
194
+ const claims = {
195
+ ...payload,
196
+ htm,
197
+ htu,
198
+ iat,
199
+ jti,
200
+ ...(nonce !== undefined ? { nonce } : {}),
201
+ ...(ath !== undefined ? { ath } : {}),
202
+ };
203
+ return { claims, jwk, jkt };
204
+ }
205
+ // ---- RFC 8705 mTLS confirmation ---------------------------------------------------------------
206
+ /** PEM certificate body → DER bytes (base64, standard alphabet). */
207
+ function pemToDer(pem) {
208
+ const match = pem.match(/-----BEGIN CERTIFICATE-----([\s\S]+?)-----END CERTIFICATE-----/);
209
+ const body = (match?.[1] ?? pem).replace(/[^A-Za-z0-9+/=]/g, '');
210
+ return new Uint8Array(Buffer.from(body, 'base64'));
211
+ }
212
+ /**
213
+ * RFC 8705 §3.1 `cnf` confirmation for a mutual-TLS client certificate: `{ "x5t#S256": b64u(sha256(DER)) }`.
214
+ * Accepts the certificate as DER bytes or as a PEM string.
215
+ */
216
+ function mtlsCnf(certDerOrPem) {
217
+ const der = typeof certDerOrPem === 'string' ? pemToDer(certDerOrPem) : certDerOrPem;
218
+ return { 'x5t#S256': (0, pca_1.b64u)((0, pca_1.sha256)(der)) };
219
+ }
220
+ // ---- PCActn ↔ DPoP binding --------------------------------------------------------------------
221
+ /**
222
+ * The OKP/Ed25519 public JWK of the PCActn's bound holder key — the LEAF of its capability chain
223
+ * (`cap_chain[last].holder`, a base64url Ed25519 public key). Throws if the chain is empty.
224
+ */
225
+ function leafHolderJwk(p) {
226
+ const chain = p.cap_chain;
227
+ const leaf = chain[chain.length - 1];
228
+ if (leaf === undefined)
229
+ throw new DpopVerificationError('no_leaf', 'PCActn capability chain is empty; no bound holder key');
230
+ return { kty: 'OKP', crv: 'Ed25519', x: leaf.holder };
231
+ }
232
+ /** The `cnf: { jkt }` confirmation for a PCActn's bound holder key (RFC 9449 §6 jkt binding). */
233
+ async function bindPcaToDpop(p) {
234
+ return { jkt: await jwkThumbprint(leafHolderJwk(p)) };
235
+ }
236
+ /**
237
+ * Confirm a presented DPoP proof is held by the PCActn's bound holder key AND is for the given HTTP
238
+ * target: verifies the proof with `expectedJkt` fixed to the PCActn's leaf-holder thumbprint. Throws
239
+ * {@link DpopVerificationError} on any mismatch; returns the verified result on success.
240
+ */
241
+ async function assertPcaDpop(p, dpopProof, opts) {
242
+ const { jkt } = await bindPcaToDpop(p);
243
+ return verifyDpopProof(dpopProof, {
244
+ method: opts.method,
245
+ url: opts.url,
246
+ maxAgeSec: opts.maxAgeSec ?? exports.DPOP_DEFAULT_MAX_AGE_SEC,
247
+ expectedJkt: jkt,
248
+ ...(opts.seenJti !== undefined ? { seenJti: opts.seenJti } : {}),
249
+ ...(opts.nowSec !== undefined ? { nowSec: opts.nowSec } : {}),
250
+ });
251
+ }
252
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AA0GH,sCAEC;AAGD,sCAeC;AAcD,oCAGC;AAGD,wBAEC;AAcD,0CAaC;AAOD,0CAmEC;AAeD,0BAGC;AAQD,sCAKC;AAGD,sCAEC;AAOD,sCAcC;AAhTD,+BAAsG;AAEtG,wCAA2D;AAE3D,mGAAmG;AAEnG,mGAAmG;AACtF,QAAA,i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EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,aAAa,CACjC,CAAS,EACT,SAAiB,EACjB,IAAgG;IAEhG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,aAAa,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,eAAe,CAAC,SAAS,EAAE;QAChC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,gCAAwB;QACrD,WAAW,EAAE,GAAG;QAChB,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9D,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@atlasauth/pca-dpop",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Sender-constrained proof-of-possession for PCA: RFC 9449 DPoP proofs and RFC 8705 mTLS cnf binding, tying a PCActn to the holder key/channel for OAuth PoP interop.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./package.json": "./package.json"
13
+ },
14
+ "dependencies": {
15
+ "jose": "^5.9.6",
16
+ "@atlasauth/pca": "0.1.0"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^5.6.3",
20
+ "vitest": "^2.1.4"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc -p tsconfig.build.json",
31
+ "typecheck": "tsc -p tsconfig.json --noEmit",
32
+ "test": "vitest run"
33
+ }
6
34
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.