@absolutejs/auth 0.55.2 → 0.55.4
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/dist/apikeys/routes.d.ts +2 -2
- package/dist/authInstance.d.ts +4 -9
- package/dist/authorization/protectPermission.d.ts +2 -2
- package/dist/compliance/routes.d.ts +2 -2
- package/dist/credentials/login.d.ts +6 -6
- package/dist/credentials/register.d.ts +2 -2
- package/dist/credentials/routes.d.ts +6 -6
- package/dist/htmx/routes.d.ts +2 -2
- package/dist/index.d.ts +2 -65
- package/dist/index.js.map +2 -2
- package/dist/mfa/challenge.d.ts +2 -2
- package/dist/mfa/management.d.ts +2 -2
- package/dist/mfa/routes.d.ts +4 -4
- package/dist/mfa/sms.d.ts +4 -4
- package/dist/mfa/totp.d.ts +2 -2
- package/dist/oidc/routes.d.ts +15 -15
- package/dist/organizations/routes.d.ts +3 -4
- package/dist/passwordless/routes.d.ts +6 -7
- package/dist/portal/routes.d.ts +3 -3
- package/dist/roles/routes.d.ts +3 -4
- package/dist/routes/callback.d.ts +2 -2
- package/dist/routes/profile.d.ts +2 -2
- package/dist/routes/protectRoute.d.ts +2 -2
- package/dist/routes/refresh.d.ts +3 -3
- package/dist/routes/revoke.d.ts +3 -3
- package/dist/routes/sessions.d.ts +5 -5
- package/dist/routes/signout.d.ts +3 -3
- package/dist/routes/stepUp.d.ts +2 -2
- package/dist/routes/userStatus.d.ts +2 -2
- package/dist/server.js.map +2 -2
- package/dist/session/cleanup.d.ts +3 -3
- package/dist/session/internalData.d.ts +34 -0
- package/dist/session/state.d.ts +3 -3
- package/dist/sso/discoveryRoute.d.ts +1 -1
- package/dist/sso/oidcRoutes.d.ts +4 -4
- package/dist/sso/samlIdpRoutes.d.ts +3 -3
- package/dist/sso/samlRoutes.d.ts +6 -7
- package/dist/webauthn/routes.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import type { OnSessionCleanup
|
|
2
|
+
import type { OnSessionCleanup } from '../types';
|
|
3
3
|
import type { AuthSessionStore } from './types';
|
|
4
4
|
type SessionCleanupProps<UserType> = {
|
|
5
5
|
authSessionStore?: AuthSessionStore<UserType>;
|
|
@@ -10,8 +10,8 @@ type SessionCleanupProps<UserType> = {
|
|
|
10
10
|
export declare const sessionCleanup: <UserType>({ authSessionStore, cleanupIntervalMs, maxSessions, onSessionCleanup }: SessionCleanupProps<UserType>) => Elysia<"", {
|
|
11
11
|
decorator: {};
|
|
12
12
|
store: {
|
|
13
|
-
session:
|
|
14
|
-
unregisteredSession:
|
|
13
|
+
session: import("./internalData").InternalSessionRecord<UserType>;
|
|
14
|
+
unregisteredSession: import("./internalData").InternalUnregisteredSessionRecord;
|
|
15
15
|
};
|
|
16
16
|
derive: {
|
|
17
17
|
readonly cleanupSessions: () => Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type InternalUserSessionId = `${string}-${string}-${string}-${string}-${string}`;
|
|
2
|
+
type InternalImpersonator = {
|
|
3
|
+
actorEmail?: string;
|
|
4
|
+
actorId: string;
|
|
5
|
+
readOnly?: boolean;
|
|
6
|
+
reason: string;
|
|
7
|
+
returnToSessionId?: InternalUserSessionId;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
suppressSideEffects?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type InternalSessionData<UserType> = {
|
|
12
|
+
accessToken?: string;
|
|
13
|
+
anonymous?: boolean;
|
|
14
|
+
authenticatedAt?: number;
|
|
15
|
+
expiresAt: number;
|
|
16
|
+
impersonator?: InternalImpersonator;
|
|
17
|
+
refreshToken?: string;
|
|
18
|
+
samlLogout?: {
|
|
19
|
+
connectionId: string;
|
|
20
|
+
nameId: string;
|
|
21
|
+
sessionIndex?: string;
|
|
22
|
+
};
|
|
23
|
+
user: UserType;
|
|
24
|
+
};
|
|
25
|
+
export type InternalSessionRecord<UserType> = Record<InternalUserSessionId, InternalSessionData<UserType>>;
|
|
26
|
+
type InternalUnregisteredSessionData = {
|
|
27
|
+
accessToken?: string;
|
|
28
|
+
expiresAt: number;
|
|
29
|
+
refreshToken?: string;
|
|
30
|
+
sessionInformation?: Record<string, unknown>;
|
|
31
|
+
userIdentity?: Record<string, unknown>;
|
|
32
|
+
};
|
|
33
|
+
export type InternalUnregisteredSessionRecord = Record<InternalUserSessionId, InternalUnregisteredSessionData>;
|
|
34
|
+
export {};
|
package/dist/session/state.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
-
import {
|
|
2
|
+
import type { InternalSessionRecord, InternalUnregisteredSessionRecord } from './internalData';
|
|
3
3
|
export declare const sessionStore: <UserType>() => Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {
|
|
6
|
-
session:
|
|
7
|
-
unregisteredSession:
|
|
6
|
+
session: InternalSessionRecord<UserType>;
|
|
7
|
+
unregisteredSession: InternalUnregisteredSessionRecord;
|
|
8
8
|
};
|
|
9
9
|
derive: {};
|
|
10
10
|
resolve: {};
|
|
@@ -33,8 +33,8 @@ export declare const ssoDiscoveryRoute: ({ getOrganizationByEmailDomain, ssoConn
|
|
|
33
33
|
headers: unknown;
|
|
34
34
|
response: {
|
|
35
35
|
400: "An \"email\" query parameter is required" | "A valid email address is required";
|
|
36
|
-
404: "No SSO organization is configured for this email domain" | "No SSO connection is configured for this organization";
|
|
37
36
|
200: Response;
|
|
37
|
+
404: "No SSO organization is configured for this email domain" | "No SSO connection is configured for this organization";
|
|
38
38
|
422: {
|
|
39
39
|
type: "validation";
|
|
40
40
|
on: string;
|
package/dist/sso/oidcRoutes.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ type OidcRoutesProps<UserType> = SSOConfig<UserType> & {
|
|
|
8
8
|
export declare const oidcSsoRoutes: <UserType>({ authSessionStore, cookieSecure, getSsoUser, onSsoCallbackError, onSsoCallbackSuccess, sessionDurationMs, ssoConnectionStore, ssoRoute }: OidcRoutesProps<UserType>) => Elysia<"", {
|
|
9
9
|
decorator: {};
|
|
10
10
|
store: {
|
|
11
|
-
session: import("
|
|
12
|
-
unregisteredSession: import("
|
|
11
|
+
session: import("../session/internalData").InternalSessionRecord<UserType>;
|
|
12
|
+
unregisteredSession: import("../session/internalData").InternalUnregisteredSessionRecord;
|
|
13
13
|
};
|
|
14
14
|
derive: {};
|
|
15
15
|
resolve: {};
|
|
@@ -33,8 +33,8 @@ export declare const oidcSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
33
33
|
query: unknown;
|
|
34
34
|
headers: unknown;
|
|
35
35
|
response: {
|
|
36
|
-
404: "No OIDC connection is configured for this organization";
|
|
37
36
|
200: Response;
|
|
37
|
+
404: "No OIDC connection is configured for this organization";
|
|
38
38
|
422: {
|
|
39
39
|
type: "validation";
|
|
40
40
|
on: string;
|
|
@@ -61,8 +61,8 @@ export declare const oidcSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
61
61
|
headers: unknown;
|
|
62
62
|
response: {
|
|
63
63
|
400: "SSO session cookies are missing" | "Invalid SSO callback request" | "SSO organization mismatch" | "OIDC token response is missing an id_token";
|
|
64
|
-
404: "No OIDC connection is configured for this organization";
|
|
65
64
|
200: Response;
|
|
65
|
+
404: "No OIDC connection is configured for this organization";
|
|
66
66
|
422: {
|
|
67
67
|
type: "validation";
|
|
68
68
|
on: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import type { AuthSessionStore } from '../session/types';
|
|
3
|
-
import type { RouteString
|
|
3
|
+
import type { RouteString } from '../types';
|
|
4
4
|
import { type SamlIdpAdapter } from './config';
|
|
5
5
|
import type { SamlServiceProviderStore } from './types';
|
|
6
6
|
type SamlIdpRoutesProps<UserType> = {
|
|
@@ -16,8 +16,8 @@ type SamlIdpRoutesProps<UserType> = {
|
|
|
16
16
|
export declare const samlIdpRoutes: <UserType>({ authSessionStore, getNameId, getSamlAttributes, idpAdapter, idpEntityId, loginUrl, samlServiceProviderStore, ssoRoute }: SamlIdpRoutesProps<UserType>) => Elysia<"", {
|
|
17
17
|
decorator: {};
|
|
18
18
|
store: {
|
|
19
|
-
session:
|
|
20
|
-
unregisteredSession: import("
|
|
19
|
+
session: import("../session/internalData").InternalSessionRecord<UserType>;
|
|
20
|
+
unregisteredSession: import("../session/internalData").InternalUnregisteredSessionRecord;
|
|
21
21
|
};
|
|
22
22
|
derive: {};
|
|
23
23
|
resolve: {};
|
package/dist/sso/samlRoutes.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import type { AuthSessionStore } from '../session/types';
|
|
3
|
-
import type { SessionRecord } from '../types';
|
|
4
3
|
import { type SamlAdapter, type SSOConfig } from './config';
|
|
5
4
|
type SamlRoutesProps<UserType> = SSOConfig<UserType> & {
|
|
6
5
|
authSessionStore?: AuthSessionStore<UserType>;
|
|
@@ -10,8 +9,8 @@ type SamlRoutesProps<UserType> = SSOConfig<UserType> & {
|
|
|
10
9
|
export declare const samlSsoRoutes: <UserType>({ authSessionStore, cookieSecure, getSsoUser, onSsoCallbackError, onSsoCallbackSuccess, samlAdapter, sessionDurationMs, ssoConnectionStore, ssoRoute }: SamlRoutesProps<UserType>) => Elysia<"", {
|
|
11
10
|
decorator: {};
|
|
12
11
|
store: {
|
|
13
|
-
session:
|
|
14
|
-
unregisteredSession: import("
|
|
12
|
+
session: import("../session/internalData").InternalSessionRecord<UserType>;
|
|
13
|
+
unregisteredSession: import("../session/internalData").InternalUnregisteredSessionRecord;
|
|
15
14
|
};
|
|
16
15
|
derive: {};
|
|
17
16
|
resolve: {};
|
|
@@ -35,8 +34,8 @@ export declare const samlSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
35
34
|
query: unknown;
|
|
36
35
|
headers: unknown;
|
|
37
36
|
response: {
|
|
38
|
-
404: "No SAML connection is configured for this organization";
|
|
39
37
|
200: Response;
|
|
38
|
+
404: "No SAML connection is configured for this organization";
|
|
40
39
|
422: {
|
|
41
40
|
type: "validation";
|
|
42
41
|
on: string;
|
|
@@ -62,8 +61,8 @@ export declare const samlSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
62
61
|
query: unknown;
|
|
63
62
|
headers: unknown;
|
|
64
63
|
response: {
|
|
65
|
-
404: "No SAML connection is configured for this organization";
|
|
66
64
|
200: Response;
|
|
65
|
+
404: "No SAML connection is configured for this organization";
|
|
67
66
|
422: {
|
|
68
67
|
type: "validation";
|
|
69
68
|
on: string;
|
|
@@ -87,8 +86,8 @@ export declare const samlSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
87
86
|
query: unknown;
|
|
88
87
|
headers: unknown;
|
|
89
88
|
response: {
|
|
90
|
-
404: "No SAML connection is configured for this organization";
|
|
91
89
|
200: Response;
|
|
90
|
+
404: "No SAML connection is configured for this organization";
|
|
92
91
|
422: {
|
|
93
92
|
type: "validation";
|
|
94
93
|
on: string;
|
|
@@ -141,9 +140,9 @@ export declare const samlSsoRoutes: <UserType>({ authSessionStore, cookieSecure,
|
|
|
141
140
|
headers: unknown;
|
|
142
141
|
response: {
|
|
143
142
|
400: "Missing SAMLRequest or SAMLResponse" | "Invalid SAML LogoutRequest";
|
|
143
|
+
200: Response;
|
|
144
144
|
501: "SAML Single Logout is not configured";
|
|
145
145
|
404: "No SAML connection is configured for this organization";
|
|
146
|
-
200: Response;
|
|
147
146
|
422: {
|
|
148
147
|
type: "validation";
|
|
149
148
|
on: string;
|
|
@@ -3,8 +3,8 @@ import { type WebAuthnRouteProps } from './config';
|
|
|
3
3
|
export declare const webauthnRoutes: <UserType>({ authSessionStore, challengeDurationMs, cookieSecure, credentialStore, emit, getUserDisplayName, getUserId, getUserName, getWebAuthnUser, onWebAuthnAuthenticated, onWebAuthnRegistered, origin, rpId, rpName, sessionDurationMs, webauthnAdapter, webauthnRoute }: WebAuthnRouteProps<UserType>) => Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {
|
|
6
|
-
session: import("
|
|
7
|
-
unregisteredSession: import("
|
|
6
|
+
session: import("../session/internalData").InternalSessionRecord<UserType>;
|
|
7
|
+
unregisteredSession: import("../session/internalData").InternalUnregisteredSessionRecord;
|
|
8
8
|
};
|
|
9
9
|
derive: {};
|
|
10
10
|
resolve: {};
|
package/package.json
CHANGED