@aooth/auth 0.2.1 → 0.2.2

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.
Files changed (37) hide show
  1. package/dist/atscript-db.cjs +5 -7
  2. package/dist/atscript-db.d.cts +21 -25
  3. package/dist/atscript-db.d.mts +21 -25
  4. package/dist/atscript-db.mjs +5 -7
  5. package/dist/{auth-credential-CjCgZv7n.d.mts → auth-credential-46_eOF3c.d.cts} +1 -3
  6. package/dist/{auth-credential-UV3sJ-lt.d.cts → auth-credential-Co-0pqcD.d.mts} +1 -3
  7. package/dist/authz.cjs +21 -33
  8. package/dist/authz.d.cts +23 -45
  9. package/dist/authz.d.mts +23 -45
  10. package/dist/authz.mjs +21 -33
  11. package/dist/client.cjs +1 -2
  12. package/dist/client.d.cts +7 -10
  13. package/dist/client.d.mts +7 -10
  14. package/dist/client.mjs +1 -2
  15. package/dist/{clock-Bl-H3eqE.cjs → clock-BcBMqB9g.cjs} +1 -2
  16. package/dist/{clock-Bdsep_1j.mjs → clock-DzAK2bWR.mjs} +1 -2
  17. package/dist/{clock-CzAaCoZ5.d.cts → clock-hTHoZ2vA.d.cts} +0 -6
  18. package/dist/{clock-CzAaCoZ5.d.mts → clock-hTHoZ2vA.d.mts} +0 -6
  19. package/dist/{dynamic-client-store-DykM9QOT.cjs → dynamic-client-store-CC4qr_kz.cjs} +5 -8
  20. package/dist/{dynamic-client-store-B7EnHuRp.d.cts → dynamic-client-store-CTt1B6Gj.d.cts} +2 -10
  21. package/dist/{dynamic-client-store-B1JwFHdP.mjs → dynamic-client-store-DrMBcFtG.mjs} +5 -8
  22. package/dist/{dynamic-client-store-BifZLGkT.d.mts → dynamic-client-store-mYg0nRJU.d.mts} +2 -10
  23. package/dist/index.cjs +14 -24
  24. package/dist/index.d.cts +18 -40
  25. package/dist/index.d.mts +18 -40
  26. package/dist/index.mjs +14 -24
  27. package/dist/{opaque-token-BaMOrC1A.mjs → opaque-token-BLoQKkZ3.mjs} +1 -2
  28. package/dist/{opaque-token-CaZgD2i6.cjs → opaque-token-BLuVHSVJ.cjs} +1 -2
  29. package/dist/{payload-C1cQW7p_.cjs → payload-CqQH88C6.cjs} +2 -4
  30. package/dist/{payload-DDlf38B-.mjs → payload-DizkKbzh.mjs} +2 -4
  31. package/dist/redis.cjs +1 -2
  32. package/dist/redis.d.cts +7 -9
  33. package/dist/redis.d.mts +7 -9
  34. package/dist/redis.mjs +1 -2
  35. package/dist/{store-BaFYDHxn.d.cts → store-BXxX8sUP.d.mts} +1 -3
  36. package/dist/{store-h-bLOAaS.d.mts → store-D9CcbcBp.d.cts} +1 -3
  37. package/package.json +9 -9
package/dist/authz.d.cts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as Clock } from "./clock-CzAaCoZ5.cjs";
2
- import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-B7EnHuRp.cjs";
1
+ import { t as Clock } from "./clock-hTHoZ2vA.cjs";
2
+ import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-CTt1B6Gj.cjs";
3
3
  import { JWK } from "jose";
4
- //#region src/authz/authz-errors.d.ts
5
4
  /**
6
5
  * Failure taxonomy for the authorization-server endpoints (AUTH-SERVER.md §7).
7
6
  * The `/authorize` side fails SOFT (302 → an app error/login route, never a
@@ -30,12 +29,10 @@ type AuthorizeErrorCode =
30
29
  /** An unexpected server-side failure. */
31
30
  "server_error";
32
31
  /** A typed authorization-server failure. */
33
- declare class AuthorizeError extends Error {
32
+ export declare class AuthorizeError extends Error {
34
33
  readonly code: AuthorizeErrorCode;
35
34
  constructor(code: AuthorizeErrorCode, message: string);
36
35
  }
37
- //#endregion
38
- //#region src/authz/client-policy.d.ts
39
36
  /**
40
37
  * The client + redirect resolved at `GET /auth/authorize` — what the grant is
41
38
  * allowed to deliver and where.
@@ -118,7 +115,7 @@ interface ClientRedirectPolicy {
118
115
  * `0.0.0.0`. Only a local process can receive a loopback redirect, which is why
119
116
  * an arbitrary port is safe — the binding is the loopback host + PKCE.
120
117
  */
121
- declare function isLoopbackRedirectUri(uri: string): boolean;
118
+ export declare function isLoopbackRedirectUri(uri: string): boolean;
122
119
  interface LoopbackClientPolicyOptions {
123
120
  /**
124
121
  * What a loopback grant mints. Default: a full-authority `cli-session` with a
@@ -132,7 +129,7 @@ interface LoopbackClientPolicyOptions {
132
129
  * public client (no `client_id` / secret — PKCE is the binding), and mint the
133
130
  * configured CLI token policy. Rejects every non-loopback redirect.
134
131
  */
135
- declare class LoopbackClientPolicy implements ClientRedirectPolicy {
132
+ export declare class LoopbackClientPolicy implements ClientRedirectPolicy {
136
133
  private readonly tokenPolicy;
137
134
  constructor(opts?: LoopbackClientPolicyOptions);
138
135
  resolveClient(args: {
@@ -141,8 +138,6 @@ declare class LoopbackClientPolicy implements ClientRedirectPolicy {
141
138
  scope?: string;
142
139
  }): ResolvedClient;
143
140
  }
144
- //#endregion
145
- //#region src/authz/registered-client-policy.d.ts
146
141
  /**
147
142
  * One registered first-party client (AUTH-SERVER.md §4.5). The registry is the
148
143
  * open-redirect / token-theft boundary, so a client's `redirect_uri` allowlist
@@ -185,7 +180,7 @@ interface RegisteredClientPolicyOptions {
185
180
  * (`client_secret` for confidential clients; PKCE is the binding for public ones).
186
181
  * An unregistered client or an unlisted redirect is rejected.
187
182
  */
188
- declare class RegisteredClientPolicy implements ClientRedirectPolicy {
183
+ export declare class RegisteredClientPolicy implements ClientRedirectPolicy {
189
184
  private readonly clients;
190
185
  constructor(opts: RegisteredClientPolicyOptions);
191
186
  resolveClient(args: {
@@ -203,8 +198,6 @@ declare class RegisteredClientPolicy implements ClientRedirectPolicy {
203
198
  private redirectAllowed;
204
199
  private grantScope;
205
200
  }
206
- //#endregion
207
- //#region src/authz/composite-client-policy.d.ts
208
201
  interface CompositeClientPolicyOptions {
209
202
  /** Used when the request carries NO `client_id` (Tier-1 public/loopback CLI). */
210
203
  loopback: ClientRedirectPolicy;
@@ -231,7 +224,7 @@ interface CompositeClientPolicyOptions {
231
224
  * `client_id` must be authenticated by the dynamic policy (existence check,
232
225
  * PKCE binds), never rejected by the static registry that doesn't know it.
233
226
  */
234
- declare class CompositeClientPolicy implements ClientRedirectPolicy {
227
+ export declare class CompositeClientPolicy implements ClientRedirectPolicy {
235
228
  private readonly loopback;
236
229
  private readonly registered?;
237
230
  private readonly dynamic?;
@@ -252,8 +245,6 @@ declare class CompositeClientPolicy implements ClientRedirectPolicy {
252
245
  */
253
246
  private pickForClientId;
254
247
  }
255
- //#endregion
256
- //#region src/authz/client-registration.d.ts
257
248
  /**
258
249
  * RFC 7591 §3.2.2 error vocabulary — deliberately separate from
259
250
  * `AuthorizeErrorCode`: registration errors are a different wire contract
@@ -261,7 +252,7 @@ declare class CompositeClientPolicy implements ClientRedirectPolicy {
261
252
  */
262
253
  type ClientRegistrationErrorCode = "invalid_redirect_uri" | "invalid_client_metadata";
263
254
  /** A typed RFC 7591 registration failure; `message` becomes `error_description`. */
264
- declare class ClientRegistrationError extends Error {
255
+ export declare class ClientRegistrationError extends Error {
265
256
  readonly code: ClientRegistrationErrorCode;
266
257
  constructor(code: ClientRegistrationErrorCode, message: string);
267
258
  }
@@ -308,7 +299,7 @@ interface ClientRegistrationValidationOptions {
308
299
  * the allowed set is rejected — never silently downgrade a client that asked
309
300
  * for a secret. Unknown fields are ignored and never echoed.
310
301
  */
311
- declare function validateClientRegistration(body: unknown, opts?: ClientRegistrationValidationOptions): NewDynamicClient;
302
+ export declare function validateClientRegistration(body: unknown, opts?: ClientRegistrationValidationOptions): NewDynamicClient;
312
303
  interface DynamicClientRegistrationOptions {
313
304
  store: DynamicClientStore;
314
305
  /**
@@ -359,7 +350,7 @@ type RegisteredDynamicClient = DynamicClient & {
359
350
  * controller endpoint is a thin HTTP adapter over `register()`, and non-moost
360
351
  * servers can call it directly.
361
352
  */
362
- declare class DynamicClientRegistration {
353
+ export declare class DynamicClientRegistration {
363
354
  private readonly store;
364
355
  private readonly maxClients;
365
356
  private readonly unusedClientTtlMs?;
@@ -375,26 +366,22 @@ declare class DynamicClientRegistration {
375
366
  */
376
367
  register(body: unknown): Promise<RegisteredDynamicClient>;
377
368
  }
378
- //#endregion
379
- //#region src/authz/client-secret.d.ts
380
369
  /**
381
370
  * Mint a confidential dynamic client's secret (RFC 7591 `client_secret`) — a
382
371
  * plain {@link generateOpaqueToken} mint. Returned to the registrant ONCE in
383
372
  * the registration response; only its {@link hashClientSecret} digest is
384
373
  * stored.
385
374
  */
386
- declare function mintClientSecret(): string;
375
+ export declare function mintClientSecret(): string;
387
376
  /**
388
377
  * Storage digest for a client secret — plain SHA-256 (hex). No KDF/salt on
389
378
  * purpose: the secret is high-entropy server-minted material (never a human
390
379
  * password), so brute-forcing the digest is infeasible and a per-row salt
391
380
  * buys nothing.
392
381
  */
393
- declare function hashClientSecret(secret: string): string;
382
+ export declare function hashClientSecret(secret: string): string;
394
383
  /** Constant-time check of a presented secret against a stored digest. */
395
- declare function verifyClientSecret(secret: string, hash: string): boolean;
396
- //#endregion
397
- //#region src/authz/dynamic-client-policy.d.ts
384
+ export declare function verifyClientSecret(secret: string, hash: string): boolean;
398
385
  interface DynamicClientPolicyOptions {
399
386
  store: DynamicClientStore;
400
387
  /**
@@ -429,7 +416,7 @@ interface DynamicClientPolicyOptions {
429
416
  * applies — a dynamic code redeemed without (or with another) `client_id` is
430
417
  * rejected exactly like a Tier-2 code.
431
418
  */
432
- declare class DynamicClientPolicy implements ClientRedirectPolicy {
419
+ export declare class DynamicClientPolicy implements ClientRedirectPolicy {
433
420
  private readonly store;
434
421
  private readonly tokenPolicy;
435
422
  private readonly allowedScopes?;
@@ -457,8 +444,6 @@ declare class DynamicClientPolicy implements ClientRedirectPolicy {
457
444
  private requireClient;
458
445
  private grantScope;
459
446
  }
460
- //#endregion
461
- //#region src/authz/id-token-signer.d.ts
462
447
  /** Asymmetric signing algorithms an OIDC `id_token` may use (AUTH-SERVER.md §4.9). */
463
448
  type IdTokenAlg = "RS256" | "ES256";
464
449
  interface IdTokenSignerOptions {
@@ -504,7 +489,7 @@ interface IdTokenClaims {
504
489
  * Never used for the access token (that stays in `AuthCredential`'s store) — the
505
490
  * `id_token` is a separate, audience-bound identity assertion.
506
491
  */
507
- declare class IdTokenSigner {
492
+ export declare class IdTokenSigner {
508
493
  /** The `iss` claim + discovery `issuer` (read by `/.well-known/openid-configuration`). */
509
494
  readonly issuer: string;
510
495
  /** Signature algorithm — published in discovery's `id_token_signing_alg_values_supported`. */
@@ -530,8 +515,6 @@ declare class IdTokenSigner {
530
515
  }>;
531
516
  private importPrivateKey;
532
517
  }
533
- //#endregion
534
- //#region src/authz/oidc-claims-resolver.d.ts
535
518
  /**
536
519
  * Resolves the OIDC profile claims to embed in an `id_token` for a given user +
537
520
  * granted scope (AUTH-SERVER.md §4.9). The authorization server already controls
@@ -548,7 +531,7 @@ declare class IdTokenSigner {
548
531
  * `name`/`picture`/etc. under `profile`, so a client receives only what it asked
549
532
  * for (and was allowed).
550
533
  */
551
- declare abstract class OidcClaimsResolver {
534
+ export declare abstract class OidcClaimsResolver {
552
535
  /**
553
536
  * @param userId the authenticated subject (the `id_token` `sub`).
554
537
  * @param scope the granted scope, space-joined (e.g. `"openid email profile"`), or undefined.
@@ -557,20 +540,18 @@ declare abstract class OidcClaimsResolver {
557
540
  abstract resolveClaims(userId: string, scope: string | undefined): Record<string, unknown> | Promise<Record<string, unknown>>;
558
541
  }
559
542
  /** Default resolver: emits no profile claims, so the `id_token` carries only `sub` + the registered claims. */
560
- declare class NoopOidcClaimsResolver extends OidcClaimsResolver {
543
+ export declare class NoopOidcClaimsResolver extends OidcClaimsResolver {
561
544
  resolveClaims(): Record<string, unknown>;
562
545
  }
563
546
  /** `true` when `scope` (space-joined) grants `claim` — `"email"`/`"profile"` etc. */
564
- declare function scopeGrants(scope: string | undefined, claim: string): boolean;
565
- //#endregion
566
- //#region src/authz/server-metadata.d.ts
547
+ export declare function scopeGrants(scope: string | undefined, claim: string): boolean;
567
548
  /**
568
549
  * Strip a trailing slash from an issuer identifier. RFC 8414 mandates EXACT
569
550
  * (byte-identical) string comparison of issuer values, so every document that
570
551
  * spells the issuer must canonicalize it the same way — same rule as
571
552
  * `IdTokenSigner`. Shared by the AS metadata and protected-resource builders.
572
553
  */
573
- declare function canonicalizeIssuer(issuer: string): string;
554
+ export declare function canonicalizeIssuer(issuer: string): string;
574
555
  /**
575
556
  * RFC 8414 Authorization Server Metadata — the discovery document MCP connector
576
557
  * clients fetch from `/.well-known/oauth-authorization-server` to locate the
@@ -630,9 +611,7 @@ interface BuildAuthorizationServerMetadataOptions {
630
611
  * are omitted entirely (no `undefined` keys) so the serialized JSON carries
631
612
  * only what was configured.
632
613
  */
633
- declare function buildAuthorizationServerMetadata(opts: BuildAuthorizationServerMetadataOptions): AuthorizationServerMetadata;
634
- //#endregion
635
- //#region src/authz/resource-metadata.d.ts
614
+ export declare function buildAuthorizationServerMetadata(opts: BuildAuthorizationServerMetadataOptions): AuthorizationServerMetadata;
636
615
  /**
637
616
  * RFC 9728 Protected Resource Metadata — the document a resource server (an
638
617
  * MCP server, an API) publishes at `/.well-known/oauth-protected-resource` so
@@ -667,7 +646,7 @@ interface BuildProtectedResourceMetadataOptions {
667
646
  * mount it on any HTTP stack. Optional fields are omitted entirely (no
668
647
  * `undefined` keys) so the serialized JSON carries only what was configured.
669
648
  */
670
- declare function buildProtectedResourceMetadata(opts: BuildProtectedResourceMetadataOptions): ProtectedResourceMetadata;
649
+ export declare function buildProtectedResourceMetadata(opts: BuildProtectedResourceMetadataOptions): ProtectedResourceMetadata;
671
650
  interface WwwAuthenticateBearerChallengeOptions {
672
651
  /**
673
652
  * URL of the protected-resource document (RFC 9728 §5.1) — emitted as
@@ -692,6 +671,5 @@ interface WwwAuthenticateBearerChallengeOptions {
692
671
  * `realm`, `error`, `error_description`, `resource_metadata`, `scope`. All
693
672
  * values pass through {@link sanitizeQuotedStringValue} — see its security note.
694
673
  */
695
- declare function buildWwwAuthenticateBearerChallenge(opts?: WwwAuthenticateBearerChallengeOptions): string;
696
- //#endregion
697
- export { type AuthCode, AuthCodeStore, AuthCodeStoreMemory, type AuthCodeStoreMemoryOptions, type AuthorizationServerMetadata, AuthorizeError, type AuthorizeErrorCode, type BuildAuthorizationServerMetadataOptions, type BuildProtectedResourceMetadataOptions, type ClientRedirectPolicy, ClientRegistrationError, type ClientRegistrationErrorCode, type ClientRegistrationValidationOptions, CompositeClientPolicy, type CompositeClientPolicyOptions, DEFAULT_AUTHZ_REFRESH_TTL_MS, DEFAULT_PENDING_TTL_MS, type DynamicClient, type DynamicClientAuthMethod, DynamicClientPolicy, type DynamicClientPolicyOptions, DynamicClientRegistration, type DynamicClientRegistrationOptions, DynamicClientStore, DynamicClientStoreMemory, type DynamicClientStoreMemoryOptions, type IdTokenAlg, type IdTokenClaims, IdTokenSigner, type IdTokenSignerOptions, LoopbackClientPolicy, type LoopbackClientPolicyOptions, type NewAuthCode, type NewDynamicClient, type NewPendingAuthorization, NoopOidcClaimsResolver, OidcClaimsResolver, type PendingAuthorization, PendingAuthorizationStore, PendingAuthorizationStoreMemory, type PendingAuthorizationStoreMemoryOptions, type ProtectedResourceMetadata, type RegisteredClient, RegisteredClientPolicy, type RegisteredClientPolicyOptions, type RegisteredDynamicClient, type ResolvedClient, type TokenPolicy, type WwwAuthenticateBearerChallengeOptions, buildAuthorizationServerMetadata, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, hashClientSecret, isLoopbackRedirectUri, mintClientSecret, scopeGrants, tokenPolicyToIssueOptions, validateClientRegistration, verifyClientSecret };
674
+ export declare function buildWwwAuthenticateBearerChallenge(opts?: WwwAuthenticateBearerChallengeOptions): string;
675
+ export { type AuthCode, AuthCodeStore, AuthCodeStoreMemory, type AuthCodeStoreMemoryOptions, type AuthorizationServerMetadata, type AuthorizeErrorCode, type BuildAuthorizationServerMetadataOptions, type BuildProtectedResourceMetadataOptions, type ClientRedirectPolicy, type ClientRegistrationErrorCode, type ClientRegistrationValidationOptions, type CompositeClientPolicyOptions, DEFAULT_AUTHZ_REFRESH_TTL_MS, DEFAULT_PENDING_TTL_MS, type DynamicClient, type DynamicClientAuthMethod, type DynamicClientPolicyOptions, type DynamicClientRegistrationOptions, DynamicClientStore, DynamicClientStoreMemory, type DynamicClientStoreMemoryOptions, type IdTokenAlg, type IdTokenClaims, type IdTokenSignerOptions, type LoopbackClientPolicyOptions, type NewAuthCode, type NewDynamicClient, type NewPendingAuthorization, type PendingAuthorization, PendingAuthorizationStore, PendingAuthorizationStoreMemory, type PendingAuthorizationStoreMemoryOptions, type ProtectedResourceMetadata, type RegisteredClient, type RegisteredClientPolicyOptions, type RegisteredDynamicClient, type ResolvedClient, type TokenPolicy, type WwwAuthenticateBearerChallengeOptions, tokenPolicyToIssueOptions };
package/dist/authz.d.mts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as Clock } from "./clock-CzAaCoZ5.mjs";
2
- import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-BifZLGkT.mjs";
1
+ import { t as Clock } from "./clock-hTHoZ2vA.mjs";
2
+ import { _ as PendingAuthorizationStoreMemoryOptions, a as DynamicClientStoreMemoryOptions, b as tokenPolicyToIssueOptions, c as AuthCodeStore, d as NewAuthCode, f as DEFAULT_PENDING_TTL_MS, g as PendingAuthorizationStoreMemory, h as PendingAuthorizationStore, i as DynamicClientStoreMemory, l as AuthCodeStoreMemory, m as PendingAuthorization, n as DynamicClientAuthMethod, o as NewDynamicClient, p as NewPendingAuthorization, r as DynamicClientStore, s as AuthCode, t as DynamicClient, u as AuthCodeStoreMemoryOptions, v as DEFAULT_AUTHZ_REFRESH_TTL_MS, y as TokenPolicy } from "./dynamic-client-store-mYg0nRJU.mjs";
3
3
  import { JWK } from "jose";
4
- //#region src/authz/authz-errors.d.ts
5
4
  /**
6
5
  * Failure taxonomy for the authorization-server endpoints (AUTH-SERVER.md §7).
7
6
  * The `/authorize` side fails SOFT (302 → an app error/login route, never a
@@ -30,12 +29,10 @@ type AuthorizeErrorCode =
30
29
  /** An unexpected server-side failure. */
31
30
  "server_error";
32
31
  /** A typed authorization-server failure. */
33
- declare class AuthorizeError extends Error {
32
+ export declare class AuthorizeError extends Error {
34
33
  readonly code: AuthorizeErrorCode;
35
34
  constructor(code: AuthorizeErrorCode, message: string);
36
35
  }
37
- //#endregion
38
- //#region src/authz/client-policy.d.ts
39
36
  /**
40
37
  * The client + redirect resolved at `GET /auth/authorize` — what the grant is
41
38
  * allowed to deliver and where.
@@ -118,7 +115,7 @@ interface ClientRedirectPolicy {
118
115
  * `0.0.0.0`. Only a local process can receive a loopback redirect, which is why
119
116
  * an arbitrary port is safe — the binding is the loopback host + PKCE.
120
117
  */
121
- declare function isLoopbackRedirectUri(uri: string): boolean;
118
+ export declare function isLoopbackRedirectUri(uri: string): boolean;
122
119
  interface LoopbackClientPolicyOptions {
123
120
  /**
124
121
  * What a loopback grant mints. Default: a full-authority `cli-session` with a
@@ -132,7 +129,7 @@ interface LoopbackClientPolicyOptions {
132
129
  * public client (no `client_id` / secret — PKCE is the binding), and mint the
133
130
  * configured CLI token policy. Rejects every non-loopback redirect.
134
131
  */
135
- declare class LoopbackClientPolicy implements ClientRedirectPolicy {
132
+ export declare class LoopbackClientPolicy implements ClientRedirectPolicy {
136
133
  private readonly tokenPolicy;
137
134
  constructor(opts?: LoopbackClientPolicyOptions);
138
135
  resolveClient(args: {
@@ -141,8 +138,6 @@ declare class LoopbackClientPolicy implements ClientRedirectPolicy {
141
138
  scope?: string;
142
139
  }): ResolvedClient;
143
140
  }
144
- //#endregion
145
- //#region src/authz/registered-client-policy.d.ts
146
141
  /**
147
142
  * One registered first-party client (AUTH-SERVER.md §4.5). The registry is the
148
143
  * open-redirect / token-theft boundary, so a client's `redirect_uri` allowlist
@@ -185,7 +180,7 @@ interface RegisteredClientPolicyOptions {
185
180
  * (`client_secret` for confidential clients; PKCE is the binding for public ones).
186
181
  * An unregistered client or an unlisted redirect is rejected.
187
182
  */
188
- declare class RegisteredClientPolicy implements ClientRedirectPolicy {
183
+ export declare class RegisteredClientPolicy implements ClientRedirectPolicy {
189
184
  private readonly clients;
190
185
  constructor(opts: RegisteredClientPolicyOptions);
191
186
  resolveClient(args: {
@@ -203,8 +198,6 @@ declare class RegisteredClientPolicy implements ClientRedirectPolicy {
203
198
  private redirectAllowed;
204
199
  private grantScope;
205
200
  }
206
- //#endregion
207
- //#region src/authz/composite-client-policy.d.ts
208
201
  interface CompositeClientPolicyOptions {
209
202
  /** Used when the request carries NO `client_id` (Tier-1 public/loopback CLI). */
210
203
  loopback: ClientRedirectPolicy;
@@ -231,7 +224,7 @@ interface CompositeClientPolicyOptions {
231
224
  * `client_id` must be authenticated by the dynamic policy (existence check,
232
225
  * PKCE binds), never rejected by the static registry that doesn't know it.
233
226
  */
234
- declare class CompositeClientPolicy implements ClientRedirectPolicy {
227
+ export declare class CompositeClientPolicy implements ClientRedirectPolicy {
235
228
  private readonly loopback;
236
229
  private readonly registered?;
237
230
  private readonly dynamic?;
@@ -252,8 +245,6 @@ declare class CompositeClientPolicy implements ClientRedirectPolicy {
252
245
  */
253
246
  private pickForClientId;
254
247
  }
255
- //#endregion
256
- //#region src/authz/client-registration.d.ts
257
248
  /**
258
249
  * RFC 7591 §3.2.2 error vocabulary — deliberately separate from
259
250
  * `AuthorizeErrorCode`: registration errors are a different wire contract
@@ -261,7 +252,7 @@ declare class CompositeClientPolicy implements ClientRedirectPolicy {
261
252
  */
262
253
  type ClientRegistrationErrorCode = "invalid_redirect_uri" | "invalid_client_metadata";
263
254
  /** A typed RFC 7591 registration failure; `message` becomes `error_description`. */
264
- declare class ClientRegistrationError extends Error {
255
+ export declare class ClientRegistrationError extends Error {
265
256
  readonly code: ClientRegistrationErrorCode;
266
257
  constructor(code: ClientRegistrationErrorCode, message: string);
267
258
  }
@@ -308,7 +299,7 @@ interface ClientRegistrationValidationOptions {
308
299
  * the allowed set is rejected — never silently downgrade a client that asked
309
300
  * for a secret. Unknown fields are ignored and never echoed.
310
301
  */
311
- declare function validateClientRegistration(body: unknown, opts?: ClientRegistrationValidationOptions): NewDynamicClient;
302
+ export declare function validateClientRegistration(body: unknown, opts?: ClientRegistrationValidationOptions): NewDynamicClient;
312
303
  interface DynamicClientRegistrationOptions {
313
304
  store: DynamicClientStore;
314
305
  /**
@@ -359,7 +350,7 @@ type RegisteredDynamicClient = DynamicClient & {
359
350
  * controller endpoint is a thin HTTP adapter over `register()`, and non-moost
360
351
  * servers can call it directly.
361
352
  */
362
- declare class DynamicClientRegistration {
353
+ export declare class DynamicClientRegistration {
363
354
  private readonly store;
364
355
  private readonly maxClients;
365
356
  private readonly unusedClientTtlMs?;
@@ -375,26 +366,22 @@ declare class DynamicClientRegistration {
375
366
  */
376
367
  register(body: unknown): Promise<RegisteredDynamicClient>;
377
368
  }
378
- //#endregion
379
- //#region src/authz/client-secret.d.ts
380
369
  /**
381
370
  * Mint a confidential dynamic client's secret (RFC 7591 `client_secret`) — a
382
371
  * plain {@link generateOpaqueToken} mint. Returned to the registrant ONCE in
383
372
  * the registration response; only its {@link hashClientSecret} digest is
384
373
  * stored.
385
374
  */
386
- declare function mintClientSecret(): string;
375
+ export declare function mintClientSecret(): string;
387
376
  /**
388
377
  * Storage digest for a client secret — plain SHA-256 (hex). No KDF/salt on
389
378
  * purpose: the secret is high-entropy server-minted material (never a human
390
379
  * password), so brute-forcing the digest is infeasible and a per-row salt
391
380
  * buys nothing.
392
381
  */
393
- declare function hashClientSecret(secret: string): string;
382
+ export declare function hashClientSecret(secret: string): string;
394
383
  /** Constant-time check of a presented secret against a stored digest. */
395
- declare function verifyClientSecret(secret: string, hash: string): boolean;
396
- //#endregion
397
- //#region src/authz/dynamic-client-policy.d.ts
384
+ export declare function verifyClientSecret(secret: string, hash: string): boolean;
398
385
  interface DynamicClientPolicyOptions {
399
386
  store: DynamicClientStore;
400
387
  /**
@@ -429,7 +416,7 @@ interface DynamicClientPolicyOptions {
429
416
  * applies — a dynamic code redeemed without (or with another) `client_id` is
430
417
  * rejected exactly like a Tier-2 code.
431
418
  */
432
- declare class DynamicClientPolicy implements ClientRedirectPolicy {
419
+ export declare class DynamicClientPolicy implements ClientRedirectPolicy {
433
420
  private readonly store;
434
421
  private readonly tokenPolicy;
435
422
  private readonly allowedScopes?;
@@ -457,8 +444,6 @@ declare class DynamicClientPolicy implements ClientRedirectPolicy {
457
444
  private requireClient;
458
445
  private grantScope;
459
446
  }
460
- //#endregion
461
- //#region src/authz/id-token-signer.d.ts
462
447
  /** Asymmetric signing algorithms an OIDC `id_token` may use (AUTH-SERVER.md §4.9). */
463
448
  type IdTokenAlg = "RS256" | "ES256";
464
449
  interface IdTokenSignerOptions {
@@ -504,7 +489,7 @@ interface IdTokenClaims {
504
489
  * Never used for the access token (that stays in `AuthCredential`'s store) — the
505
490
  * `id_token` is a separate, audience-bound identity assertion.
506
491
  */
507
- declare class IdTokenSigner {
492
+ export declare class IdTokenSigner {
508
493
  /** The `iss` claim + discovery `issuer` (read by `/.well-known/openid-configuration`). */
509
494
  readonly issuer: string;
510
495
  /** Signature algorithm — published in discovery's `id_token_signing_alg_values_supported`. */
@@ -530,8 +515,6 @@ declare class IdTokenSigner {
530
515
  }>;
531
516
  private importPrivateKey;
532
517
  }
533
- //#endregion
534
- //#region src/authz/oidc-claims-resolver.d.ts
535
518
  /**
536
519
  * Resolves the OIDC profile claims to embed in an `id_token` for a given user +
537
520
  * granted scope (AUTH-SERVER.md §4.9). The authorization server already controls
@@ -548,7 +531,7 @@ declare class IdTokenSigner {
548
531
  * `name`/`picture`/etc. under `profile`, so a client receives only what it asked
549
532
  * for (and was allowed).
550
533
  */
551
- declare abstract class OidcClaimsResolver {
534
+ export declare abstract class OidcClaimsResolver {
552
535
  /**
553
536
  * @param userId the authenticated subject (the `id_token` `sub`).
554
537
  * @param scope the granted scope, space-joined (e.g. `"openid email profile"`), or undefined.
@@ -557,20 +540,18 @@ declare abstract class OidcClaimsResolver {
557
540
  abstract resolveClaims(userId: string, scope: string | undefined): Record<string, unknown> | Promise<Record<string, unknown>>;
558
541
  }
559
542
  /** Default resolver: emits no profile claims, so the `id_token` carries only `sub` + the registered claims. */
560
- declare class NoopOidcClaimsResolver extends OidcClaimsResolver {
543
+ export declare class NoopOidcClaimsResolver extends OidcClaimsResolver {
561
544
  resolveClaims(): Record<string, unknown>;
562
545
  }
563
546
  /** `true` when `scope` (space-joined) grants `claim` — `"email"`/`"profile"` etc. */
564
- declare function scopeGrants(scope: string | undefined, claim: string): boolean;
565
- //#endregion
566
- //#region src/authz/server-metadata.d.ts
547
+ export declare function scopeGrants(scope: string | undefined, claim: string): boolean;
567
548
  /**
568
549
  * Strip a trailing slash from an issuer identifier. RFC 8414 mandates EXACT
569
550
  * (byte-identical) string comparison of issuer values, so every document that
570
551
  * spells the issuer must canonicalize it the same way — same rule as
571
552
  * `IdTokenSigner`. Shared by the AS metadata and protected-resource builders.
572
553
  */
573
- declare function canonicalizeIssuer(issuer: string): string;
554
+ export declare function canonicalizeIssuer(issuer: string): string;
574
555
  /**
575
556
  * RFC 8414 Authorization Server Metadata — the discovery document MCP connector
576
557
  * clients fetch from `/.well-known/oauth-authorization-server` to locate the
@@ -630,9 +611,7 @@ interface BuildAuthorizationServerMetadataOptions {
630
611
  * are omitted entirely (no `undefined` keys) so the serialized JSON carries
631
612
  * only what was configured.
632
613
  */
633
- declare function buildAuthorizationServerMetadata(opts: BuildAuthorizationServerMetadataOptions): AuthorizationServerMetadata;
634
- //#endregion
635
- //#region src/authz/resource-metadata.d.ts
614
+ export declare function buildAuthorizationServerMetadata(opts: BuildAuthorizationServerMetadataOptions): AuthorizationServerMetadata;
636
615
  /**
637
616
  * RFC 9728 Protected Resource Metadata — the document a resource server (an
638
617
  * MCP server, an API) publishes at `/.well-known/oauth-protected-resource` so
@@ -667,7 +646,7 @@ interface BuildProtectedResourceMetadataOptions {
667
646
  * mount it on any HTTP stack. Optional fields are omitted entirely (no
668
647
  * `undefined` keys) so the serialized JSON carries only what was configured.
669
648
  */
670
- declare function buildProtectedResourceMetadata(opts: BuildProtectedResourceMetadataOptions): ProtectedResourceMetadata;
649
+ export declare function buildProtectedResourceMetadata(opts: BuildProtectedResourceMetadataOptions): ProtectedResourceMetadata;
671
650
  interface WwwAuthenticateBearerChallengeOptions {
672
651
  /**
673
652
  * URL of the protected-resource document (RFC 9728 §5.1) — emitted as
@@ -692,6 +671,5 @@ interface WwwAuthenticateBearerChallengeOptions {
692
671
  * `realm`, `error`, `error_description`, `resource_metadata`, `scope`. All
693
672
  * values pass through {@link sanitizeQuotedStringValue} — see its security note.
694
673
  */
695
- declare function buildWwwAuthenticateBearerChallenge(opts?: WwwAuthenticateBearerChallengeOptions): string;
696
- //#endregion
697
- export { type AuthCode, AuthCodeStore, AuthCodeStoreMemory, type AuthCodeStoreMemoryOptions, type AuthorizationServerMetadata, AuthorizeError, type AuthorizeErrorCode, type BuildAuthorizationServerMetadataOptions, type BuildProtectedResourceMetadataOptions, type ClientRedirectPolicy, ClientRegistrationError, type ClientRegistrationErrorCode, type ClientRegistrationValidationOptions, CompositeClientPolicy, type CompositeClientPolicyOptions, DEFAULT_AUTHZ_REFRESH_TTL_MS, DEFAULT_PENDING_TTL_MS, type DynamicClient, type DynamicClientAuthMethod, DynamicClientPolicy, type DynamicClientPolicyOptions, DynamicClientRegistration, type DynamicClientRegistrationOptions, DynamicClientStore, DynamicClientStoreMemory, type DynamicClientStoreMemoryOptions, type IdTokenAlg, type IdTokenClaims, IdTokenSigner, type IdTokenSignerOptions, LoopbackClientPolicy, type LoopbackClientPolicyOptions, type NewAuthCode, type NewDynamicClient, type NewPendingAuthorization, NoopOidcClaimsResolver, OidcClaimsResolver, type PendingAuthorization, PendingAuthorizationStore, PendingAuthorizationStoreMemory, type PendingAuthorizationStoreMemoryOptions, type ProtectedResourceMetadata, type RegisteredClient, RegisteredClientPolicy, type RegisteredClientPolicyOptions, type RegisteredDynamicClient, type ResolvedClient, type TokenPolicy, type WwwAuthenticateBearerChallengeOptions, buildAuthorizationServerMetadata, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, hashClientSecret, isLoopbackRedirectUri, mintClientSecret, scopeGrants, tokenPolicyToIssueOptions, validateClientRegistration, verifyClientSecret };
674
+ export declare function buildWwwAuthenticateBearerChallenge(opts?: WwwAuthenticateBearerChallengeOptions): string;
675
+ export { type AuthCode, AuthCodeStore, AuthCodeStoreMemory, type AuthCodeStoreMemoryOptions, type AuthorizationServerMetadata, type AuthorizeErrorCode, type BuildAuthorizationServerMetadataOptions, type BuildProtectedResourceMetadataOptions, type ClientRedirectPolicy, type ClientRegistrationErrorCode, type ClientRegistrationValidationOptions, type CompositeClientPolicyOptions, DEFAULT_AUTHZ_REFRESH_TTL_MS, DEFAULT_PENDING_TTL_MS, type DynamicClient, type DynamicClientAuthMethod, type DynamicClientPolicyOptions, type DynamicClientRegistrationOptions, DynamicClientStore, DynamicClientStoreMemory, type DynamicClientStoreMemoryOptions, type IdTokenAlg, type IdTokenClaims, type IdTokenSignerOptions, type LoopbackClientPolicyOptions, type NewAuthCode, type NewDynamicClient, type NewPendingAuthorization, type PendingAuthorization, PendingAuthorizationStore, PendingAuthorizationStoreMemory, type PendingAuthorizationStoreMemoryOptions, type ProtectedResourceMetadata, type RegisteredClient, type RegisteredClientPolicyOptions, type RegisteredDynamicClient, type ResolvedClient, type TokenPolicy, type WwwAuthenticateBearerChallengeOptions, tokenPolicyToIssueOptions };
package/dist/authz.mjs CHANGED
@@ -1,16 +1,16 @@
1
- import { t as defaultClock } from "./clock-Bdsep_1j.mjs";
2
- import { t as generateOpaqueToken } from "./opaque-token-BaMOrC1A.mjs";
3
- import { c as PendingAuthorizationStoreMemory, i as AuthCodeStoreMemory, n as DynamicClientStoreMemory, o as DEFAULT_PENDING_TTL_MS, r as AuthCodeStore, s as PendingAuthorizationStore, t as DynamicClientStore } from "./dynamic-client-store-B1JwFHdP.mjs";
1
+ import { t as defaultClock } from "./clock-DzAK2bWR.mjs";
2
+ import { t as generateOpaqueToken } from "./opaque-token-BLoQKkZ3.mjs";
3
+ import { c as PendingAuthorizationStoreMemory, i as AuthCodeStoreMemory, n as DynamicClientStoreMemory, o as DEFAULT_PENDING_TTL_MS, r as AuthCodeStore, s as PendingAuthorizationStore, t as DynamicClientStore } from "./dynamic-client-store-DrMBcFtG.mjs";
4
4
  import { createHash, timingSafeEqual } from "node:crypto";
5
5
  import { SignJWT, exportJWK, importPKCS8, importSPKI } from "jose";
6
- //#region src/authz/token-policy.ts
6
+ // src/authz/token-policy.ts
7
7
  /**
8
8
  * Default refresh-token (grant) lifetime for {@link TokenPolicy.refresh} when
9
9
  * no `ttl` is given: 30 days. Deliberately independent of the session tier's
10
10
  * `AuthCredentialOptions.refresh.ttl` — an authz grant's lifetime is the
11
11
  * policy's decision, never inherited from browser-session posture.
12
12
  */
13
- const DEFAULT_AUTHZ_REFRESH_TTL_MS = 720 * 60 * 6e4;
13
+ const DEFAULT_AUTHZ_REFRESH_TTL_MS = 2592e6;
14
14
  /**
15
15
  * Flatten a {@link TokenPolicy} into the `AuthCredential.issue()` options a
16
16
  * token endpoint forwards. The refresh dimension applies only to client-bound
@@ -34,8 +34,7 @@ function tokenPolicyToIssueOptions(policy, clientId) {
34
34
  ...withRefresh && { metadata: { authzClientId: clientId } }
35
35
  };
36
36
  }
37
- //#endregion
38
- //#region src/authz/authz-errors.ts
37
+ // src/authz/authz-errors.ts
39
38
  /** A typed authorization-server failure. */
40
39
  var AuthorizeError = class extends Error {
41
40
  code;
@@ -45,8 +44,7 @@ var AuthorizeError = class extends Error {
45
44
  this.code = code;
46
45
  }
47
46
  };
48
- //#endregion
49
- //#region src/authz/client-policy.ts
47
+ // src/authz/client-policy.ts
50
48
  /**
51
49
  * `true` when `uri` is a syntactically valid http(s) URL whose host is a
52
50
  * **loopback literal** — `127.0.0.1`, `::1`, or `localhost` — on any port (RFC
@@ -70,7 +68,7 @@ function isLoopbackRedirectUri(uri) {
70
68
  }
71
69
  const DEFAULT_CLI_TOKEN_POLICY = {
72
70
  kind: "cli-session",
73
- ttl: 720 * 60 * 6e4
71
+ ttl: 2592e6
74
72
  };
75
73
  /**
76
74
  * Tier-1 policy: accept any **loopback** `redirect_uri`, treat the client as a
@@ -91,8 +89,7 @@ var LoopbackClientPolicy = class {
91
89
  };
92
90
  }
93
91
  };
94
- //#endregion
95
- //#region src/utils/timing-safe.ts
92
+ // src/utils/timing-safe.ts
96
93
  /** Constant-time string compare that also fails closed on a length mismatch. */
97
94
  function timingSafeEqualStr(a, b) {
98
95
  const ab = Buffer.from(a, "utf8");
@@ -100,8 +97,7 @@ function timingSafeEqualStr(a, b) {
100
97
  if (ab.length !== bb.length) return false;
101
98
  return timingSafeEqual(ab, bb);
102
99
  }
103
- //#endregion
104
- //#region src/authz/oidc-claims-resolver.ts
100
+ // src/authz/oidc-claims-resolver.ts
105
101
  /**
106
102
  * Resolves the OIDC profile claims to embed in an `id_token` for a given user +
107
103
  * granted scope (AUTH-SERVER.md §4.9). The authorization server already controls
@@ -130,8 +126,7 @@ function scopeGrants(scope, claim) {
130
126
  if (!scope) return false;
131
127
  return scope.split(/\s+/u).includes(claim);
132
128
  }
133
- //#endregion
134
- //#region src/authz/registered-client-policy.ts
129
+ // src/authz/registered-client-policy.ts
135
130
  /**
136
131
  * Tier-2 policy: a static registry of first-party clients. `resolveClient`
137
132
  * authorizes the client + `redirect_uri` (against the registered allowlist) and
@@ -198,8 +193,7 @@ var RegisteredClientPolicy = class {
198
193
  return granted.length > 0 ? granted.join(" ") : void 0;
199
194
  }
200
195
  };
201
- //#endregion
202
- //#region src/authz/composite-client-policy.ts
196
+ // src/authz/composite-client-policy.ts
203
197
  /**
204
198
  * Runs the tiers side by side, dispatching on the **presence and ownership of
205
199
  * `client_id`** (AUTH-SERVER.md §10, OAUTH.md R2): a request without a
@@ -246,8 +240,7 @@ var CompositeClientPolicy = class {
246
240
  return known instanceof Promise ? known.then((k) => k ? this.registered : this.dynamic) : known ? this.registered : this.dynamic;
247
241
  }
248
242
  };
249
- //#endregion
250
- //#region src/authz/client-secret.ts
243
+ // src/authz/client-secret.ts
251
244
  /**
252
245
  * Mint a confidential dynamic client's secret (RFC 7591 `client_secret`) — a
253
246
  * plain {@link generateOpaqueToken} mint. Returned to the registrant ONCE in
@@ -270,8 +263,7 @@ function hashClientSecret(secret) {
270
263
  function verifyClientSecret(secret, hash) {
271
264
  return timingSafeEqualStr(hashClientSecret(secret), hash);
272
265
  }
273
- //#endregion
274
- //#region src/authz/client-registration.ts
266
+ // src/authz/client-registration.ts
275
267
  /** A typed RFC 7591 registration failure; `message` becomes `error_description`. */
276
268
  var ClientRegistrationError = class extends Error {
277
269
  code;
@@ -431,11 +423,10 @@ var DynamicClientRegistration = class {
431
423
  return this.store.create(metadata);
432
424
  }
433
425
  };
434
- //#endregion
435
- //#region src/authz/dynamic-client-policy.ts
426
+ // src/authz/dynamic-client-policy.ts
436
427
  const DEFAULT_DYNAMIC_TOKEN_POLICY = {
437
428
  kind: "dynamic-session",
438
- ttl: 720 * 60 * 6e4
429
+ ttl: 2592e6
439
430
  };
440
431
  /**
441
432
  * Policy for RFC 7591 dynamically-registered clients (OAUTH.md R2) on the
@@ -535,8 +526,7 @@ function redirectAllowed(client, uri) {
535
526
  return reg.protocol === presented.protocol && reg.hostname === presented.hostname && reg.pathname === presented.pathname && reg.search === presented.search;
536
527
  });
537
528
  }
538
- //#endregion
539
- //#region src/authz/id-token-signer.ts
529
+ // src/authz/id-token-signer.ts
540
530
  /**
541
531
  * Signs OIDC `id_token`s and publishes the matching JWKS (AUTH-SERVER.md §4.9).
542
532
  * Holds one asymmetric keypair; mints short-lived RS256/ES256 tokens with the
@@ -589,7 +579,8 @@ var IdTokenSigner = class {
589
579
  */
590
580
  async jwks() {
591
581
  this.jwksPromise ??= (async () => {
592
- const jwk = await exportJWK(await importSPKI(this.publicKeyPem, this.alg, { extractable: true }));
582
+ const pub = await importSPKI(this.publicKeyPem, this.alg, { extractable: true });
583
+ const jwk = await exportJWK(pub);
593
584
  jwk.kid = this.kid;
594
585
  jwk.alg = this.alg;
595
586
  jwk.use = "sig";
@@ -602,8 +593,7 @@ var IdTokenSigner = class {
602
593
  return this.privateKeyPromise;
603
594
  }
604
595
  };
605
- //#endregion
606
- //#region src/authz/server-metadata.ts
596
+ // src/authz/server-metadata.ts
607
597
  /**
608
598
  * Strip a trailing slash from an issuer identifier. RFC 8414 mandates EXACT
609
599
  * (byte-identical) string comparison of issuer values, so every document that
@@ -644,8 +634,7 @@ function buildAuthorizationServerMetadata(opts) {
644
634
  ...opts.scopesSupported !== void 0 && { scopes_supported: opts.scopesSupported }
645
635
  };
646
636
  }
647
- //#endregion
648
- //#region src/authz/resource-metadata.ts
637
+ // src/authz/resource-metadata.ts
649
638
  /**
650
639
  * Build the RFC 9728 protected-resource document. Pure — no I/O, no framework;
651
640
  * mount it on any HTTP stack. Optional fields are omitted entirely (no
@@ -692,5 +681,4 @@ function buildWwwAuthenticateBearerChallenge(opts) {
692
681
  push("scope", opts?.scope);
693
682
  return params.length === 0 ? "Bearer" : `Bearer ${params.join(", ")}`;
694
683
  }
695
- //#endregion
696
684
  export { AuthCodeStore, AuthCodeStoreMemory, AuthorizeError, ClientRegistrationError, CompositeClientPolicy, DEFAULT_AUTHZ_REFRESH_TTL_MS, DEFAULT_PENDING_TTL_MS, DynamicClientPolicy, DynamicClientRegistration, DynamicClientStore, DynamicClientStoreMemory, IdTokenSigner, LoopbackClientPolicy, NoopOidcClaimsResolver, OidcClaimsResolver, PendingAuthorizationStore, PendingAuthorizationStoreMemory, RegisteredClientPolicy, buildAuthorizationServerMetadata, buildProtectedResourceMetadata, buildWwwAuthenticateBearerChallenge, canonicalizeIssuer, hashClientSecret, isLoopbackRedirectUri, mintClientSecret, scopeGrants, tokenPolicyToIssueOptions, validateClientRegistration, verifyClientSecret };
package/dist/client.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/client/index.ts
2
+ // src/client/index.ts
3
3
  /**
4
4
  * Wraps `fetch` with cookie-session silent refresh. Every call forwards
5
5
  * credentials; a response whose status is in `refreshOn` (401 by default)
@@ -68,5 +68,4 @@ function createAuthedFetch(options = {}) {
68
68
  };
69
69
  return authedFetch;
70
70
  }
71
- //#endregion
72
71
  exports.createAuthedFetch = createAuthedFetch;