@absolutejs/auth 0.54.5 → 0.54.7

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.
@@ -1,5 +1,5 @@
1
1
  import type { BlockMigrations } from './types';
2
- export type BlockName = 'adaptive' | 'apikeys' | 'audit' | 'credentials' | 'fga' | 'linkedProviders' | 'lockout' | 'mfa' | 'oidc' | 'organizations' | 'passwordless' | 'portal' | 'roles' | 'scim' | 'sessions' | 'sso' | 'vault' | 'vc' | 'webauthn' | 'webhooks';
2
+ export type BlockName = 'adaptive' | 'agents' | 'apikeys' | 'audit' | 'credentials' | 'fga' | 'linkedProviders' | 'lockout' | 'mfa' | 'oidc' | 'organizations' | 'passwordless' | 'portal' | 'roles' | 'scim' | 'sessions' | 'sso' | 'vault' | 'vc' | 'webauthn' | 'webhooks';
3
3
  export declare const blockMigrations: Record<BlockName, BlockMigrations>;
4
4
  export { runMigrations } from './runner';
5
5
  export type { Migration, BlockMigrations } from './types';
@@ -1,6 +1,6 @@
1
1
  import type { RouteString } from '../types';
2
2
  import { type SigningKey } from './keys';
3
- import type { OnClientRegistration } from './registration';
3
+ import type { OnClientRegistered, OnClientRegistration } from './registration';
4
4
  import type { VciConfig } from './vci';
5
5
  import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
6
6
  export declare const DEFAULT_OIDC_ROUTE: RouteString;
@@ -73,6 +73,14 @@ export type OidcProviderConfig<UserType> = {
73
73
  logoutDeliveryStore?: LogoutDeliveryStore;
74
74
  oidcRoute?: RouteString;
75
75
  onClientRegistration?: OnClientRegistration;
76
+ /** Fires after RFC 7591 registration has been persisted and has a generated client id. */
77
+ onClientRegistered?: OnClientRegistered;
78
+ /** Fires after the authenticated user approves an RFC 8628 device request. */
79
+ onDeviceAuthorizationApproved?: (context: {
80
+ clientId: string;
81
+ scopes: string[];
82
+ userSub: string;
83
+ }) => void | Promise<void>;
76
84
  pushedAuthorizationRequestStore?: PushedAuthorizationRequestStore;
77
85
  pushedAuthorizationRequestTtlMs?: number;
78
86
  refreshTokenStore: OidcRefreshTokenStore;
@@ -2,6 +2,7 @@ import type { ClientRegistrationTokenStore, InitialAccessTokenStore, OAuthClient
2
2
  export type ClientRegistrationMetadata = {
3
3
  backchannel_logout_uri?: string;
4
4
  client_name?: string;
5
+ grant_types?: string[];
5
6
  jwks?: JsonWebKey[];
6
7
  jwks_uri?: string;
7
8
  post_logout_redirect_uris?: string[];
@@ -18,6 +19,10 @@ export type ClientRegistrationDecision = {
18
19
  export type OnClientRegistration = (context: {
19
20
  metadata: ClientRegistrationMetadata;
20
21
  }) => ClientRegistrationDecision | Promise<ClientRegistrationDecision>;
22
+ export type OnClientRegistered = (context: {
23
+ client: OAuthClient;
24
+ metadata: ClientRegistrationMetadata;
25
+ }) => void | Promise<void>;
21
26
  export type RegisterClientResult = {
22
27
  body: {
23
28
  error: string;
@@ -73,11 +78,12 @@ export declare const getRegisteredClient: ({ authorization, clientId, clientStor
73
78
  };
74
79
  readonly status: 200;
75
80
  }>;
76
- export declare const registerClient: ({ clientStore, initialAccessTokenStore, metadata, onClientRegistration, presentedInitialAccessToken, registrationBaseUrl, registrationTokenStore }: {
81
+ export declare const registerClient: ({ clientStore, initialAccessTokenStore, metadata, onClientRegistration, onClientRegistered, presentedInitialAccessToken, registrationBaseUrl, registrationTokenStore }: {
77
82
  clientStore: OAuthClientStore;
78
83
  initialAccessTokenStore?: InitialAccessTokenStore;
79
84
  metadata: ClientRegistrationMetadata;
80
85
  onClientRegistration?: OnClientRegistration;
86
+ onClientRegistered?: OnClientRegistered;
81
87
  presentedInitialAccessToken?: string;
82
88
  registrationBaseUrl: string;
83
89
  registrationTokenStore: ClientRegistrationTokenStore;
@@ -118,6 +124,7 @@ export declare const updateRegisteredClient: ({ authorization, clientId, clientS
118
124
  readonly registration_access_token: string;
119
125
  readonly backchannel_logout_uri?: string;
120
126
  readonly client_name?: string;
127
+ readonly grant_types?: string[];
121
128
  readonly jwks?: JsonWebKey[];
122
129
  readonly jwks_uri?: string;
123
130
  readonly post_logout_redirect_uris?: string[];
@@ -63,10 +63,10 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
63
63
  [x: string]: {
64
64
  post: {
65
65
  body: {
66
+ resource?: string | undefined;
66
67
  client_id?: string | undefined;
67
68
  scope?: string | undefined;
68
69
  audience?: string | undefined;
69
- resource?: string | undefined;
70
70
  refresh_token?: string | undefined;
71
71
  device_code?: string | undefined;
72
72
  auth_req_id?: string | undefined;
@@ -102,12 +102,12 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
102
102
  [x: string]: {
103
103
  post: {
104
104
  body: {
105
+ resource?: string | undefined;
105
106
  client_id?: string | undefined;
106
107
  scope?: string | undefined;
107
108
  nonce?: string | undefined;
108
109
  audience?: string | undefined;
109
110
  claims?: string | undefined;
110
- resource?: string | undefined;
111
111
  client_secret?: string | undefined;
112
112
  redirect_uri?: string | undefined;
113
113
  acr_values?: string | undefined;
@@ -333,6 +333,7 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
333
333
  scope?: string | undefined;
334
334
  backchannel_logout_uri?: string | undefined;
335
335
  client_name?: string | undefined;
336
+ grant_types?: string[] | undefined;
336
337
  jwks_uri?: string | undefined;
337
338
  post_logout_redirect_uris?: string[] | undefined;
338
339
  redirect_uris?: string[] | undefined;
@@ -392,6 +393,7 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
392
393
  scope?: string | undefined;
393
394
  backchannel_logout_uri?: string | undefined;
394
395
  client_name?: string | undefined;
396
+ grant_types?: string[] | undefined;
395
397
  jwks_uri?: string | undefined;
396
398
  post_logout_redirect_uris?: string[] | undefined;
397
399
  redirect_uris?: string[] | undefined;
@@ -1,6 +1,9 @@
1
1
  export type OAuthClient = {
2
2
  backchannelLogoutUri?: string;
3
3
  clientId: string;
4
+ /** Grant types this dynamically registered client declared. Undefined preserves
5
+ * the historical authorization-code default for statically configured clients. */
6
+ grantTypes?: string[];
4
7
  hashedSecret?: string;
5
8
  jwks?: JsonWebKey[];
6
9
  jwksUri?: string;
package/dist/types.d.ts CHANGED
@@ -2,6 +2,7 @@ import { CredentialsFor, CustomProviderCredentials, NonEmptyArray, OAuth2Client,
2
2
  import { Cookie, status as statusType, redirect as redirectType } from 'elysia';
3
3
  import { ElysiaCustomStatusResponse } from 'elysia/error';
4
4
  import type { ApiKeysConfig } from './apikeys/config';
5
+ import type { AgentAuthConfig } from './agents/config';
5
6
  import type { AuditConfig } from './audit/config';
6
7
  import type { AuthorizationConfig } from './authorization/config';
7
8
  import type { ComplianceConfig } from './compliance/config';
@@ -311,6 +312,10 @@ export type AuthConfig<UserType> = {
311
312
  * Pair with the exported `createApiKey` / `resolveApiPrincipal` / `hasScopes`
312
313
  * helpers to issue and guard with static keys. */
313
314
  apikeys?: ApiKeysConfig;
315
+ /** Standards-first delegated agent authorization. Mounts RFC 9728 protected-resource
316
+ * metadata and contributes `protectAgent`, while protocol adapters normalize verified
317
+ * credentials into durable agent registrations + user delegations. */
318
+ agentAuth?: AgentAuthConfig;
314
319
  /** OAuth2 / OIDC provider — makes your app an identity provider ("Sign in with
315
320
  * <yourapp>"). Mounts `{oidcRoute}/authorize` + `/token` + `/jwks` and
316
321
  * `/.well-known/openid-configuration`: authorization_code + mandatory PKCE, ES256
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.54.5",
2
+ "version": "0.54.7",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "license": "BSL-1.1",
18
18
  "author": "Alex Kahn",
19
19
  "scripts": {
20
- "build": "rm -rf dist && bun build src/index.ts src/saml.ts src/webauthn.ts src/htmx/index.ts src/client/index.ts src/client/react.ts src/client/vue.ts src/client/solid.ts src/client/svelte.ts src/plugins/index.ts src/providers/index.ts src/manifest.ts --root src --outdir dist --sourcemap --target=bun --external elysia --external react --external vue --external solid-js --external svelte --external @opentelemetry/api --external @simplewebauthn/server --external @node-saml/node-saml && bun build src/cli/migrate.ts --outdir dist/cli --sourcemap --target=bun --external @neondatabase/serverless --external drizzle-orm && bun build src/fingerprint-client/index.ts --outdir dist/fingerprint-client --sourcemap --target=browser && tsc --emitDeclarationOnly --project tsconfig.json && chmod +x dist/cli/migrate.js && absolute-manifest emit",
20
+ "build": "rm -rf dist && bun build src/index.ts src/agents/index.ts src/saml.ts src/webauthn.ts src/htmx/index.ts src/client/index.ts src/client/react.ts src/client/vue.ts src/client/solid.ts src/client/svelte.ts src/plugins/index.ts src/providers/index.ts src/manifest.ts --root src --outdir dist --sourcemap --target=bun --external elysia --external react --external vue --external solid-js --external svelte --external @opentelemetry/api --external @simplewebauthn/server --external @node-saml/node-saml && bun build src/cli/migrate.ts --outdir dist/cli --sourcemap --target=bun --external @neondatabase/serverless --external drizzle-orm && bun build src/fingerprint-client/index.ts --outdir dist/fingerprint-client --sourcemap --target=browser && tsc --emitDeclarationOnly --project tsconfig.json && chmod +x dist/cli/migrate.js && absolute-manifest emit",
21
21
  "config": "absolute config",
22
22
  "test": "bun test",
23
23
  "format": "absolute prettier --write",
@@ -75,7 +75,7 @@
75
75
  "@absolutejs/linked-providers": "0.0.2",
76
76
  "@neondatabase/serverless": "1.0.0",
77
77
  "citra": "0.29.7",
78
- "@absolutejs/manifest": "^0.1.0",
78
+ "@absolutejs/manifest": "^0.2.0",
79
79
  "@sinclair/typebox": "^0.34.0",
80
80
  "drizzle-orm": "1.0.0-rc.3"
81
81
  },
@@ -116,6 +116,11 @@
116
116
  "types": "./dist/client/index.d.ts",
117
117
  "require": "./dist/client/index.js"
118
118
  },
119
+ "./agents": {
120
+ "import": "./dist/agents/index.js",
121
+ "types": "./dist/agents/index.d.ts",
122
+ "require": "./dist/agents/index.js"
123
+ },
119
124
  "./htmx": {
120
125
  "import": "./dist/htmx/index.js",
121
126
  "types": "./dist/htmx/index.d.ts",
@@ -180,6 +185,9 @@
180
185
  ],
181
186
  "typesVersions": {
182
187
  "*": {
188
+ "agents": [
189
+ "dist/agents/index.d.ts"
190
+ ],
183
191
  "saml": [
184
192
  "dist/saml.d.ts"
185
193
  ],