@absolutejs/auth 0.68.2 → 0.69.1

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.
@@ -2,7 +2,7 @@ import type { RouteString } from '../types';
2
2
  import { type SigningKey, type SigningKeyIdentity } from './keys';
3
3
  import type { OnClientRegistered, OnClientRegistration } from './registration';
4
4
  import type { VciConfig } from './vci';
5
- import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
5
+ import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshToken, OidcRefreshTokenStore, PushedAuthorizationRequestStore, SocketTicketStore } from './types';
6
6
  export declare const DEFAULT_OIDC_ROUTE: RouteString;
7
7
  export type PublicTokenGrantResult = {
8
8
  body: Record<string, unknown>;
@@ -107,6 +107,19 @@ export type OidcProviderConfig<UserType> = {
107
107
  pushedAuthorizationRequestTtlMs?: number;
108
108
  refreshTokenStore: OidcRefreshTokenStore;
109
109
  refreshTokenTtlMs?: number;
110
+ /** Enables short-lived, single-use tickets for browser/native WebSocket
111
+ * authentication at `${oidcRoute}/socket-ticket`. */
112
+ socketTicketStore?: SocketTicketStore;
113
+ /** Ticket lifetime in milliseconds. Defaults to 30 seconds. */
114
+ socketTicketTtlMs?: number;
115
+ /** Restrict which WebSocket resource audiences may receive tickets. The
116
+ * issuer itself is always the default when the request omits `audience`. */
117
+ allowSocketTicketAudience?: (context: {
118
+ audience: string;
119
+ clientId: string;
120
+ scopes: string[];
121
+ subject: string;
122
+ }) => boolean | Promise<boolean>;
110
123
  /** Previous public signing identities retained only for the bounded token
111
124
  * overlap window after rotation. The active `signingKey` always signs new
112
125
  * tokens and is published first. Private material does not belong here. */
@@ -133,7 +146,7 @@ export declare const exchangeToken: <UserType>({ actorClientId, audience, config
133
146
  requestedScopes?: string[];
134
147
  subjectToken: string;
135
148
  }) => Promise<TokenExchangeResult>;
136
- export declare const issueTokenSet: <UserType>({ acr, audience, claims, clientCertThumbprint, clientId, config, dpopJkt, nonce, now, scopes, sub }: {
149
+ export declare const issueTokenSet: <UserType>({ acr, audience, claims, clientCertThumbprint, clientId, config, dpopJkt, familyId, nonce, now, persistRefreshToken, scopes, sub }: {
137
150
  acr?: string;
138
151
  audience?: string;
139
152
  claims?: Record<string, unknown>;
@@ -141,8 +154,10 @@ export declare const issueTokenSet: <UserType>({ acr, audience, claims, clientCe
141
154
  clientId: string;
142
155
  config: OidcProviderConfig<UserType>;
143
156
  dpopJkt?: string;
157
+ familyId?: string;
144
158
  nonce?: string;
145
159
  now?: number;
160
+ persistRefreshToken?: (token: OidcRefreshToken) => Promise<void>;
146
161
  scopes: string[];
147
162
  sub: string;
148
163
  }) => Promise<{
@@ -1,4 +1,4 @@
1
- import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore } from './types';
1
+ import type { AuthorizationCodeStore, BackchannelAuthStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore, PushedAuthorizationRequestStore, SocketTicketStore } from './types';
2
2
  export declare const createInMemoryAuthorizationCodeStore: () => AuthorizationCodeStore;
3
3
  export declare const createInMemoryBackchannelAuthStore: () => BackchannelAuthStore;
4
4
  export declare const createInMemoryClientAssertionJtiStore: () => ClientAssertionJtiStore;
@@ -9,3 +9,4 @@ export declare const createInMemoryLogoutDeliveryStore: () => LogoutDeliveryStor
9
9
  export declare const createInMemoryOAuthClientStore: (clients: OAuthClient[]) => OAuthClientStore;
10
10
  export declare const createInMemoryOidcRefreshTokenStore: () => OidcRefreshTokenStore;
11
11
  export declare const createInMemoryPushedAuthorizationRequestStore: () => PushedAuthorizationRequestStore;
12
+ export declare const createInMemorySocketTicketStore: () => SocketTicketStore;
@@ -8,5 +8,7 @@
8
8
  export type { OidcProviderConfig } from './config';
9
9
  export { generateSigningKey, jwkThumbprint, signJwt, signingVerificationKeys, toPublicJwk, verifyJwt, verifyJwtWithKeys, type SigningKey, type SigningKeyIdentity } from './keys';
10
10
  export { revokeOAuthClientCredentials } from './operator';
11
- export { createNeonAuthorizationCodeStore, createNeonClientAssertionJtiStore, createNeonClientRegistrationTokenStore, createNeonDeviceAuthorizationStore, createNeonInitialAccessTokenStore, createNeonOAuthClientStore, createNeonOidcRefreshTokenStore, createPostgresAuthorizationCodeStore, createPostgresClientAssertionJtiStore, createPostgresClientRegistrationTokenStore, createPostgresDeviceAuthorizationStore, createPostgresInitialAccessTokenStore, createPostgresOAuthClientStore, createPostgresOidcRefreshTokenStore } from './postgresStores';
12
- export type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore, OidcRefreshTokenConnection, OidcRefreshTokenStore } from './types';
11
+ export { createNeonAuthorizationCodeStore, createNeonClientAssertionJtiStore, createNeonClientRegistrationTokenStore, createNeonDeviceAuthorizationStore, createNeonInitialAccessTokenStore, createNeonOAuthClientStore, createNeonOidcRefreshTokenStore, createNeonSocketTicketStore, createPostgresAuthorizationCodeStore, createPostgresClientAssertionJtiStore, createPostgresClientRegistrationTokenStore, createPostgresDeviceAuthorizationStore, createPostgresInitialAccessTokenStore, createPostgresOAuthClientStore, createPostgresOidcRefreshTokenStore, createPostgresSocketTicketStore } from './postgresStores';
12
+ export { createInMemorySocketTicketStore } from './inMemoryStores';
13
+ export { consumeSocketTicket, issueSocketTicket } from './socketTickets';
14
+ export type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore, OidcRefreshTokenConnection, OidcRefreshTokenStore, SocketTicket, SocketTicketStore } from './types';