@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.
- package/README.md +69 -0
- package/dist/authContext.d.ts +9 -4
- package/dist/cli/migrate.js +37 -8
- package/dist/cli/migrate.js.map +4 -4
- package/dist/client/createAuthClient.d.ts +28 -2
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +542 -8
- package/dist/client/index.js.map +5 -4
- package/dist/client/mobile.d.ts +84 -0
- package/dist/client/mobile.js +572 -0
- package/dist/client/mobile.js.map +10 -0
- package/dist/htmx/configuredRoutes.d.ts +16 -28
- package/dist/htmx/routes.d.ts +16 -28
- package/dist/index.d.ts +221 -34
- package/dist/index.js +1855 -1401
- package/dist/index.js.map +16 -12
- package/dist/oidc/config.d.ts +17 -2
- package/dist/oidc/inMemoryStores.d.ts +2 -1
- package/dist/oidc/index.d.ts +4 -2
- package/dist/oidc/index.js +589 -6
- package/dist/oidc/index.js.map +8 -4
- package/dist/oidc/nativeClients.d.ts +11 -0
- package/dist/oidc/postgresStores.d.ts +145 -1
- package/dist/oidc/socketTicketRoutes.d.ts +7 -0
- package/dist/oidc/socketTickets.d.ts +21 -0
- package/dist/oidc/types.d.ts +20 -0
- package/dist/principal.d.ts +39 -0
- package/dist/routes/protectRoute.d.ts +7 -3
- package/dist/routes/requireAuth.d.ts +4 -1
- package/dist/server.js +1843 -1400
- package/dist/server.js.map +16 -12
- package/package.json +10 -2
package/dist/oidc/config.d.ts
CHANGED
|
@@ -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;
|
package/dist/oidc/index.d.ts
CHANGED
|
@@ -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
|
|
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';
|