@absolutejs/auth 0.55.3 → 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.
@@ -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: {};
@@ -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: {};
@@ -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: {};
@@ -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.3",
2
+ "version": "0.55.4",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {