@spfn/auth 0.3.0-beta.24 → 0.3.0-beta.26
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 +163 -5
- package/dist/client-proof.d.ts +10 -1
- package/dist/client-proof.js +126 -9
- package/dist/client-proof.js.map +1 -1
- package/dist/client.d.ts +50 -1
- package/dist/client.js +25 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +40 -0
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +48 -2
- package/dist/errors.js +27 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +23 -16
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -1
- package/dist/{machine-principals-ZJd9anVT.d.ts → machine-principals-CdEgxOB1.d.ts} +1397 -886
- package/dist/nextjs/api.js +194 -49
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/server.d.ts +17 -0
- package/dist/nextjs/server.js +33 -6
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +256 -96
- package/dist/server.js +1328 -676
- package/dist/server.js.map +1 -1
- package/migrations/20260919023107_even_mikhail_rasputin/migration.sql +20 -0
- package/migrations/20260919023107_even_mikhail_rasputin/snapshot.json +6300 -0
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AuthInitOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { A as AuthInitOptions, z as OAuthProvider, N as NewUserPublicKey, x as VerificationPurpose, B as NewPasskey, E as Passkey, G as MfaVerification, H as MfaVerificationMethod, J as NewMfaChallenge, Q as MfaChallenge, u as PermissionCategory, W as UserPublicKey, X as AuthContext } from './machine-principals-CdEgxOB1.js';
|
|
2
|
+
export { Y as ApproveDeviceAuthParams, Z as AssertStepUpParams, _ as AuthDeletionCancelledPayload, $ as AuthDeletionCompletedPayload, a0 as AuthDeletionRequestedPayload, a1 as AuthDeviceRegisteredPayload, a2 as AuthLoginPayload, a3 as AuthPasswordResetPayload, a4 as AuthProfileOutcome, a5 as AuthProfileVerifier, a6 as AuthProviderSchema, a7 as AuthRegisterPayload, a8 as BearerOutcome, a9 as BearerRefusal, aa as ChangePasswordParams, ab as CompletePasswordResetParams, ac as CompleteSignupParams, ad as ConfirmPasswordResetParams, d as ConfirmPasswordResetResult, ae as ConfirmSignupLinkParams, C as ConfirmSignupLinkResult, af as ConfirmTotpParams, g as ConfirmTotpResult, ag as DeferredLoginEvent, ah as DenyDeviceAuthParams, ai as DeviceAuthApprovedResult, aj as DeviceAuthInfoParams, D as DeviceAuthInfoResult, ak as DeviceAuthPendingResult, al as DeviceAuthPollResponseSchema, am as DeviceNameSchema, an as DeviceRegistrationChannel, ao as DisableSessionBindingParams, ap as EmailSchema, aq as FingerprintSchema, ar as FinishPasskeyEnrollmentParams, F as FinishPasskeyEnrollmentResult, as as FinishPasskeyLoginParams, at as FinishSessionRenewParams, au as InvitationAcceptedPayload, av as InvitationCreatedPayload, I as IssueOneTimeTokenResult, aw as KEY_FINGERPRINT_PREFIX_LENGTH, ax as KeyIdSchema, K as KeySummary, ay as LoginParams, L as LoginResult, az as LogoutParams, aA as MFA_CHALLENGE_ATTEMPT_LIMIT, aB as MFA_CHALLENGE_CHANNELS, aC as MFA_VERIFICATION_METHODS, aD as MachinePrincipal, aE as MachineVerifierRegistration, aF as MarkPasskeyParams, aG as MfaChallengeChannel, aH as MfaChallengeHandle, M as MfaStatus, aI as NativeVerifyOptions, aJ as NewMfaVerification, aK as NormalizedIdentity, q as OAuth2AuthorizationCodeIssued, aL as OAuth2AuthorizeParams, p as OAuth2ConsentView, r as OAuth2GrantSummary, aM as OAuth2ScopeDescription, aN as OAuthCallbackParams, aO as OAuthCallbackResult, aP as OAuthCodeExchangeOptions, aQ as OAuthNativeParams, n as OAuthNativeResult, aR as OAuthStartParams, O as OAuthStartResult, aS as OAuthTokens, aT as OAuthUnlinkedPayload, aU as OpenStepUpChallengeParams, aV as PASSKEY_DEVICE_TYPES, aW as PASSKEY_LABEL_MAX_LENGTH, aX as PasskeyDeviceType, f as PasskeySummary, aY as PasswordSchema, aZ as PhoneSchema, a_ as PlatformSchema, a$ as PollDeviceAuthParams, b0 as PollDeviceAuthResult, b1 as PublicKeySchema, b2 as RecentAuthenticationParams, b3 as RegisterParams, b4 as RegisterPublicKeyParams, b5 as RegisterPublicKeyResult, a as RegisterResult, b6 as RenamePasskeyParams, b7 as RequestPasswordResetParams, c as RequestPasswordResetResult, b8 as RequestSignupLinkParams, b as RequestSignupLinkResult, b9 as RevokeAllKeysParams, i as RevokeAllKeysResult, ba as RevokeKeyParams, bb as RevokePasskeyParams, bc as RotateKeyParams, h as RotateKeyResult, bd as SendVerificationCodeParams, S as SendVerificationCodeResult, be as SessionBindingParams, j as SessionBindingResult, bf as StartDeviceAuthParams, e as StartDeviceAuthResult, bg as StartPasskeyEnrollmentParams, bh as StartSessionRenewParams, bi as StepUpParams, bj as TargetTypeSchema, T as TotpEnrolmentResult, bk as UnlinkNotification, bl as UnlinkNotifyRejection, bm as UnlinkNotifyRequest, bn as UnlinkNotifyResult, bo as UserCodeSchema, v as VERIFICATION_PURPOSES, w as VERIFICATION_TARGET_TYPES, bp as VerificationPurposeSchema, y as VerificationTargetType, bq as VerifyCodeParams, br as VerifyCodeResult, bs as VerifyMfaChallengeParams, V as VerifyMfaChallengeResult, bt as admitBearerKey, bu as approveDeviceAuthService, bv as approveOAuth2AuthorizeService, bw as assertNotLastRecoveryCredential, bx as assertRecentAuthentication, by as assertStepUp, bz as attemptSecondFactor, bA as authDeletionCancelledEvent, bB as authDeletionCompletedEvent, bC as authDeletionRequestedEvent, bD as authDeviceRegisteredEvent, bE as authLoginEvent, bF as authPasswordResetEvent, bG as authRegisterEvent, m as authRouter, bH as authenticate, bI as bearerAuthContext, bJ as buildOAuthErrorUrl, bK as carryStepUpVerification, bL as changePasswordService, bM as completePasswordResetService, bN as completeSignupService, bO as confirmPasswordResetService, bP as confirmSignupLinkService, bQ as confirmTotpEnrolmentService, bR as denyDeviceAuthService, bS as denyOAuth2AuthorizeService, bT as describeOAuth2AuthorizeRequestService, bU as disableMfaService, bV as disableSessionBindingService, bW as enableSessionBindingService, bX as finishPasskeyEnrollmentService, bY as finishPasskeyLoginService, bZ as finishSessionRenewService, b_ as getDeviceAuthInfoService, b$ as getEnabledOAuthProviders, c0 as getGoogleAccessToken, c1 as getMachinePrincipal, c2 as getOAuthProvider, c3 as getRegisteredProviders, c4 as getSessionBindingService, c5 as invitationAcceptedEvent, c6 as invitationCreatedEvent, c7 as isOAuthProviderEnabled, c8 as issueOneTimeTokenService, c9 as keySessionBindingService, ca as listKeysService, cb as listOAuth2GrantsService, cc as listPasskeysService, cd as loginService, ce as logoutService, cf as machineAuth, cg as markPasskeySecondFactorService, ch as mfaChallenges, ci as mfaEnrolledForUser, cj as mfaStatusService, ck as mfaVerifications, cl as oauthCallbackService, cm as oauthNativeService, cn as oauthStartService, co as oauthUnlinkNotifyService, cp as oauthUnlinkedEvent, cq as openStepUpChallengeService, cr as optionalAuth, cs as passkeys, ct as pollDeviceAuthService, cu as regenerateRecoveryCodesService, cv as registerAuthProfile, cw as registerMachineVerifier, cx as registerOAuthProvider, cy as registerPublicKeyService, cz as registerService, cA as registeredBinding, cB as renamePasskeyService, cC as requestPasswordResetService, cD as requestSignupLinkService, cE as requireEnabledProvider, cF as requireMachineScope, cG as resolveAuthenticatedUser, cH as resumeStepUpChallengeService, cI as revokeAllKeysService, cJ as revokeAllOAuth2GrantsForUser, cK as revokeKeyService, cL as revokeOAuth2GrantService, cM as revokePasskeyService, cN as rotateKeyService, cO as runAuthProfile, cP as selectAuthProfile, cQ as sendVerificationCodeService, cR as startDeviceAuthService, cS as startMfaChallengeAssertionService, cT as startPasskeyEnrollmentService, cU as startPasskeyLoginService, cV as startSessionBindingDisableService, cW as startSessionRenewService, cX as startStepUpService, cY as startTotpEnrolmentService, cZ as stepUpService, c_ as sweepMfaChallengesService, c$ as sweepUnconfirmedMfaService, d0 as userPublicKeys, d1 as verifyCodeService, d2 as verifyMfaChallengeService, d3 as verifyOneTimeTokenService, d4 as verifySecondFactor } from './machine-principals-CdEgxOB1.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
4
|
import { l as SocialProvider, K as KeyAlgorithmType, d as InvitationStatus, c as AccountDeletionRequestedBy, i as PurgeStrategy } from './types-CTdoTOxM.js';
|
|
5
5
|
export { A as ACCOUNT_DELETION_REQUESTED_BY, a as ACCOUNT_DELETION_REQUEST_STATUSES, b as AccountDeletionRequestStatus, I as INVITATION_STATUSES, e as KEY_ALGORITHM, f as KEY_DEVICE_NAME_MAX_LENGTH, g as KEY_PLATFORM, h as KeyPlatformType, P as PURGE_STRATEGIES, j as SESSION_BINDINGS, k as SOCIAL_PROVIDERS, S as SessionBindingType, U as USER_STATUSES, m as UserStatus } from './types-CTdoTOxM.js';
|
|
@@ -21,6 +21,95 @@ import '@spfn/core/event';
|
|
|
21
21
|
import '@spfn/auth/server';
|
|
22
22
|
import 'jsonwebtoken';
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @spfn/auth - Signed Sign-Out-Everywhere Link
|
|
26
|
+
*
|
|
27
|
+
* A link an app mails to an account's proven address, which signs every device
|
|
28
|
+
* of that account out without a session. It exists for the case the rest of the
|
|
29
|
+
* key surface cannot serve: the owner suspects a device they do not recognise,
|
|
30
|
+
* and the device they would have to sign in on to do something about it is the
|
|
31
|
+
* one they no longer trust.
|
|
32
|
+
*
|
|
33
|
+
* Three calls, and each is deliberately not the other two. `createRevokeAllLink`
|
|
34
|
+
* mints the capability and hands the app a URL. `describeRevokeAllLink` says
|
|
35
|
+
* whether that URL still works and changes nothing, so a mail scanner opening
|
|
36
|
+
* the page costs nothing. `consumeRevokeAllLink` is the only one that revokes,
|
|
37
|
+
* and it takes the owner pressing the button.
|
|
38
|
+
*
|
|
39
|
+
* The caller's obligation, which this package cannot enforce: the URL
|
|
40
|
+
* `createRevokeAllLink` returns carries the plaintext token, because the package
|
|
41
|
+
* sends no mail here. Do not log it, do not persist it, do not put it in a job
|
|
42
|
+
* payload — hand it to the mail template and let it go. Every other link in this
|
|
43
|
+
* package is minted inside the worker that sends it precisely so that no caller
|
|
44
|
+
* ever holds one; this one cannot be, and the obligation moves to the app.
|
|
45
|
+
*/
|
|
46
|
+
interface CreateRevokeAllLinkOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Minutes the link stays valid. Defaults to
|
|
49
|
+
* `SPFN_AUTH_REVOKE_ALL_LINK_TTL_MINUTES`, itself 30.
|
|
50
|
+
*/
|
|
51
|
+
ttlMinutes?: number;
|
|
52
|
+
}
|
|
53
|
+
interface RevokeAllLink {
|
|
54
|
+
/** Absolute URL of the app page, token in its query string. Never log it. */
|
|
55
|
+
url: string;
|
|
56
|
+
expiresAt: Date;
|
|
57
|
+
}
|
|
58
|
+
/** What the describe call tells the page, so it can say what pressing the button does. */
|
|
59
|
+
interface RevokeAllLinkDescription {
|
|
60
|
+
expiresAt: Date;
|
|
61
|
+
activeKeyCount: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Mint a sign-out-everywhere link for an account.
|
|
65
|
+
*
|
|
66
|
+
* Issuing supersedes every live link the account already has, the rule the
|
|
67
|
+
* password-reset flow follows: an owner who asks twice must not leave the first
|
|
68
|
+
* capability working in their mailbox after using the second.
|
|
69
|
+
*
|
|
70
|
+
* The row records the account's key generation, so the link dies the moment any
|
|
71
|
+
* other path signs every device out — a password reset, a password change, a
|
|
72
|
+
* deletion request, or the ordinary revoke-all route.
|
|
73
|
+
*
|
|
74
|
+
* Send it beside a password reset link. It ends the sessions; it does not change
|
|
75
|
+
* the password that let them start.
|
|
76
|
+
*
|
|
77
|
+
* @param userId - The account to issue for
|
|
78
|
+
* @throws ValidationError `ttlMinutes` that is not a positive integer — no row is written
|
|
79
|
+
* @throws NotFoundError no such account, rather than a foreign-key failure at the insert
|
|
80
|
+
*/
|
|
81
|
+
declare function createRevokeAllLink(userId: string | number, options?: CreateRevokeAllLinkOptions): Promise<RevokeAllLink>;
|
|
82
|
+
/**
|
|
83
|
+
* Say whether a presented link still works, and what pressing the button would
|
|
84
|
+
* do. Changes nothing — a mail scanner that opens the page has done nothing.
|
|
85
|
+
*
|
|
86
|
+
* @throws RevokeAllLinkError every refusal, in one shape
|
|
87
|
+
*/
|
|
88
|
+
declare function describeRevokeAllLink(token: string): Promise<RevokeAllLinkDescription>;
|
|
89
|
+
/**
|
|
90
|
+
* Spend a link and sign every device of the account out.
|
|
91
|
+
*
|
|
92
|
+
* The claim is one statement, so of two requests carrying the same token exactly
|
|
93
|
+
* one revokes and the other is refused as if the token were unknown — which by
|
|
94
|
+
* then it is. `includeCurrent` is true because there is no current device here:
|
|
95
|
+
* the caller holds a mailbox, not a session, and sparing something would mean
|
|
96
|
+
* sparing whatever the owner is trying to cut off.
|
|
97
|
+
*
|
|
98
|
+
* @returns how many device keys were revoked; zero is a success, not a refusal
|
|
99
|
+
* @throws RevokeAllLinkError every refusal, in the same shape `describe` uses
|
|
100
|
+
*/
|
|
101
|
+
declare function consumeRevokeAllLink(token: string): Promise<{
|
|
102
|
+
revokedCount: number;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Delete link rows that can no longer answer anything.
|
|
106
|
+
*
|
|
107
|
+
* @returns number of rows deleted
|
|
108
|
+
*/
|
|
109
|
+
declare function purgeRevokeAllTokensService(): Promise<{
|
|
110
|
+
deleted: number;
|
|
111
|
+
}>;
|
|
112
|
+
|
|
24
113
|
/**
|
|
25
114
|
* @spfn/auth - Global Configuration
|
|
26
115
|
*
|
|
@@ -40,6 +129,16 @@ declare const COOKIE_NAMES: {
|
|
|
40
129
|
readonly SESSION_KEY_ID: string;
|
|
41
130
|
/** Pending OAuth session (privateKey, keyId, algorithm) - temporary during OAuth flow */
|
|
42
131
|
readonly OAUTH_PENDING: string;
|
|
132
|
+
/**
|
|
133
|
+
* Pending second-factor session (privateKey, keyId, challengeHash) (#95)
|
|
134
|
+
*
|
|
135
|
+
* Its own name and its own audience, separate from OAUTH_PENDING. The two
|
|
136
|
+
* coexist: a person who starts a social login in one tab while a password
|
|
137
|
+
* step-up is outstanding in another has both flows live, and one name would
|
|
138
|
+
* mean the second overwrote the first — sealing a session with a private key
|
|
139
|
+
* that does not match the key being activated.
|
|
140
|
+
*/
|
|
141
|
+
readonly MFA_PENDING: string;
|
|
43
142
|
/** OAuth CSRF nonce — double-submit against the (encrypted) state.nonce at callback */
|
|
44
143
|
readonly OAUTH_CSRF: string;
|
|
45
144
|
/** Password-setup session for verified-email signup — temporary, single-purpose */
|
|
@@ -337,6 +436,15 @@ interface MfaConfig {
|
|
|
337
436
|
issuer: string;
|
|
338
437
|
/** How long a device's step-up stays good for a sensitive change. */
|
|
339
438
|
stepUpWindowMs: number;
|
|
439
|
+
/**
|
|
440
|
+
* How long a new-device step-up challenge stays spendable.
|
|
441
|
+
*
|
|
442
|
+
* The window a person has to reach for their authenticator, and the window
|
|
443
|
+
* an attacker who has the password has to get past the second factor. Ten
|
|
444
|
+
* minutes is the same number the OAuth pending cookie and the link flows
|
|
445
|
+
* use, and the proxy's pending cookie is sealed for exactly this long.
|
|
446
|
+
*/
|
|
447
|
+
challengeTtlMs: number;
|
|
340
448
|
}
|
|
341
449
|
/**
|
|
342
450
|
* Resolve the second-factor configuration.
|
|
@@ -353,95 +461,6 @@ interface MfaConfig {
|
|
|
353
461
|
*/
|
|
354
462
|
declare function getMfaConfig(): MfaConfig;
|
|
355
463
|
|
|
356
|
-
/**
|
|
357
|
-
* @spfn/auth - Signed Sign-Out-Everywhere Link
|
|
358
|
-
*
|
|
359
|
-
* A link an app mails to an account's proven address, which signs every device
|
|
360
|
-
* of that account out without a session. It exists for the case the rest of the
|
|
361
|
-
* key surface cannot serve: the owner suspects a device they do not recognise,
|
|
362
|
-
* and the device they would have to sign in on to do something about it is the
|
|
363
|
-
* one they no longer trust.
|
|
364
|
-
*
|
|
365
|
-
* Three calls, and each is deliberately not the other two. `createRevokeAllLink`
|
|
366
|
-
* mints the capability and hands the app a URL. `describeRevokeAllLink` says
|
|
367
|
-
* whether that URL still works and changes nothing, so a mail scanner opening
|
|
368
|
-
* the page costs nothing. `consumeRevokeAllLink` is the only one that revokes,
|
|
369
|
-
* and it takes the owner pressing the button.
|
|
370
|
-
*
|
|
371
|
-
* The caller's obligation, which this package cannot enforce: the URL
|
|
372
|
-
* `createRevokeAllLink` returns carries the plaintext token, because the package
|
|
373
|
-
* sends no mail here. Do not log it, do not persist it, do not put it in a job
|
|
374
|
-
* payload — hand it to the mail template and let it go. Every other link in this
|
|
375
|
-
* package is minted inside the worker that sends it precisely so that no caller
|
|
376
|
-
* ever holds one; this one cannot be, and the obligation moves to the app.
|
|
377
|
-
*/
|
|
378
|
-
interface CreateRevokeAllLinkOptions {
|
|
379
|
-
/**
|
|
380
|
-
* Minutes the link stays valid. Defaults to
|
|
381
|
-
* `SPFN_AUTH_REVOKE_ALL_LINK_TTL_MINUTES`, itself 30.
|
|
382
|
-
*/
|
|
383
|
-
ttlMinutes?: number;
|
|
384
|
-
}
|
|
385
|
-
interface RevokeAllLink {
|
|
386
|
-
/** Absolute URL of the app page, token in its query string. Never log it. */
|
|
387
|
-
url: string;
|
|
388
|
-
expiresAt: Date;
|
|
389
|
-
}
|
|
390
|
-
/** What the describe call tells the page, so it can say what pressing the button does. */
|
|
391
|
-
interface RevokeAllLinkDescription {
|
|
392
|
-
expiresAt: Date;
|
|
393
|
-
activeKeyCount: number;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Mint a sign-out-everywhere link for an account.
|
|
397
|
-
*
|
|
398
|
-
* Issuing supersedes every live link the account already has, the rule the
|
|
399
|
-
* password-reset flow follows: an owner who asks twice must not leave the first
|
|
400
|
-
* capability working in their mailbox after using the second.
|
|
401
|
-
*
|
|
402
|
-
* The row records the account's key generation, so the link dies the moment any
|
|
403
|
-
* other path signs every device out — a password reset, a password change, a
|
|
404
|
-
* deletion request, or the ordinary revoke-all route.
|
|
405
|
-
*
|
|
406
|
-
* Send it beside a password reset link. It ends the sessions; it does not change
|
|
407
|
-
* the password that let them start.
|
|
408
|
-
*
|
|
409
|
-
* @param userId - The account to issue for
|
|
410
|
-
* @throws ValidationError `ttlMinutes` that is not a positive integer — no row is written
|
|
411
|
-
* @throws NotFoundError no such account, rather than a foreign-key failure at the insert
|
|
412
|
-
*/
|
|
413
|
-
declare function createRevokeAllLink(userId: string | number, options?: CreateRevokeAllLinkOptions): Promise<RevokeAllLink>;
|
|
414
|
-
/**
|
|
415
|
-
* Say whether a presented link still works, and what pressing the button would
|
|
416
|
-
* do. Changes nothing — a mail scanner that opens the page has done nothing.
|
|
417
|
-
*
|
|
418
|
-
* @throws RevokeAllLinkError every refusal, in one shape
|
|
419
|
-
*/
|
|
420
|
-
declare function describeRevokeAllLink(token: string): Promise<RevokeAllLinkDescription>;
|
|
421
|
-
/**
|
|
422
|
-
* Spend a link and sign every device of the account out.
|
|
423
|
-
*
|
|
424
|
-
* The claim is one statement, so of two requests carrying the same token exactly
|
|
425
|
-
* one revokes and the other is refused as if the token were unknown — which by
|
|
426
|
-
* then it is. `includeCurrent` is true because there is no current device here:
|
|
427
|
-
* the caller holds a mailbox, not a session, and sparing something would mean
|
|
428
|
-
* sparing whatever the owner is trying to cut off.
|
|
429
|
-
*
|
|
430
|
-
* @returns how many device keys were revoked; zero is a success, not a refusal
|
|
431
|
-
* @throws RevokeAllLinkError every refusal, in the same shape `describe` uses
|
|
432
|
-
*/
|
|
433
|
-
declare function consumeRevokeAllLink(token: string): Promise<{
|
|
434
|
-
revokedCount: number;
|
|
435
|
-
}>;
|
|
436
|
-
/**
|
|
437
|
-
* Delete link rows that can no longer answer anything.
|
|
438
|
-
*
|
|
439
|
-
* @returns number of rows deleted
|
|
440
|
-
*/
|
|
441
|
-
declare function purgeRevokeAllTokensService(): Promise<{
|
|
442
|
-
deleted: number;
|
|
443
|
-
}>;
|
|
444
|
-
|
|
445
464
|
/**
|
|
446
465
|
* @spfn/auth - Users Entity
|
|
447
466
|
*
|
|
@@ -6019,6 +6038,17 @@ type NewAuthMetadataEntity = typeof authMetadata.$inferInsert;
|
|
|
6019
6038
|
* - 타입 안전성
|
|
6020
6039
|
*/
|
|
6021
6040
|
declare class UsersRepository extends BaseRepository {
|
|
6041
|
+
/**
|
|
6042
|
+
* The account's current key generation.
|
|
6043
|
+
*
|
|
6044
|
+
* Read from the primary, and this is the one place that matters: the value
|
|
6045
|
+
* is stamped onto a second-factor challenge that must die with the
|
|
6046
|
+
* generation it was minted in, and a replica lagging behind a revoke-all
|
|
6047
|
+
* would stamp the generation that has just ended.
|
|
6048
|
+
*
|
|
6049
|
+
* Write primary 사용
|
|
6050
|
+
*/
|
|
6051
|
+
currentKeyEpoch(id: number): Promise<number>;
|
|
6022
6052
|
/**
|
|
6023
6053
|
* ID로 사용자 조회
|
|
6024
6054
|
* Read replica 사용
|
|
@@ -6287,10 +6317,10 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6287
6317
|
create(data: NewUser): Promise<{
|
|
6288
6318
|
email: string | null;
|
|
6289
6319
|
phone: string | null;
|
|
6290
|
-
sessionBinding: "none" | "passkey";
|
|
6291
6320
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6292
6321
|
publicId: string;
|
|
6293
6322
|
passwordChangeRequired: boolean;
|
|
6323
|
+
sessionBinding: "none" | "passkey";
|
|
6294
6324
|
id: number;
|
|
6295
6325
|
username: string | null;
|
|
6296
6326
|
passwordHash: string | null;
|
|
@@ -6462,10 +6492,10 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6462
6492
|
deleteById(id: number): Promise<{
|
|
6463
6493
|
email: string | null;
|
|
6464
6494
|
phone: string | null;
|
|
6465
|
-
sessionBinding: "none" | "passkey";
|
|
6466
6495
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6467
6496
|
publicId: string;
|
|
6468
6497
|
passwordChangeRequired: boolean;
|
|
6498
|
+
sessionBinding: "none" | "passkey";
|
|
6469
6499
|
id: number;
|
|
6470
6500
|
username: string | null;
|
|
6471
6501
|
passwordHash: string | null;
|
|
@@ -6589,6 +6619,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6589
6619
|
clientContractVersion: string | null;
|
|
6590
6620
|
clientSeenAt: Date | null;
|
|
6591
6621
|
isActive: boolean;
|
|
6622
|
+
pendingMfaChallengeId: number | null;
|
|
6592
6623
|
createdAt: Date;
|
|
6593
6624
|
lastUsedAt: Date | null;
|
|
6594
6625
|
expiresAt: Date | null;
|
|
@@ -6620,6 +6651,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6620
6651
|
clientContractVersion: string | null;
|
|
6621
6652
|
clientSeenAt: Date | null;
|
|
6622
6653
|
isActive: boolean;
|
|
6654
|
+
pendingMfaChallengeId: number | null;
|
|
6623
6655
|
createdAt: Date;
|
|
6624
6656
|
lastUsedAt: Date | null;
|
|
6625
6657
|
expiresAt: Date | null;
|
|
@@ -6651,6 +6683,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6651
6683
|
clientContractVersion: string | null;
|
|
6652
6684
|
clientSeenAt: Date | null;
|
|
6653
6685
|
isActive: boolean;
|
|
6686
|
+
pendingMfaChallengeId: number | null;
|
|
6654
6687
|
createdAt: Date;
|
|
6655
6688
|
lastUsedAt: Date | null;
|
|
6656
6689
|
expiresAt: Date | null;
|
|
@@ -6669,6 +6702,12 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6669
6702
|
* `lastSeenIp` is not selected, deliberately. The concurrent-use moment is
|
|
6670
6703
|
* what the owner acts on; the trail of addresses behind it is stored PII the
|
|
6671
6704
|
* account surface has no use for.
|
|
6705
|
+
*
|
|
6706
|
+
* A key still waiting on a second factor is excluded in **both** modes
|
|
6707
|
+
* (#95). It is not a device that can sign, so it does not belong in the
|
|
6708
|
+
* default list; and it is not a device the owner signed out either, so it
|
|
6709
|
+
* does not belong in the revoked one — where it would read exactly like a
|
|
6710
|
+
* revoked key with no revocation time, which is a different thing entirely.
|
|
6672
6711
|
* Read replica 사용
|
|
6673
6712
|
*/
|
|
6674
6713
|
listForUser(userId: number, includeRevoked?: boolean): Promise<{
|
|
@@ -6716,6 +6755,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6716
6755
|
clientVersion: string | null;
|
|
6717
6756
|
clientContractVersion: string | null;
|
|
6718
6757
|
clientSeenAt: Date | null;
|
|
6758
|
+
pendingMfaChallengeId: number | null;
|
|
6719
6759
|
revokedReason: string | null;
|
|
6720
6760
|
}>;
|
|
6721
6761
|
/**
|
|
@@ -6749,6 +6789,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6749
6789
|
clientContractVersion: string | null;
|
|
6750
6790
|
clientSeenAt: Date | null;
|
|
6751
6791
|
isActive: boolean;
|
|
6792
|
+
pendingMfaChallengeId: number | null;
|
|
6752
6793
|
createdAt: Date;
|
|
6753
6794
|
lastUsedAt: Date | null;
|
|
6754
6795
|
expiresAt: Date | null;
|
|
@@ -6784,6 +6825,17 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6784
6825
|
* active keys still had its generation ended, and an outstanding
|
|
6785
6826
|
* sign-out-everywhere link must die with it.
|
|
6786
6827
|
*
|
|
6828
|
+
* The two second-factor CTEs are here for the same "no caller can forget"
|
|
6829
|
+
* reason (#95). A pending key is `is_active = false`, so the UPDATE below
|
|
6830
|
+
* does not touch it and neither would anything else: the owner who sees an
|
|
6831
|
+
* unexpected second-factor prompt and does exactly what the notice says —
|
|
6832
|
+
* change the password, sign out everywhere, open the revoke-all link, run a
|
|
6833
|
+
* reset — would otherwise leave the attacker's pending key and its live
|
|
6834
|
+
* challenge untouched. Deleting the key cascades onto its challenge; the
|
|
6835
|
+
* expiry beside it catches a challenge whose key is already gone. A pending
|
|
6836
|
+
* row and an active row are disjoint sets, so the two statements never
|
|
6837
|
+
* contend for the same row.
|
|
6838
|
+
*
|
|
6787
6839
|
* Write primary 사용
|
|
6788
6840
|
*/
|
|
6789
6841
|
private revokeActive;
|
|
@@ -6816,6 +6868,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6816
6868
|
clientVersion: string | null;
|
|
6817
6869
|
clientContractVersion: string | null;
|
|
6818
6870
|
clientSeenAt: Date | null;
|
|
6871
|
+
pendingMfaChallengeId: number | null;
|
|
6819
6872
|
revokedReason: string | null;
|
|
6820
6873
|
}>;
|
|
6821
6874
|
/**
|
|
@@ -6851,6 +6904,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6851
6904
|
clientContractVersion: string | null;
|
|
6852
6905
|
clientSeenAt: Date | null;
|
|
6853
6906
|
isActive: boolean;
|
|
6907
|
+
pendingMfaChallengeId: number | null;
|
|
6854
6908
|
createdAt: Date;
|
|
6855
6909
|
lastUsedAt: Date | null;
|
|
6856
6910
|
expiresAt: Date | null;
|
|
@@ -6882,6 +6936,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6882
6936
|
clientContractVersion: string | null;
|
|
6883
6937
|
clientSeenAt: Date | null;
|
|
6884
6938
|
isActive: boolean;
|
|
6939
|
+
pendingMfaChallengeId: number | null;
|
|
6885
6940
|
createdAt: Date;
|
|
6886
6941
|
lastUsedAt: Date | null;
|
|
6887
6942
|
expiresAt: Date | null;
|
|
@@ -6917,6 +6972,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6917
6972
|
clientContractVersion: string | null;
|
|
6918
6973
|
clientSeenAt: Date | null;
|
|
6919
6974
|
isActive: boolean;
|
|
6975
|
+
pendingMfaChallengeId: number | null;
|
|
6920
6976
|
createdAt: Date;
|
|
6921
6977
|
lastUsedAt: Date | null;
|
|
6922
6978
|
expiresAt: Date | null;
|
|
@@ -6960,6 +7016,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6960
7016
|
clientContractVersion: string | null;
|
|
6961
7017
|
clientSeenAt: Date | null;
|
|
6962
7018
|
isActive: boolean;
|
|
7019
|
+
pendingMfaChallengeId: number | null;
|
|
6963
7020
|
createdAt: Date;
|
|
6964
7021
|
lastUsedAt: Date | null;
|
|
6965
7022
|
expiresAt: Date | null;
|
|
@@ -6991,6 +7048,7 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6991
7048
|
clientContractVersion: string | null;
|
|
6992
7049
|
clientSeenAt: Date | null;
|
|
6993
7050
|
isActive: boolean;
|
|
7051
|
+
pendingMfaChallengeId: number | null;
|
|
6994
7052
|
createdAt: Date;
|
|
6995
7053
|
lastUsedAt: Date | null;
|
|
6996
7054
|
expiresAt: Date | null;
|
|
@@ -7687,6 +7745,108 @@ declare class MfaVerificationsRepository extends BaseRepository {
|
|
|
7687
7745
|
}
|
|
7688
7746
|
declare const mfaVerificationsRepository: MfaVerificationsRepository;
|
|
7689
7747
|
|
|
7748
|
+
/**
|
|
7749
|
+
* MFA Challenges Repository
|
|
7750
|
+
*
|
|
7751
|
+
* Data access for the row that stands between a registered-but-inactive key and
|
|
7752
|
+
* a session. Extends BaseRepository for transaction-context detection and
|
|
7753
|
+
* read/write splitting.
|
|
7754
|
+
*
|
|
7755
|
+
* Every lookup here is by `challenge_hash` and never by id. The secret is what
|
|
7756
|
+
* the caller holds; the hash is what this table has, so a row can only be found
|
|
7757
|
+
* by someone who already had the secret — a guess reaches no row at all, which
|
|
7758
|
+
* is what keeps a guess from touching another challenge's `attempts`.
|
|
7759
|
+
*/
|
|
7760
|
+
|
|
7761
|
+
declare class MfaChallengesRepository extends BaseRepository {
|
|
7762
|
+
/** Park a fresh challenge. The caller has already written the pending key. */
|
|
7763
|
+
create(data: NewMfaChallenge): Promise<MfaChallenge>;
|
|
7764
|
+
/**
|
|
7765
|
+
* The challenge this secret names, whatever state it is in.
|
|
7766
|
+
*
|
|
7767
|
+
* Reads the primary rather than the replica: `verify` decides whether a key
|
|
7768
|
+
* becomes usable, and a replica lagging behind the 202 that created the row
|
|
7769
|
+
* would refuse a challenge the caller was handed a moment ago.
|
|
7770
|
+
*/
|
|
7771
|
+
findByHash(challengeHash: string): Promise<MfaChallenge | null>;
|
|
7772
|
+
/**
|
|
7773
|
+
* The live challenge already outstanding for this key, if there is one.
|
|
7774
|
+
*
|
|
7775
|
+
* What makes a retried registration resume rather than collide: a native
|
|
7776
|
+
* client reusing its keyId, or an OAuth state replayed from the back button,
|
|
7777
|
+
* gets the challenge it was already given instead of a 409 about a key it
|
|
7778
|
+
* does own.
|
|
7779
|
+
*/
|
|
7780
|
+
findLiveByKeyId(userId: number, keyId: string): Promise<MfaChallenge | null>;
|
|
7781
|
+
/**
|
|
7782
|
+
* Spend the challenge, or answer false because somebody else already did.
|
|
7783
|
+
*
|
|
7784
|
+
* A conditional UPDATE and not a read followed by a write: two verifies
|
|
7785
|
+
* arriving together would both pass a read, and a challenge is single use.
|
|
7786
|
+
* Every condition the caller checked is restated here, so the row that is
|
|
7787
|
+
* marked is a row that was still spendable at the moment it was marked.
|
|
7788
|
+
*/
|
|
7789
|
+
markVerified(id: number, keyEpoch: number): Promise<boolean>;
|
|
7790
|
+
/**
|
|
7791
|
+
* Count a wrong proof, and say whether that was the last one allowed.
|
|
7792
|
+
*
|
|
7793
|
+
* The increment is on the row the presented secret actually hashed to, which
|
|
7794
|
+
* is the whole reason lookup is by hash: there is no id for a caller to name,
|
|
7795
|
+
* so no counter but their own can be moved.
|
|
7796
|
+
*/
|
|
7797
|
+
countFailure(id: number): Promise<boolean>;
|
|
7798
|
+
/**
|
|
7799
|
+
* Point an inactive key at the challenge that gates it.
|
|
7800
|
+
*
|
|
7801
|
+
* A second statement rather than a column on the insert, because the
|
|
7802
|
+
* challenge references the key: the key row has to exist before the
|
|
7803
|
+
* challenge can, so the back-reference is written once both do. Both run
|
|
7804
|
+
* inside the registering route's transaction.
|
|
7805
|
+
*/
|
|
7806
|
+
markKeyPending(keyId: string, challengeId: number): Promise<void>;
|
|
7807
|
+
/**
|
|
7808
|
+
* Give a live challenge a fresh secret, leaving everything else alone.
|
|
7809
|
+
*
|
|
7810
|
+
* What a retried registration gets. The row keeps its id, its expiry and its
|
|
7811
|
+
* spent attempts, so retrying is not a way to reset the counter or buy
|
|
7812
|
+
* another ten minutes; only the secret is new, because the old one was never
|
|
7813
|
+
* stored and cannot be handed out twice.
|
|
7814
|
+
*/
|
|
7815
|
+
resecret(id: number, challengeHash: string): Promise<boolean>;
|
|
7816
|
+
/**
|
|
7817
|
+
* Delete the pending key a challenge was gating, which takes the challenge
|
|
7818
|
+
* with it through the cascade.
|
|
7819
|
+
*
|
|
7820
|
+
* Scoped to `pending_mfa_challenge_id`, so a key that has since been
|
|
7821
|
+
* activated is never deleted by a late failure or a sweep.
|
|
7822
|
+
*/
|
|
7823
|
+
dropPendingKey(keyId: string, challengeId: number): Promise<void>;
|
|
7824
|
+
/**
|
|
7825
|
+
* Mark a key active and no longer pending — what a verified challenge buys.
|
|
7826
|
+
*
|
|
7827
|
+
* Conditioned on the challenge id, so this can only activate the key that
|
|
7828
|
+
* challenge was minted for.
|
|
7829
|
+
*/
|
|
7830
|
+
activateKey(keyId: string, challengeId: number): Promise<void>;
|
|
7831
|
+
/**
|
|
7832
|
+
* Clear out challenges nobody finished, and the keys they were gating.
|
|
7833
|
+
*
|
|
7834
|
+
* Counted from the read rather than from either delete, because the two
|
|
7835
|
+
* overlap: deleting a pending key cascades onto its challenge, so the second
|
|
7836
|
+
* statement finds only the challenges whose key had already gone some other
|
|
7837
|
+
* way — and a count taken there would report a sweep that did nothing.
|
|
7838
|
+
*
|
|
7839
|
+
* A spent challenge is kept for the same span as an expired one, so a replay
|
|
7840
|
+
* inside the window meets "already verified" from a row rather than
|
|
7841
|
+
* "unknown" from an absence. The 401 is the same either way; the record is
|
|
7842
|
+
* not.
|
|
7843
|
+
*
|
|
7844
|
+
* @returns how many challenge rows are gone
|
|
7845
|
+
*/
|
|
7846
|
+
sweepFinished(cutoff: Date): Promise<number>;
|
|
7847
|
+
}
|
|
7848
|
+
declare const mfaChallengesRepository: MfaChallengesRepository;
|
|
7849
|
+
|
|
7690
7850
|
/**
|
|
7691
7851
|
* MFA Enrolment Repository
|
|
7692
7852
|
*
|
|
@@ -8984,9 +9144,9 @@ declare class AccountDeletionRequestsRepository extends BaseRepository {
|
|
|
8984
9144
|
cancelledAt: Date | null;
|
|
8985
9145
|
completedAt: Date | null;
|
|
8986
9146
|
userPublicId: string;
|
|
8987
|
-
requestedAt: Date;
|
|
8988
9147
|
requestedBy: "admin" | "self";
|
|
8989
9148
|
purgeStrategy: "anonymize" | "hard-delete" | null;
|
|
9149
|
+
requestedAt: Date;
|
|
8990
9150
|
}>;
|
|
8991
9151
|
/**
|
|
8992
9152
|
* 요청 취소 (복구)
|
|
@@ -9926,10 +10086,10 @@ declare function getUser(c: Context | {
|
|
|
9926
10086
|
}): {
|
|
9927
10087
|
email: string | null;
|
|
9928
10088
|
phone: string | null;
|
|
9929
|
-
sessionBinding: "none" | "passkey";
|
|
9930
10089
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
9931
10090
|
publicId: string;
|
|
9932
10091
|
passwordChangeRequired: boolean;
|
|
10092
|
+
sessionBinding: "none" | "passkey";
|
|
9933
10093
|
id: number;
|
|
9934
10094
|
username: string | null;
|
|
9935
10095
|
passwordHash: string | null;
|
|
@@ -10934,4 +11094,4 @@ declare const authJobRouter: _spfn_core_job.JobRouter<{
|
|
|
10934
11094
|
*/
|
|
10935
11095
|
declare const createAuthDeletionJobRouter: typeof createAuthJobRouter;
|
|
10936
11096
|
|
|
10937
|
-
export { AUTHORIZE_PATH, type AccountDeletionPurgeUser, type AccountDeletionRequest, AccountDeletionRequestedBy, AccountDeletionRequestsRepository, type AuthConfig, AuthContext, type AuthCsrfConfig, type AuthDeletionConfig, type AuthDeviceAuthConfig, type AuthLifecycleConfig, type AuthLifecycleOptions, type AuthMetadataEntity, AuthMetadataRepository, type AuthorizationServerConfig, type AuthorizationServerOptions, type BeforeRegisterContext, COOKIE_NAMES, CSRF_HEADER, type CancelAccountDeletionParams, type CancelAccountDeletionResult, type CreateOAuthStateParams, type CreateRevokeAllLinkOptions, type CsrfMode, DEFAULT_ACCESS_TOKEN_TTL_MS, DEFAULT_CODE_TTL_MS, DEFAULT_DELETION_ALLOW_SELF_IMMEDIATE, DEFAULT_DELETION_GRACE_PERIOD_DAYS, DEFAULT_DELETION_PURGE_CRON, DEFAULT_DELETION_PURGE_STRATEGY, DEFAULT_DELETION_SEND_NOTIFICATIONS, DEFAULT_DEVICE_AUTH_INTERVAL_MS, DEFAULT_DEVICE_AUTH_TTL_MS, DEFAULT_REFRESH_TOKEN_TTL_MS, DEFAULT_REVOKE_ALL_TOKEN_PURGE_CRON, DEVICE_AUTH_STATUSES, type DecryptedOAuthToken, type DeviceAuthStatus, type DeviceAuthorization, DeviceAuthorizationsRepository, type EmailNormalizationResult, EnvironmentKeyringTokenCipher, type GoogleTokenResponse, type GoogleUserInfo, type Invitation, InvitationStatus, InvitationsRepository, type IssuedOpsToken, KeyAlgorithmType, type KeyRevokeAllToken, KeyRevokeAllTokensRepository, KeysRepository, type LiveRevokeAllLink, MAX_UNGRANTED_CLIENTS_PER_IP, MFA_CONFIRM_ATTEMPT_LIMIT, type MfaConfig, MfaEnrolmentRepository, type MfaRecoveryCode, MfaRecoveryCodesRepository, type MfaTotp, MfaTotpRepository, MfaVerification, MfaVerificationMethod, MfaVerificationsRepository, type NewAccountDeletionRequest, type NewAuthMetadataEntity, type NewDeviceAuthorization, type NewInvitation, type NewKeyRevokeAllToken, type NewMfaRecoveryCode, type NewMfaTotp, type NewOAuth2AuthorizationCode, type NewOAuth2Client, type NewOAuth2Grant, type NewOAuth2Token, type NewOpsToken, NewPasskey, type NewPasswordResetToken, type NewPermission, type NewPermissionEntity, type NewRole, type NewRoleEntity, type NewRolePermission, type NewSignupLinkToken, type NewUser, type NewUserPermission, type NewUserProfile, NewUserPublicKey, type NewUserSocialAccount, type NewVerificationCode, type NewWebAuthnChallenge, OAUTH2_ACCESS_TOKEN_PREFIX, OAUTH2_REFRESH_TOKEN_PREFIX, OAUTH2_TOKEN_KINDS, type OAuth2AuthorizationCode, OAuth2AuthorizationCodesRepository, type OAuth2Client, OAuth2ClientsRepository, type OAuth2Grant, type OAuth2GrantWithClient, OAuth2GrantsRepository, type OAuth2RegisterRefusal, type OAuth2RegisterRequest, type OAuth2RegisterResult, type OAuth2RegisteredClient, type OAuth2Token, type OAuth2TokenKind, type OAuth2TokenRefusal, type OAuth2TokenRequest, type OAuth2TokenResponse, type OAuth2TokenResult, OAuth2TokensRepository, OAuthProvider, type OAuthState, type OAuthTokenCipher, type OAuthTokenContext, type OAuthTokenType, OPS_TOKEN_PREFIX, type OpsOrUserConfig, type OpsToken, OpsTokensRepository, Passkey, type PasskeyConfig, type PasskeyUserVerification, PasskeysRepository, type PasswordResetToken, PasswordResetTokensRepository, type PendingDeletionInfo, type Permission, type PermissionEntity, PermissionsRepository, PurgeStrategy, type PurgeUserResult, type RedirectUriRefusal, type RegisterChannel, type RequestAccountDeletionParams, type RequestAccountDeletionResult, type RevokeAllLink, type RevokeAllLinkDescription, type RevokedKey, type Role, type RoleEntity, type RoleGuardOptions, type RolePermission, RolePermissionsRepository, RolesRepository, STALE_CLIENT_MAX_AGE_MS, SUPPORTED_GRANT_TYPES, SUPPORTED_RESPONSE_TYPES, type SessionPayload, type SignupLinkToken, SignupLinkTokensRepository, SocialAccountsRepository, SocialProvider, type SweepDuePurgesResult, type TokenEncryptionKey, type TokenPayload, USER_CODE_ALPHABET, USER_CODE_LENGTH, type UpdateProfileParams, type User, type UserPermission, UserPermissionsRepository, type UserProfile, UserProfilesRepository, UserPublicKey, type UserSocialAccount, UsersRepository, V2_PREFIX, type VerificationCode, VerificationCodesRepository, VerificationPurpose, type VerifiedOAuth2AccessToken, type VerifiedOpsToken, type VerifyIdTokenParams, WEBAUTHN_CHALLENGE_KINDS, type WebAuthnChallenge, type WebAuthnChallengeKind, WebAuthnChallengesRepository, acceptInvitation, accountDeletionRequests, accountDeletionRequestsRepository, addPermissionToRole, admitsForRenewal, appleProvider, assertAuthorizationServerIssuer, assertCanAssignRole, assertKeyMatchesAlgorithm, assertPasskeyConfig, authJobRouter, authLogger, authMetadata, authMetadataRepository, authSchema, authenticateForRenewal, cancelAccountDeletionService, cancelInvitation, checkUsernameAvailableService, configureAuth, configureAuthorizationServer, configureDeletion, configureDeviceAuth, configureOAuthTokenCipher, consumeRevokeAllLink, createAuthDeletionJobRouter, createAuthDeletionPurgeJob, createAuthJobRouter, createAuthLifecycle, createInvitation, createOAuthState, createRevokeAllLink, createRevokeAllTokenPurgeJob, createRole, decodeToken, decryptToken, deleteInvitation, deleteRole, deriveCsrfToken, describeRevokeAllLink, deviceAuthorizations, deviceAuthorizationsRepository, encryptToken, exchangeCodeForTokens, expireOldInvitations, formatUserCode, generateAccessToken, generateAuthorizationCode, generateDeviceCode, generateOAuthNonce, generateRefreshToken, generateToken, generateUserCode, getAllRoles, getAuth, getAuthConfig, getAuthSessionService, getAuthorizationServerConfig, getBoundKeyRenewGraceMs, getBoundKeyTtlMs, getConcurrentUseWindowMs, getCsrfExemptPaths, getCsrfMode, getDeletionConfig, getDeviceAuthConfig, getDummyPasswordHash, getEncryptionKeyring, getGoogleAuthUrl, getGoogleOAuthConfig, getGoogleUserInfo, getInvitationByToken, getInvitationWithDetails, getKeyId, getLocale, getMfaConfig, getOneTimeTokenManager, getOpsToken, getOptionalAuth, getPasskeyConfig, getPendingDeletionInfo, getRole, getRoleByName, getRolePermissions, getSessionRenewPath, getSessionTtl, getUser, getUserByEmailService, getUserByIdService, getUserByPhoneService, getUserId, getUserPermissions, getUserProfileService, getUserRole, githubProvider, googleProvider, hasAllPermissions, hasAnyPermission, hasAnyRole, hasPermission, hasRole, hashDeviceCode, hashOAuth2Secret, hashPassword, initOneTimeTokenManager, initializeAuth, invitationsRepository, isAccessTokenShaped, isEncrypted, isGoogleOAuthEnabled, isLoopbackHostname, isOpsToken, isPkceS256ChallengeShaped, isPkceVerifierShaped, issueOpsTokenService, kakaoProvider, keyRevokeAllTokens, keyRevokeAllTokensRepository, keysRepository, linkMailJob, listInvitations, listOpsTokensService, matchOAuthCsrfCookies, matchesCsrfToken, matchesRegisteredRedirectUri, mfaEnrolmentRepository, mfaRecoveryCodes, mfaRecoveryCodesRepository, mfaTotp, mfaTotpRepository, mfaVerificationsRepository, naverProvider, normalizeEmail, normalizeOptionalEmail, normalizeResource, normalizeStoredEmails, normalizeUserCode, oauth2AuthorizationCodes, oauth2AuthorizationCodesRepository, oauth2Clients, oauth2ClientsRepository, oauth2Grants, oauth2GrantsRepository, oauth2TokenService, oauth2Tokens, oauth2TokensRepository, oneTimeTokenAuth, opsOrUser, opsTokenAuth, opsTokens, opsTokensRepository, parseDuration, passkeysRepository, passwordResetTokens, passwordResetTokensRepository, permissions, permissionsRepository, pkceChallengeFor, purgeRevokeAllTokensService, purgeStaleOAuth2ClientsService, purgeUserService, redirectHostOf, refreshAccessToken, refuseRedirectUriRegistration, registerOAuth2ClientService, removePermissionFromRole, requestAccountDeletionService, requireAnyPermission, requireOpsScope, requirePermissions, requireRole, resendInvitation, resolveIssuerSource, revokeOAuth2TokenService, revokeOpsTokenService, roleGuard, rolePermissions, rolePermissionsRepository, roles, rolesRepository, runBeforeRegister, sameOAuth2Hash, sameResource, secondsUntil, setRolePermissions, signupLinkTokens, signupLinkTokensRepository, socialAccountsRepository, sweepDuePurges, toEpochSeconds, updateLastLoginService, updateLocaleService, updateRole, updateUserProfileService, updateUserService, updateUsernameService, userInvitations, userPermissions, userPermissionsRepository, userProfiles, userProfilesRepository, userSocialAccounts, users, usersRepository, validateInvitation, validatePasswordStrength, verificationCodes, verificationCodesRepository, verifyAccessToken, verifyClientToken, verifyIdToken, verifyKeyFingerprint, verifyOAuthState, verifyOpsTokenService, verifyPassword, verifyToken, webauthnChallenges, webauthnChallengesRepository };
|
|
11097
|
+
export { AUTHORIZE_PATH, type AccountDeletionPurgeUser, type AccountDeletionRequest, AccountDeletionRequestedBy, AccountDeletionRequestsRepository, type AuthConfig, AuthContext, type AuthCsrfConfig, type AuthDeletionConfig, type AuthDeviceAuthConfig, type AuthLifecycleConfig, type AuthLifecycleOptions, type AuthMetadataEntity, AuthMetadataRepository, type AuthorizationServerConfig, type AuthorizationServerOptions, type BeforeRegisterContext, COOKIE_NAMES, CSRF_HEADER, type CancelAccountDeletionParams, type CancelAccountDeletionResult, type CreateOAuthStateParams, type CreateRevokeAllLinkOptions, type CsrfMode, DEFAULT_ACCESS_TOKEN_TTL_MS, DEFAULT_CODE_TTL_MS, DEFAULT_DELETION_ALLOW_SELF_IMMEDIATE, DEFAULT_DELETION_GRACE_PERIOD_DAYS, DEFAULT_DELETION_PURGE_CRON, DEFAULT_DELETION_PURGE_STRATEGY, DEFAULT_DELETION_SEND_NOTIFICATIONS, DEFAULT_DEVICE_AUTH_INTERVAL_MS, DEFAULT_DEVICE_AUTH_TTL_MS, DEFAULT_REFRESH_TOKEN_TTL_MS, DEFAULT_REVOKE_ALL_TOKEN_PURGE_CRON, DEVICE_AUTH_STATUSES, type DecryptedOAuthToken, type DeviceAuthStatus, type DeviceAuthorization, DeviceAuthorizationsRepository, type EmailNormalizationResult, EnvironmentKeyringTokenCipher, type GoogleTokenResponse, type GoogleUserInfo, type Invitation, InvitationStatus, InvitationsRepository, type IssuedOpsToken, KeyAlgorithmType, type KeyRevokeAllToken, KeyRevokeAllTokensRepository, KeysRepository, type LiveRevokeAllLink, MAX_UNGRANTED_CLIENTS_PER_IP, MFA_CONFIRM_ATTEMPT_LIMIT, MfaChallenge, MfaChallengesRepository, type MfaConfig, MfaEnrolmentRepository, type MfaRecoveryCode, MfaRecoveryCodesRepository, type MfaTotp, MfaTotpRepository, MfaVerification, MfaVerificationMethod, MfaVerificationsRepository, type NewAccountDeletionRequest, type NewAuthMetadataEntity, type NewDeviceAuthorization, type NewInvitation, type NewKeyRevokeAllToken, NewMfaChallenge, type NewMfaRecoveryCode, type NewMfaTotp, type NewOAuth2AuthorizationCode, type NewOAuth2Client, type NewOAuth2Grant, type NewOAuth2Token, type NewOpsToken, NewPasskey, type NewPasswordResetToken, type NewPermission, type NewPermissionEntity, type NewRole, type NewRoleEntity, type NewRolePermission, type NewSignupLinkToken, type NewUser, type NewUserPermission, type NewUserProfile, NewUserPublicKey, type NewUserSocialAccount, type NewVerificationCode, type NewWebAuthnChallenge, OAUTH2_ACCESS_TOKEN_PREFIX, OAUTH2_REFRESH_TOKEN_PREFIX, OAUTH2_TOKEN_KINDS, type OAuth2AuthorizationCode, OAuth2AuthorizationCodesRepository, type OAuth2Client, OAuth2ClientsRepository, type OAuth2Grant, type OAuth2GrantWithClient, OAuth2GrantsRepository, type OAuth2RegisterRefusal, type OAuth2RegisterRequest, type OAuth2RegisterResult, type OAuth2RegisteredClient, type OAuth2Token, type OAuth2TokenKind, type OAuth2TokenRefusal, type OAuth2TokenRequest, type OAuth2TokenResponse, type OAuth2TokenResult, OAuth2TokensRepository, OAuthProvider, type OAuthState, type OAuthTokenCipher, type OAuthTokenContext, type OAuthTokenType, OPS_TOKEN_PREFIX, type OpsOrUserConfig, type OpsToken, OpsTokensRepository, Passkey, type PasskeyConfig, type PasskeyUserVerification, PasskeysRepository, type PasswordResetToken, PasswordResetTokensRepository, type PendingDeletionInfo, type Permission, type PermissionEntity, PermissionsRepository, PurgeStrategy, type PurgeUserResult, type RedirectUriRefusal, type RegisterChannel, type RequestAccountDeletionParams, type RequestAccountDeletionResult, type RevokeAllLink, type RevokeAllLinkDescription, type RevokedKey, type Role, type RoleEntity, type RoleGuardOptions, type RolePermission, RolePermissionsRepository, RolesRepository, STALE_CLIENT_MAX_AGE_MS, SUPPORTED_GRANT_TYPES, SUPPORTED_RESPONSE_TYPES, type SessionPayload, type SignupLinkToken, SignupLinkTokensRepository, SocialAccountsRepository, SocialProvider, type SweepDuePurgesResult, type TokenEncryptionKey, type TokenPayload, USER_CODE_ALPHABET, USER_CODE_LENGTH, type UpdateProfileParams, type User, type UserPermission, UserPermissionsRepository, type UserProfile, UserProfilesRepository, UserPublicKey, type UserSocialAccount, UsersRepository, V2_PREFIX, type VerificationCode, VerificationCodesRepository, VerificationPurpose, type VerifiedOAuth2AccessToken, type VerifiedOpsToken, type VerifyIdTokenParams, WEBAUTHN_CHALLENGE_KINDS, type WebAuthnChallenge, type WebAuthnChallengeKind, WebAuthnChallengesRepository, acceptInvitation, accountDeletionRequests, accountDeletionRequestsRepository, addPermissionToRole, admitsForRenewal, appleProvider, assertAuthorizationServerIssuer, assertCanAssignRole, assertKeyMatchesAlgorithm, assertPasskeyConfig, authJobRouter, authLogger, authMetadata, authMetadataRepository, authSchema, authenticateForRenewal, cancelAccountDeletionService, cancelInvitation, checkUsernameAvailableService, configureAuth, configureAuthorizationServer, configureDeletion, configureDeviceAuth, configureOAuthTokenCipher, consumeRevokeAllLink, createAuthDeletionJobRouter, createAuthDeletionPurgeJob, createAuthJobRouter, createAuthLifecycle, createInvitation, createOAuthState, createRevokeAllLink, createRevokeAllTokenPurgeJob, createRole, decodeToken, decryptToken, deleteInvitation, deleteRole, deriveCsrfToken, describeRevokeAllLink, deviceAuthorizations, deviceAuthorizationsRepository, encryptToken, exchangeCodeForTokens, expireOldInvitations, formatUserCode, generateAccessToken, generateAuthorizationCode, generateDeviceCode, generateOAuthNonce, generateRefreshToken, generateToken, generateUserCode, getAllRoles, getAuth, getAuthConfig, getAuthSessionService, getAuthorizationServerConfig, getBoundKeyRenewGraceMs, getBoundKeyTtlMs, getConcurrentUseWindowMs, getCsrfExemptPaths, getCsrfMode, getDeletionConfig, getDeviceAuthConfig, getDummyPasswordHash, getEncryptionKeyring, getGoogleAuthUrl, getGoogleOAuthConfig, getGoogleUserInfo, getInvitationByToken, getInvitationWithDetails, getKeyId, getLocale, getMfaConfig, getOneTimeTokenManager, getOpsToken, getOptionalAuth, getPasskeyConfig, getPendingDeletionInfo, getRole, getRoleByName, getRolePermissions, getSessionRenewPath, getSessionTtl, getUser, getUserByEmailService, getUserByIdService, getUserByPhoneService, getUserId, getUserPermissions, getUserProfileService, getUserRole, githubProvider, googleProvider, hasAllPermissions, hasAnyPermission, hasAnyRole, hasPermission, hasRole, hashDeviceCode, hashOAuth2Secret, hashPassword, initOneTimeTokenManager, initializeAuth, invitationsRepository, isAccessTokenShaped, isEncrypted, isGoogleOAuthEnabled, isLoopbackHostname, isOpsToken, isPkceS256ChallengeShaped, isPkceVerifierShaped, issueOpsTokenService, kakaoProvider, keyRevokeAllTokens, keyRevokeAllTokensRepository, keysRepository, linkMailJob, listInvitations, listOpsTokensService, matchOAuthCsrfCookies, matchesCsrfToken, matchesRegisteredRedirectUri, mfaChallengesRepository, mfaEnrolmentRepository, mfaRecoveryCodes, mfaRecoveryCodesRepository, mfaTotp, mfaTotpRepository, mfaVerificationsRepository, naverProvider, normalizeEmail, normalizeOptionalEmail, normalizeResource, normalizeStoredEmails, normalizeUserCode, oauth2AuthorizationCodes, oauth2AuthorizationCodesRepository, oauth2Clients, oauth2ClientsRepository, oauth2Grants, oauth2GrantsRepository, oauth2TokenService, oauth2Tokens, oauth2TokensRepository, oneTimeTokenAuth, opsOrUser, opsTokenAuth, opsTokens, opsTokensRepository, parseDuration, passkeysRepository, passwordResetTokens, passwordResetTokensRepository, permissions, permissionsRepository, pkceChallengeFor, purgeRevokeAllTokensService, purgeStaleOAuth2ClientsService, purgeUserService, redirectHostOf, refreshAccessToken, refuseRedirectUriRegistration, registerOAuth2ClientService, removePermissionFromRole, requestAccountDeletionService, requireAnyPermission, requireOpsScope, requirePermissions, requireRole, resendInvitation, resolveIssuerSource, revokeOAuth2TokenService, revokeOpsTokenService, roleGuard, rolePermissions, rolePermissionsRepository, roles, rolesRepository, runBeforeRegister, sameOAuth2Hash, sameResource, secondsUntil, setRolePermissions, signupLinkTokens, signupLinkTokensRepository, socialAccountsRepository, sweepDuePurges, toEpochSeconds, updateLastLoginService, updateLocaleService, updateRole, updateUserProfileService, updateUserService, updateUsernameService, userInvitations, userPermissions, userPermissionsRepository, userProfiles, userProfilesRepository, userSocialAccounts, users, usersRepository, validateInvitation, validatePasswordStrength, verificationCodes, verificationCodesRepository, verifyAccessToken, verifyClientToken, verifyIdToken, verifyKeyFingerprint, verifyOAuthState, verifyOpsTokenService, verifyPassword, verifyToken, webauthnChallenges, webauthnChallengesRepository };
|