@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.
Files changed (39) hide show
  1. package/dist/apikeys/routes.d.ts +2 -2
  2. package/dist/authInstance.d.ts +4 -9
  3. package/dist/authorization/protectPermission.d.ts +2 -2
  4. package/dist/compliance/routes.d.ts +2 -2
  5. package/dist/credentials/login.d.ts +6 -6
  6. package/dist/credentials/register.d.ts +2 -2
  7. package/dist/credentials/routes.d.ts +6 -6
  8. package/dist/htmx/routes.d.ts +2 -2
  9. package/dist/index.d.ts +2 -65
  10. package/dist/index.js.map +2 -2
  11. package/dist/mfa/challenge.d.ts +2 -2
  12. package/dist/mfa/management.d.ts +2 -2
  13. package/dist/mfa/routes.d.ts +4 -4
  14. package/dist/mfa/sms.d.ts +4 -4
  15. package/dist/mfa/totp.d.ts +2 -2
  16. package/dist/oidc/routes.d.ts +15 -15
  17. package/dist/organizations/routes.d.ts +3 -4
  18. package/dist/passwordless/routes.d.ts +6 -7
  19. package/dist/portal/routes.d.ts +3 -3
  20. package/dist/roles/routes.d.ts +3 -4
  21. package/dist/routes/callback.d.ts +2 -2
  22. package/dist/routes/profile.d.ts +2 -2
  23. package/dist/routes/protectRoute.d.ts +2 -2
  24. package/dist/routes/refresh.d.ts +3 -3
  25. package/dist/routes/revoke.d.ts +3 -3
  26. package/dist/routes/sessions.d.ts +5 -5
  27. package/dist/routes/signout.d.ts +3 -3
  28. package/dist/routes/stepUp.d.ts +2 -2
  29. package/dist/routes/userStatus.d.ts +2 -2
  30. package/dist/server.js.map +2 -2
  31. package/dist/session/cleanup.d.ts +3 -3
  32. package/dist/session/internalData.d.ts +34 -0
  33. package/dist/session/state.d.ts +3 -3
  34. package/dist/sso/discoveryRoute.d.ts +1 -1
  35. package/dist/sso/oidcRoutes.d.ts +4 -4
  36. package/dist/sso/samlIdpRoutes.d.ts +3 -3
  37. package/dist/sso/samlRoutes.d.ts +6 -7
  38. package/dist/webauthn/routes.d.ts +2 -2
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { Elysia } from 'elysia';
2
- import type { OnSessionCleanup, SessionRecord, UnregisteredSessionRecord } from '../types';
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: SessionRecord<UserType>;
14
- unregisteredSession: UnregisteredSessionRecord;
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 {};
@@ -1,10 +1,10 @@
1
1
  import { Elysia } from 'elysia';
2
- import { SessionRecord, UnregisteredSessionRecord } from '../types';
2
+ import type { InternalSessionRecord, InternalUnregisteredSessionRecord } from './internalData';
3
3
  export declare const sessionStore: <UserType>() => Elysia<"", {
4
4
  decorator: {};
5
5
  store: {
6
- session: SessionRecord<UserType>;
7
- unregisteredSession: UnregisteredSessionRecord;
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;
@@ -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("..").SessionRecord<UserType>;
12
- unregisteredSession: import("..").UnregisteredSessionRecord;
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, SessionRecord } from '../types';
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: SessionRecord<UserType>;
20
- unregisteredSession: import("..").UnregisteredSessionRecord;
19
+ session: import("../session/internalData").InternalSessionRecord<UserType>;
20
+ unregisteredSession: import("../session/internalData").InternalUnregisteredSessionRecord;
21
21
  };
22
22
  derive: {};
23
23
  resolve: {};
@@ -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: SessionRecord<UserType>;
14
- unregisteredSession: import("..").UnregisteredSessionRecord;
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("..").SessionRecord<UserType>;
7
- unregisteredSession: import("..").UnregisteredSessionRecord;
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.55.2",
2
+ "version": "0.55.4",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {