@absolutejs/auth 0.25.0 → 0.26.0-beta.0
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/audit/config.d.ts +8 -0
- package/dist/audit/inMemoryAuditStore.d.ts +2 -0
- package/dist/audit/postgresAuditStore.d.ts +142 -0
- package/dist/audit/types.d.ts +18 -0
- package/dist/audit/wrap.d.ts +9 -0
- package/dist/credentials/config.d.ts +61 -0
- package/dist/credentials/emailVerification.d.ts +83 -0
- package/dist/credentials/inMemoryCredentialStore.d.ts +2 -0
- package/dist/credentials/login.d.ts +75 -0
- package/dist/credentials/passwordPolicy.d.ts +14 -0
- package/dist/credentials/passwordReset.d.ts +87 -0
- package/dist/credentials/postgresCredentialStore.d.ts +279 -0
- package/dist/credentials/register.d.ts +54 -0
- package/dist/credentials/routes.d.ts +200 -0
- package/dist/credentials/types.d.ts +26 -0
- package/dist/crypto.d.ts +32 -0
- package/dist/{ui → htmx}/index.js +2 -2
- package/dist/{ui → htmx}/index.js.map +2 -2
- package/dist/{htmxRoutes.d.ts → htmx/routes.d.ts} +4 -4
- package/dist/index.d.ts +427 -27
- package/dist/index.js +3312 -1928
- package/dist/index.js.map +60 -27
- package/dist/{neonLinkedProviders.d.ts → linkedProviders/neonStores.d.ts} +619 -613
- package/dist/{oauthLinkedProviderResolver.d.ts → linkedProviders/oauthResolver.d.ts} +1 -1
- package/dist/lockout/config.d.ts +17 -0
- package/dist/lockout/inMemoryLockoutStore.d.ts +2 -0
- package/dist/lockout/postgresLockoutStore.d.ts +81 -0
- package/dist/lockout/types.d.ts +12 -0
- package/dist/mfa/backupCodes.d.ts +5 -0
- package/dist/mfa/challenge.d.ts +65 -0
- package/dist/mfa/config.d.ts +32 -0
- package/dist/mfa/gate.d.ts +2 -0
- package/dist/mfa/inMemoryMfaStore.d.ts +2 -0
- package/dist/mfa/postgresMfaStore.d.ts +134 -0
- package/dist/mfa/routes.d.ts +117 -0
- package/dist/mfa/secret.d.ts +2 -0
- package/dist/mfa/totp.d.ts +91 -0
- package/dist/mfa/types.d.ts +16 -0
- package/dist/{providerClients.d.ts → providers/clients.d.ts} +35 -19
- package/dist/{authorize.d.ts → routes/authorize.d.ts} +5 -5
- package/dist/{callback.d.ts → routes/callback.d.ts} +4 -4
- package/dist/{profile.d.ts → routes/profile.d.ts} +5 -5
- package/dist/{protectRoute.d.ts → routes/protectRoute.d.ts} +5 -5
- package/dist/{refresh.d.ts → routes/refresh.d.ts} +5 -5
- package/dist/{revoke.d.ts → routes/revoke.d.ts} +6 -6
- package/dist/routes/sessions.d.ts +103 -0
- package/dist/{signout.d.ts → routes/signout.d.ts} +4 -4
- package/dist/routes/stepUp.d.ts +48 -0
- package/dist/{userStatus.d.ts → routes/userStatus.d.ts} +4 -4
- package/dist/{sessionAccess.d.ts → session/access.d.ts} +12 -12
- package/dist/{sessionCleanup.d.ts → session/cleanup.d.ts} +2 -2
- package/dist/{authSessionStores.d.ts → session/inMemoryStore.d.ts} +2 -2
- package/dist/{neonAuthSessionStore.d.ts → session/neonStore.d.ts} +209 -175
- package/dist/session/promote.d.ts +13 -0
- package/dist/session/sessionsConfig.d.ts +9 -0
- package/dist/{sessionStore.d.ts → session/state.d.ts} +1 -1
- package/dist/{sessionTypes.d.ts → session/types.d.ts} +1 -1
- package/dist/session/userSessions.d.ts +16 -0
- package/dist/stores/postgres.d.ts +5 -0
- package/dist/tenancy.d.ts +9 -0
- package/dist/typeGuards.d.ts +2 -2
- package/dist/typebox.d.ts +3 -3
- package/dist/types.d.ts +33 -3
- package/dist/utils.d.ts +10 -8
- package/package.json +19 -16
- /package/dist/{ui → htmx}/index.d.ts +0 -0
- /package/dist/{ui → htmx}/renderers.d.ts +0 -0
- /package/dist/{ui → htmx}/types.d.ts +0 -0
- /package/dist/{linkedProviderStores.d.ts → linkedProviders/inMemoryStores.d.ts} +0 -0
- /package/dist/{linkedProviderResolver.d.ts → linkedProviders/resolver.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,53 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
|
+
import type { AuthHtmxUser } from './htmx/types';
|
|
2
3
|
import { AuthConfig } from './types';
|
|
3
|
-
|
|
4
|
-
export declare const auth: <UserType>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, cleanupIntervalMs, maxSessions, sessionDurationMs, authSessionStore, htmx, resolveAuthIntent, onAuthorizeSuccess, onAuthorizeError, onProfileSuccess, onProfileError, onCallbackSuccess, onLinkIdentity, onLinkIdentityConflict, onLinkConnector, onCallbackError, onStatus, onRefreshSuccess, onRefreshError, onSignOut, onRevocationSuccess, onRevocationError, onSessionCleanup }: AuthConfig<UserType>) => Promise<Elysia<"", {
|
|
4
|
+
export declare const auth: <UserType>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, cleanupIntervalMs, maxSessions, sessionDurationMs, authSessionStore, audit, credentials, mfa, lockout, sessions, htmx, resolveAuthIntent, onAuthorizeSuccess, onAuthorizeError, onProfileSuccess, onProfileError, onCallbackSuccess, onLinkIdentity, onLinkIdentityConflict, onLinkConnector, onCallbackError, onStatus, onRefreshSuccess, onRefreshError, onSignOut, onRevocationSuccess, onRevocationError, onSessionCleanup }: AuthConfig<UserType>) => Promise<Elysia<"", {
|
|
5
5
|
decorator: {};
|
|
6
6
|
store: {
|
|
7
7
|
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
8
8
|
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
9
|
+
} | {
|
|
10
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
11
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
12
|
+
} | {
|
|
13
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
14
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
15
|
+
} | {
|
|
16
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
17
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
18
|
+
} | {
|
|
19
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
20
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
21
|
+
} | {
|
|
22
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
23
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
24
|
+
} | {
|
|
25
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
26
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
27
|
+
} | {
|
|
28
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
|
|
29
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
30
|
+
} | {
|
|
31
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
32
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
33
|
+
} | {
|
|
34
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
35
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
36
|
+
} | {
|
|
37
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
38
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
39
|
+
} | {
|
|
40
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
41
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
42
|
+
} | {
|
|
43
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
44
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
45
|
+
} | {
|
|
46
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
47
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
48
|
+
} | {
|
|
49
|
+
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
50
|
+
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
9
51
|
} | {
|
|
10
52
|
session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown> & import("./types").SessionRecord<UserType & AuthHtmxUser>;
|
|
11
53
|
unregisteredSession: import("./types").UnregisteredSessionRecord;
|
|
@@ -20,6 +62,11 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
20
62
|
readonly code: "Unauthorized";
|
|
21
63
|
readonly message: "User is not authenticated";
|
|
22
64
|
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
65
|
+
} & {
|
|
66
|
+
readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
67
|
+
readonly code: "Unauthorized";
|
|
68
|
+
readonly message: "Recent authentication required";
|
|
69
|
+
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
|
|
23
70
|
} & ({} | {
|
|
24
71
|
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType & AuthHtmxUser) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
25
72
|
readonly code: "Bad Request";
|
|
@@ -68,6 +115,22 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
68
115
|
readonly message: "User is not authenticated";
|
|
69
116
|
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
70
117
|
}>;
|
|
118
|
+
} & ({
|
|
119
|
+
schema: import("elysia").UnwrapRoute<{
|
|
120
|
+
cookie: import("@sinclair/typebox").TObject<{
|
|
121
|
+
user_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"${string}-${string}-${string}-${string}-${string}">>;
|
|
122
|
+
}>;
|
|
123
|
+
}, {}, "">;
|
|
124
|
+
standaloneSchema: {};
|
|
125
|
+
macro: {};
|
|
126
|
+
macroFn: {};
|
|
127
|
+
parser: {};
|
|
128
|
+
response: import("elysia").ExtractErrorFromHandle<{
|
|
129
|
+
readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
130
|
+
readonly code: "Unauthorized";
|
|
131
|
+
readonly message: "Recent authentication required";
|
|
132
|
+
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
|
|
133
|
+
}>;
|
|
71
134
|
} & ({
|
|
72
135
|
schema: {};
|
|
73
136
|
standaloneSchema: {};
|
|
@@ -101,7 +164,7 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
101
164
|
readonly message: "User is not authenticated";
|
|
102
165
|
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
103
166
|
}>;
|
|
104
|
-
}))), (((({
|
|
167
|
+
})))), (((((((({
|
|
105
168
|
[x: string]: {
|
|
106
169
|
delete: {
|
|
107
170
|
body: unknown;
|
|
@@ -134,8 +197,8 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
134
197
|
headers: unknown;
|
|
135
198
|
response: {
|
|
136
199
|
200: Response;
|
|
137
|
-
400: "Cookies are missing" | "Invalid provider";
|
|
138
|
-
401: "Client provider not found" | "Client variant is required" | "Client variant not found" | "
|
|
200
|
+
400: "Cookies are missing" | "Invalid provider" | "Session has no access token to revoke";
|
|
201
|
+
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
|
|
139
202
|
422: {
|
|
140
203
|
type: "validation";
|
|
141
204
|
on: string;
|
|
@@ -185,7 +248,7 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
185
248
|
response: {
|
|
186
249
|
200: Response;
|
|
187
250
|
400: "Cookies are missing" | "Invalid provider" | "No refresh token found";
|
|
188
|
-
401: "Client provider not found" | "Client variant is required" | "Client variant not found" | "
|
|
251
|
+
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
|
|
189
252
|
422: {
|
|
190
253
|
type: "validation";
|
|
191
254
|
on: string;
|
|
@@ -215,8 +278,8 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
215
278
|
headers: unknown;
|
|
216
279
|
response: {
|
|
217
280
|
200: Response;
|
|
218
|
-
400: "
|
|
219
|
-
401: "Client provider not found" | "Client variant is required" | "Client variant not found"
|
|
281
|
+
400: "Cookies are missing" | "Provider is required";
|
|
282
|
+
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found";
|
|
220
283
|
422: {
|
|
221
284
|
type: "validation";
|
|
222
285
|
on: string;
|
|
@@ -247,8 +310,8 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
247
310
|
headers: unknown;
|
|
248
311
|
response: {
|
|
249
312
|
200: Response;
|
|
250
|
-
400: "
|
|
251
|
-
401: "Client provider not found" | "Client variant is required" | "Client variant not found"
|
|
313
|
+
400: "Cookies are missing" | "Provider is required";
|
|
314
|
+
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found";
|
|
252
315
|
422: {
|
|
253
316
|
type: "validation";
|
|
254
317
|
on: string;
|
|
@@ -285,8 +348,8 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
285
348
|
headers: unknown;
|
|
286
349
|
response: {
|
|
287
350
|
200: Response;
|
|
288
|
-
400: "Cookies are missing";
|
|
289
|
-
401: "Client provider not found" | "Client variant is required" | "Client variant not found" | "
|
|
351
|
+
400: "Cookies are missing" | "Session has no access token to fetch a profile";
|
|
352
|
+
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "Invalid provider" | "No user session found";
|
|
290
353
|
422: {
|
|
291
354
|
type: "validation";
|
|
292
355
|
on: string;
|
|
@@ -300,7 +363,307 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
300
363
|
};
|
|
301
364
|
};
|
|
302
365
|
};
|
|
303
|
-
}) &
|
|
366
|
+
}) & ({} | ({
|
|
367
|
+
[x: string]: {
|
|
368
|
+
post: {
|
|
369
|
+
body: {
|
|
370
|
+
email: string;
|
|
371
|
+
password: string;
|
|
372
|
+
};
|
|
373
|
+
params: {};
|
|
374
|
+
query: unknown;
|
|
375
|
+
headers: unknown;
|
|
376
|
+
response: {
|
|
377
|
+
[x: string]: any;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
} & {
|
|
382
|
+
[x: string]: {
|
|
383
|
+
post: {
|
|
384
|
+
body: {
|
|
385
|
+
token: string;
|
|
386
|
+
};
|
|
387
|
+
params: {};
|
|
388
|
+
query: unknown;
|
|
389
|
+
headers: unknown;
|
|
390
|
+
response: {
|
|
391
|
+
200: {
|
|
392
|
+
readonly status: "email_verified";
|
|
393
|
+
};
|
|
394
|
+
400: "Invalid or expired verification token";
|
|
395
|
+
422: {
|
|
396
|
+
type: "validation";
|
|
397
|
+
on: string;
|
|
398
|
+
summary?: string;
|
|
399
|
+
message?: string;
|
|
400
|
+
found?: unknown;
|
|
401
|
+
property?: string;
|
|
402
|
+
expected?: string;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
} & {
|
|
408
|
+
[x: string]: {
|
|
409
|
+
request: {
|
|
410
|
+
post: {
|
|
411
|
+
body: {
|
|
412
|
+
email: string;
|
|
413
|
+
};
|
|
414
|
+
params: {};
|
|
415
|
+
query: unknown;
|
|
416
|
+
headers: unknown;
|
|
417
|
+
response: {
|
|
418
|
+
200: {
|
|
419
|
+
readonly status: "verification_requested";
|
|
420
|
+
};
|
|
421
|
+
422: {
|
|
422
|
+
type: "validation";
|
|
423
|
+
on: string;
|
|
424
|
+
summary?: string;
|
|
425
|
+
message?: string;
|
|
426
|
+
found?: unknown;
|
|
427
|
+
property?: string;
|
|
428
|
+
expected?: string;
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
} & {
|
|
435
|
+
[x: string]: {
|
|
436
|
+
post: {
|
|
437
|
+
body: {
|
|
438
|
+
email: string;
|
|
439
|
+
password: string;
|
|
440
|
+
};
|
|
441
|
+
params: {};
|
|
442
|
+
query: unknown;
|
|
443
|
+
headers: unknown;
|
|
444
|
+
response: {
|
|
445
|
+
200: {
|
|
446
|
+
readonly status: "mfa_required";
|
|
447
|
+
} | {
|
|
448
|
+
readonly status: "authenticated";
|
|
449
|
+
};
|
|
450
|
+
401: "Invalid email or password";
|
|
451
|
+
403: {
|
|
452
|
+
readonly status: "email_not_verified";
|
|
453
|
+
};
|
|
454
|
+
422: {
|
|
455
|
+
type: "validation";
|
|
456
|
+
on: string;
|
|
457
|
+
summary?: string;
|
|
458
|
+
message?: string;
|
|
459
|
+
found?: unknown;
|
|
460
|
+
property?: string;
|
|
461
|
+
expected?: string;
|
|
462
|
+
};
|
|
463
|
+
429: {
|
|
464
|
+
readonly retryAfterMs: number | undefined;
|
|
465
|
+
readonly status: "account_locked";
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
} & {
|
|
471
|
+
[x: string]: {
|
|
472
|
+
request: {
|
|
473
|
+
post: {
|
|
474
|
+
body: {
|
|
475
|
+
email: string;
|
|
476
|
+
};
|
|
477
|
+
params: {};
|
|
478
|
+
query: unknown;
|
|
479
|
+
headers: unknown;
|
|
480
|
+
response: {
|
|
481
|
+
200: {
|
|
482
|
+
readonly status: "reset_requested";
|
|
483
|
+
};
|
|
484
|
+
422: {
|
|
485
|
+
type: "validation";
|
|
486
|
+
on: string;
|
|
487
|
+
summary?: string;
|
|
488
|
+
message?: string;
|
|
489
|
+
found?: unknown;
|
|
490
|
+
property?: string;
|
|
491
|
+
expected?: string;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
} & {
|
|
498
|
+
[x: string]: {
|
|
499
|
+
post: {
|
|
500
|
+
body: {
|
|
501
|
+
token: string;
|
|
502
|
+
password: string;
|
|
503
|
+
};
|
|
504
|
+
params: {};
|
|
505
|
+
query: unknown;
|
|
506
|
+
headers: unknown;
|
|
507
|
+
response: {
|
|
508
|
+
200: {
|
|
509
|
+
readonly status: "password_reset";
|
|
510
|
+
};
|
|
511
|
+
400: "Invalid or expired reset token" | {
|
|
512
|
+
readonly message: "Password does not meet the policy";
|
|
513
|
+
readonly violations: import(".").PasswordPolicyViolation[];
|
|
514
|
+
};
|
|
515
|
+
422: {
|
|
516
|
+
type: "validation";
|
|
517
|
+
on: string;
|
|
518
|
+
summary?: string;
|
|
519
|
+
message?: string;
|
|
520
|
+
found?: unknown;
|
|
521
|
+
property?: string;
|
|
522
|
+
expected?: string;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
}))) & ({} | ({
|
|
528
|
+
[x: string]: {
|
|
529
|
+
post: {
|
|
530
|
+
body: unknown;
|
|
531
|
+
params: {};
|
|
532
|
+
query: unknown;
|
|
533
|
+
headers: unknown;
|
|
534
|
+
response: {
|
|
535
|
+
200: {
|
|
536
|
+
readonly secret: string;
|
|
537
|
+
readonly uri: string;
|
|
538
|
+
};
|
|
539
|
+
401: "Authentication required";
|
|
540
|
+
422: {
|
|
541
|
+
type: "validation";
|
|
542
|
+
on: string;
|
|
543
|
+
summary?: string;
|
|
544
|
+
message?: string;
|
|
545
|
+
found?: unknown;
|
|
546
|
+
property?: string;
|
|
547
|
+
expected?: string;
|
|
548
|
+
};
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
} & {
|
|
553
|
+
[x: string]: {
|
|
554
|
+
post: {
|
|
555
|
+
body: {
|
|
556
|
+
code: string;
|
|
557
|
+
};
|
|
558
|
+
params: {};
|
|
559
|
+
query: unknown;
|
|
560
|
+
headers: unknown;
|
|
561
|
+
response: {
|
|
562
|
+
200: {
|
|
563
|
+
readonly backupCodes: string[];
|
|
564
|
+
};
|
|
565
|
+
400: "No TOTP enrollment in progress" | "Invalid TOTP code";
|
|
566
|
+
401: "Authentication required";
|
|
567
|
+
422: {
|
|
568
|
+
type: "validation";
|
|
569
|
+
on: string;
|
|
570
|
+
summary?: string;
|
|
571
|
+
message?: string;
|
|
572
|
+
found?: unknown;
|
|
573
|
+
property?: string;
|
|
574
|
+
expected?: string;
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
} & {
|
|
580
|
+
[x: string]: {
|
|
581
|
+
post: {
|
|
582
|
+
body: {
|
|
583
|
+
code: string;
|
|
584
|
+
};
|
|
585
|
+
params: {};
|
|
586
|
+
query: unknown;
|
|
587
|
+
headers: unknown;
|
|
588
|
+
response: {
|
|
589
|
+
200: {
|
|
590
|
+
readonly status: "authenticated";
|
|
591
|
+
};
|
|
592
|
+
401: "No MFA challenge in progress" | "Invalid MFA code";
|
|
593
|
+
422: {
|
|
594
|
+
type: "validation";
|
|
595
|
+
on: string;
|
|
596
|
+
summary?: string;
|
|
597
|
+
message?: string;
|
|
598
|
+
found?: unknown;
|
|
599
|
+
property?: string;
|
|
600
|
+
expected?: string;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
};
|
|
605
|
+
}))) & ({} | ({
|
|
606
|
+
[x: string]: {
|
|
607
|
+
get: {
|
|
608
|
+
body: unknown;
|
|
609
|
+
params: {};
|
|
610
|
+
query: unknown;
|
|
611
|
+
headers: unknown;
|
|
612
|
+
response: {
|
|
613
|
+
200: {
|
|
614
|
+
readonly sessions: {
|
|
615
|
+
authenticatedAt?: number;
|
|
616
|
+
current: boolean;
|
|
617
|
+
expiresAt: number;
|
|
618
|
+
id: import("./types").UserSessionId;
|
|
619
|
+
}[];
|
|
620
|
+
};
|
|
621
|
+
401: "Authentication required";
|
|
622
|
+
422: {
|
|
623
|
+
type: "validation";
|
|
624
|
+
on: string;
|
|
625
|
+
summary?: string;
|
|
626
|
+
message?: string;
|
|
627
|
+
found?: unknown;
|
|
628
|
+
property?: string;
|
|
629
|
+
expected?: string;
|
|
630
|
+
};
|
|
631
|
+
501: "Session management requires an authSessionStore";
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
} & {
|
|
636
|
+
[x: string]: {
|
|
637
|
+
":id": {
|
|
638
|
+
delete: {
|
|
639
|
+
body: unknown;
|
|
640
|
+
params: {
|
|
641
|
+
id: string;
|
|
642
|
+
};
|
|
643
|
+
query: unknown;
|
|
644
|
+
headers: unknown;
|
|
645
|
+
response: {
|
|
646
|
+
200: {
|
|
647
|
+
readonly revoked: `${string}-${string}-${string}-${string}-${string}`;
|
|
648
|
+
};
|
|
649
|
+
400: "Invalid session id";
|
|
650
|
+
401: "Authentication required";
|
|
651
|
+
404: "Session not found";
|
|
652
|
+
422: {
|
|
653
|
+
type: "validation";
|
|
654
|
+
on: string;
|
|
655
|
+
summary?: string;
|
|
656
|
+
message?: string;
|
|
657
|
+
found?: unknown;
|
|
658
|
+
property?: string;
|
|
659
|
+
expected?: string;
|
|
660
|
+
};
|
|
661
|
+
501: "Session management requires an authSessionStore";
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
}))) & {}) & {}) & ({} | ({
|
|
304
667
|
htmx: {
|
|
305
668
|
login: {
|
|
306
669
|
get: {
|
|
@@ -772,22 +1135,59 @@ export declare const auth: <UserType>({ providersConfiguration, authorizeRoute,
|
|
|
772
1135
|
}>>;
|
|
773
1136
|
export * from './types';
|
|
774
1137
|
export * from './typebox';
|
|
775
|
-
export type { AuthSessionStore } from './
|
|
1138
|
+
export type { AuthSessionStore } from './session/types';
|
|
776
1139
|
export { isAuthIntent, isUserSessionId, isValidUser } from './typeGuards';
|
|
777
1140
|
export { AuthIdentityConflictError } from './errors';
|
|
778
|
-
export { sessionStore } from './
|
|
779
|
-
export { createInMemoryAuthSessionStore } from './
|
|
780
|
-
export { createNeonAuthSessionStore } from './
|
|
781
|
-
export { createLinkedProviderCredentialResolver } from './
|
|
782
|
-
export { createOAuthLinkedProviderCredentialResolver } from './
|
|
783
|
-
export { createNeonLinkedProviderStores, createNeonOAuthLinkedProviderCredentialResolver } from './
|
|
784
|
-
export { createInMemoryLinkedProviderStores } from './
|
|
785
|
-
export { protectRoutePlugin } from './protectRoute';
|
|
786
|
-
export {
|
|
787
|
-
export {
|
|
788
|
-
export
|
|
789
|
-
export
|
|
1141
|
+
export { sessionStore } from './session/state';
|
|
1142
|
+
export { createInMemoryAuthSessionStore } from './session/inMemoryStore';
|
|
1143
|
+
export { createNeonAuthSessionStore } from './session/neonStore';
|
|
1144
|
+
export { createLinkedProviderCredentialResolver } from './linkedProviders/resolver';
|
|
1145
|
+
export { createOAuthLinkedProviderCredentialResolver } from './linkedProviders/oauthResolver';
|
|
1146
|
+
export { createNeonLinkedProviderStores, createNeonOAuthLinkedProviderCredentialResolver } from './linkedProviders/neonStores';
|
|
1147
|
+
export { createInMemoryLinkedProviderStores } from './linkedProviders/inMemoryStores';
|
|
1148
|
+
export { protectRoutePlugin } from './routes/protectRoute';
|
|
1149
|
+
export { sessionRoutes } from './routes/sessions';
|
|
1150
|
+
export { stepUpPlugin } from './routes/stepUp';
|
|
1151
|
+
export * from './session/sessionsConfig';
|
|
1152
|
+
export { listUserSessions, revokeUserSessions } from './session/userSessions';
|
|
1153
|
+
export type { UserSession } from './session/userSessions';
|
|
1154
|
+
export { sessionCleanup } from './session/cleanup';
|
|
1155
|
+
export { createAuthHtmxRoutes } from './htmx/routes';
|
|
1156
|
+
export { resolveAuthHtmxRenderers } from './htmx/renderers';
|
|
1157
|
+
export type { AuthHtmxConfig, AuthHtmxConnectorTarget, AuthHtmxProviderData, AuthHtmxProviderInfo, AuthHtmxRenderOverrides, AuthHtmxRenderersConfig, AuthHtmxUser, AuthIdentityPayload, LinkedProviderPayload } from './htmx/types';
|
|
790
1158
|
export * from './utils';
|
|
791
|
-
export { buildClientProviders, resolveClientProviderEntry, resolveProviderClientConfiguration } from './
|
|
1159
|
+
export { buildClientProviders, resolveClientProviderEntry, resolveProviderClientConfiguration } from './providers/clients';
|
|
792
1160
|
export type { OAuth2TokenResponse, OAuth2Client, ProviderOption, PKCEProvider, OIDCProvider, RefreshableProvider, RevocableProvider, ScopeRequiredProvider, ProvidersMap, ProviderConfiguration, CredentialsFor } from 'citra';
|
|
793
1161
|
export { providers, providerOptions, refreshableProviderOptions, revocableProviderOptions, oidcProviderOptions, pkceProviderOptions, scopeRequiredProviderOptions, decodeJWT, extractPropFromIdentity, isValidProviderOption, isRefreshableOAuth2Client, isRefreshableProviderOption, isOIDCProviderOption, isPKCEProviderOption, isRevocableProviderOption, isRevocableOAuth2Client } from 'citra';
|
|
1162
|
+
export * from './crypto';
|
|
1163
|
+
export * from './tenancy';
|
|
1164
|
+
export * from './credentials/config';
|
|
1165
|
+
export * from './credentials/passwordPolicy';
|
|
1166
|
+
export * from './credentials/types';
|
|
1167
|
+
export { credentialRoutes } from './credentials/routes';
|
|
1168
|
+
export { credentialsEmailVerification } from './credentials/emailVerification';
|
|
1169
|
+
export { credentialsLogin } from './credentials/login';
|
|
1170
|
+
export { credentialsPasswordReset } from './credentials/passwordReset';
|
|
1171
|
+
export { credentialsRegister } from './credentials/register';
|
|
1172
|
+
export { createInMemoryCredentialStore } from './credentials/inMemoryCredentialStore';
|
|
1173
|
+
export { createNeonCredentialStore, createPostgresCredentialStore, credentialResetTokensTable, credentialsTable, credentialVerificationTokensTable } from './credentials/postgresCredentialStore';
|
|
1174
|
+
export { createNeonDatabase } from './stores/postgres';
|
|
1175
|
+
export type { AnyPgDatabase } from './stores/postgres';
|
|
1176
|
+
export * from './mfa/config';
|
|
1177
|
+
export * from './mfa/types';
|
|
1178
|
+
export { consumeBackupCode, generateBackupCodes } from './mfa/backupCodes';
|
|
1179
|
+
export { createMfaGate } from './mfa/gate';
|
|
1180
|
+
export { mfaChallenge } from './mfa/challenge';
|
|
1181
|
+
export { mfaRoutes } from './mfa/routes';
|
|
1182
|
+
export { mfaTotpRoutes } from './mfa/totp';
|
|
1183
|
+
export { decryptTotpSecret, encryptTotpSecret } from './mfa/secret';
|
|
1184
|
+
export { createInMemoryMfaStore } from './mfa/inMemoryMfaStore';
|
|
1185
|
+
export { createNeonMfaStore, createPostgresMfaStore, mfaEnrollmentsTable } from './mfa/postgresMfaStore';
|
|
1186
|
+
export * from './audit/config';
|
|
1187
|
+
export * from './audit/types';
|
|
1188
|
+
export * from './lockout/config';
|
|
1189
|
+
export * from './lockout/types';
|
|
1190
|
+
export { createInMemoryLockoutStore } from './lockout/inMemoryLockoutStore';
|
|
1191
|
+
export { createNeonLockoutStore, createPostgresLockoutStore, lockoutsTable } from './lockout/postgresLockoutStore';
|
|
1192
|
+
export { createInMemoryAuditSink } from './audit/inMemoryAuditStore';
|
|
1193
|
+
export { auditEventsTable, createNeonAuditSink, createPostgresAuditSink } from './audit/postgresAuditStore';
|