@absolutejs/auth 0.54.7 → 0.54.9

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,32 @@
1
+ import type { OAuthClient } from './types';
2
+ export type ClientIdMetadataDocument = {
3
+ client_id: string;
4
+ client_name?: string;
5
+ redirect_uris: string[];
6
+ grant_types?: string[];
7
+ response_types?: string[];
8
+ token_endpoint_auth_method?: 'none' | 'private_key_jwt' | 'self_signed_tls_client_auth';
9
+ application_type?: 'native' | 'web';
10
+ client_uri?: string;
11
+ logo_uri?: string;
12
+ policy_uri?: string;
13
+ tos_uri?: string;
14
+ jwks_uri?: string;
15
+ jwks?: {
16
+ keys: JsonWebKey[];
17
+ };
18
+ scope?: string;
19
+ };
20
+ export declare const validateClientIdMetadataDocument: (document: ClientIdMetadataDocument, expectedClientId: string) => string[];
21
+ export declare const clientIdMetadataToOAuthClient: (document: ClientIdMetadataDocument) => OAuthClient;
22
+ /** Resolve an HTTPS URL client_id into OAuth client metadata without prior
23
+ registration. Network access is injected so callers can enforce DNS/IP/redirect
24
+ policy with @absolutejs/egress. Redirects are forbidden and documents are capped
25
+ at 5 KiB per the IETF Client ID Metadata Document security guidance. */
26
+ export declare const createClientIdMetadataResolver: ({ fetch: fetcher, allow, cacheTtlMs, maxBytes, now }: {
27
+ fetch: (input: string | URL, init?: RequestInit) => Promise<Response>;
28
+ allow?: (clientId: string) => boolean | Promise<boolean>;
29
+ cacheTtlMs?: number;
30
+ maxBytes?: number;
31
+ now?: () => number;
32
+ }) => (clientId: string) => Promise<OAuthClient | undefined>;
@@ -13,6 +13,7 @@ export type OidcProviderConfig<UserType> = {
13
13
  clientAssertionJtiStore?: ClientAssertionJtiStore;
14
14
  clientRegistrationTokenStore?: ClientRegistrationTokenStore;
15
15
  clientStore: OAuthClientStore;
16
+ resolveClientIdMetadata?: (clientId: string) => Promise<OAuthClient | undefined>;
16
17
  deviceAuthorizationStore?: DeviceAuthorizationStore;
17
18
  deviceCodeTtlMs?: number;
18
19
  devicePollIntervalSeconds?: number;
@@ -12,7 +12,8 @@ export type DpopResult = {
12
12
  jkt: string;
13
13
  jti?: string;
14
14
  };
15
- export declare const verifyDpopProof: ({ htm, htu, isUsedJti, maxAgeMs, now, proof }: {
15
+ export declare const verifyDpopProof: ({ accessToken, htm, htu, isUsedJti, maxAgeMs, now, proof }: {
16
+ accessToken?: string;
16
17
  htm: string;
17
18
  htu: string;
18
19
  isUsedJti?: (jti: string) => boolean | Promise<boolean>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.54.7",
2
+ "version": "0.54.9",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {
@@ -98,6 +98,7 @@
98
98
  "eslint-plugin-security": "^4.0.0",
99
99
  "globals": "^17.4.0",
100
100
  "prettier": "3.5.3",
101
+ "react": "^19.2.7",
101
102
  "solid-js": "^1.9.13",
102
103
  "svelte": "^5.55.9",
103
104
  "typescript": "5.8.3",