@spfn/auth 0.3.0-beta.23 → 0.3.0-beta.24
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 +165 -2
- package/dist/client-proof.js +13 -5
- package/dist/client-proof.js.map +1 -1
- package/dist/client.d.ts +52 -1
- package/dist/client.js +40 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +82 -0
- package/dist/config.js +37 -0
- package/dist/config.js.map +1 -1
- package/dist/crypto.d.ts +1 -1
- package/dist/errors.d.ts +113 -3
- package/dist/errors.js +68 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +38 -5
- package/dist/index.js +73 -2
- package/dist/index.js.map +1 -1
- package/dist/{machine-principals-CaEFq61K.d.ts → machine-principals-ZJd9anVT.d.ts} +1667 -900
- package/dist/nextjs/api.js +156 -6
- package/dist/nextjs/api.js.map +1 -1
- package/dist/nextjs/server.d.ts +42 -24
- package/dist/nextjs/server.js +72 -5
- package/dist/nextjs/server.js.map +1 -1
- package/dist/server.d.ts +448 -525
- package/dist/server.js +1389 -653
- package/dist/server.js.map +1 -1
- package/dist/{session-Dfwu5g2W.d.ts → session-BbhAGZtA.d.ts} +57 -1
- package/dist/{types-DYyhze28.d.ts → types-CTdoTOxM.d.ts} +24 -1
- package/migrations/20260918184037_happy_mordo/migration.sql +4 -0
- package/migrations/20260918184037_happy_mordo/snapshot.json +6000 -0
- package/migrations/20260918184152_dear_rictor/migration.sql +3 -0
- package/migrations/20260918184152_dear_rictor/snapshot.json +6039 -0
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AuthInitOptions,
|
|
2
|
-
export {
|
|
1
|
+
import { A as AuthInitOptions, y as OAuthProvider, N as NewUserPublicKey, w as VerificationPurpose, z as NewPasskey, B as Passkey, E as MfaVerification, G as MfaVerificationMethod, u as PermissionCategory, H as UserPublicKey, J as AuthContext } from './machine-principals-ZJd9anVT.js';
|
|
2
|
+
export { Q as ApproveDeviceAuthParams, W as AssertStepUpParams, X as AuthDeletionCancelledPayload, Y as AuthDeletionCompletedPayload, Z as AuthDeletionRequestedPayload, _ as AuthDeviceRegisteredPayload, $ as AuthLoginPayload, a0 as AuthPasswordResetPayload, a1 as AuthProfileOutcome, a2 as AuthProfileVerifier, a3 as AuthProviderSchema, a4 as AuthRegisterPayload, a5 as BearerOutcome, a6 as BearerRefusal, a7 as ChangePasswordParams, a8 as CompletePasswordResetParams, a9 as CompleteSignupParams, aa as ConfirmPasswordResetParams, d as ConfirmPasswordResetResult, ab as ConfirmSignupLinkParams, C as ConfirmSignupLinkResult, ac as ConfirmTotpParams, h as ConfirmTotpResult, ad as DenyDeviceAuthParams, ae as DeviceAuthApprovedResult, af as DeviceAuthInfoParams, D as DeviceAuthInfoResult, ag as DeviceAuthPendingResult, ah as DeviceAuthPollResponseSchema, ai as DeviceNameSchema, aj as DeviceRegistrationChannel, ak as DisableSessionBindingParams, al as EmailSchema, am as FingerprintSchema, an as FinishPasskeyEnrollmentParams, F as FinishPasskeyEnrollmentResult, ao as FinishPasskeyLoginParams, ap as FinishSessionRenewParams, aq as InvitationAcceptedPayload, ar as InvitationCreatedPayload, I as IssueOneTimeTokenResult, as as KEY_FINGERPRINT_PREFIX_LENGTH, at as KeyIdSchema, K as KeySummary, au as LoginParams, e as LoginResult, av as LogoutParams, aw as MFA_VERIFICATION_METHODS, ax as MachinePrincipal, ay as MachineVerifierRegistration, az as MarkPasskeyParams, M as MfaStatus, aA as NativeVerifyOptions, aB as NewMfaVerification, aC as NormalizedIdentity, q as OAuth2AuthorizationCodeIssued, aD as OAuth2AuthorizeParams, p as OAuth2ConsentView, r as OAuth2GrantSummary, aE as OAuth2ScopeDescription, aF as OAuthCallbackParams, aG as OAuthCallbackResult, aH as OAuthCodeExchangeOptions, aI as OAuthNativeParams, n as OAuthNativeResult, aJ as OAuthStartParams, O as OAuthStartResult, aK as OAuthTokens, aL as OAuthUnlinkedPayload, aM as PASSKEY_DEVICE_TYPES, aN as PASSKEY_LABEL_MAX_LENGTH, aO as PasskeyDeviceType, g as PasskeySummary, aP as PasswordSchema, aQ as PhoneSchema, aR as PlatformSchema, aS as PollDeviceAuthParams, aT as PollDeviceAuthResult, aU as PublicKeySchema, aV as RecentAuthenticationParams, aW as RegisterParams, aX as RegisterPublicKeyParams, a as RegisterResult, aY as RenamePasskeyParams, aZ as RequestPasswordResetParams, c as RequestPasswordResetResult, a_ as RequestSignupLinkParams, b as RequestSignupLinkResult, a$ as RevokeAllKeysParams, j as RevokeAllKeysResult, b0 as RevokeKeyParams, b1 as RevokePasskeyParams, b2 as RotateKeyParams, i as RotateKeyResult, b3 as SendVerificationCodeParams, S as SendVerificationCodeResult, b4 as SessionBindingParams, k as SessionBindingResult, b5 as StartDeviceAuthParams, f as StartDeviceAuthResult, b6 as StartPasskeyEnrollmentParams, b7 as StartSessionRenewParams, b8 as StepUpParams, b9 as TargetTypeSchema, T as TotpEnrolmentResult, ba as UnlinkNotification, bb as UnlinkNotifyRejection, bc as UnlinkNotifyRequest, bd as UnlinkNotifyResult, be as UserCodeSchema, V as VERIFICATION_PURPOSES, v as VERIFICATION_TARGET_TYPES, bf as VerificationPurposeSchema, x as VerificationTargetType, bg as VerifyCodeParams, bh as VerifyCodeResult, bi as admitBearerKey, bj as approveDeviceAuthService, bk as approveOAuth2AuthorizeService, bl as assertNotLastRecoveryCredential, bm as assertRecentAuthentication, bn as assertStepUp, bo as authDeletionCancelledEvent, bp as authDeletionCompletedEvent, bq as authDeletionRequestedEvent, br as authDeviceRegisteredEvent, bs as authLoginEvent, bt as authPasswordResetEvent, bu as authRegisterEvent, m as authRouter, bv as authenticate, bw as bearerAuthContext, bx as buildOAuthErrorUrl, by as carryStepUpVerification, bz as changePasswordService, bA as completePasswordResetService, bB as completeSignupService, bC as confirmPasswordResetService, bD as confirmSignupLinkService, bE as confirmTotpEnrolmentService, bF as denyDeviceAuthService, bG as denyOAuth2AuthorizeService, bH as describeOAuth2AuthorizeRequestService, bI as disableMfaService, bJ as disableSessionBindingService, bK as enableSessionBindingService, bL as finishPasskeyEnrollmentService, bM as finishPasskeyLoginService, bN as finishSessionRenewService, bO as getDeviceAuthInfoService, bP as getEnabledOAuthProviders, bQ as getGoogleAccessToken, bR as getMachinePrincipal, bS as getOAuthProvider, bT as getRegisteredProviders, bU as getSessionBindingService, bV as invitationAcceptedEvent, bW as invitationCreatedEvent, bX as isOAuthProviderEnabled, bY as issueOneTimeTokenService, bZ as keySessionBindingService, b_ as listKeysService, b$ as listOAuth2GrantsService, c0 as listPasskeysService, c1 as loginService, c2 as logoutService, c3 as machineAuth, c4 as markPasskeySecondFactorService, c5 as mfaEnrolledForUser, c6 as mfaStatusService, c7 as mfaVerifications, c8 as oauthCallbackService, c9 as oauthNativeService, ca as oauthStartService, cb as oauthUnlinkNotifyService, cc as oauthUnlinkedEvent, cd as optionalAuth, ce as passkeys, cf as pollDeviceAuthService, cg as regenerateRecoveryCodesService, ch as registerAuthProfile, ci as registerMachineVerifier, cj as registerOAuthProvider, ck as registerPublicKeyService, cl as registerService, cm as renamePasskeyService, cn as requestPasswordResetService, co as requestSignupLinkService, cp as requireEnabledProvider, cq as requireMachineScope, cr as resolveAuthenticatedUser, cs as revokeAllKeysService, ct as revokeAllOAuth2GrantsForUser, cu as revokeKeyService, cv as revokeOAuth2GrantService, cw as revokePasskeyService, cx as rotateKeyService, cy as runAuthProfile, cz as selectAuthProfile, cA as sendVerificationCodeService, cB as startDeviceAuthService, cC as startPasskeyEnrollmentService, cD as startPasskeyLoginService, cE as startSessionBindingDisableService, cF as startSessionRenewService, cG as startStepUpService, cH as startTotpEnrolmentService, cI as stepUpService, cJ as sweepUnconfirmedMfaService, cK as userPublicKeys, cL as verifyCodeService, cM as verifyOneTimeTokenService, cN as verifySecondFactor } from './machine-principals-ZJd9anVT.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
|
-
import {
|
|
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,
|
|
4
|
+
import { l as SocialProvider, K as KeyAlgorithmType, d as InvitationStatus, c as AccountDeletionRequestedBy, i as PurgeStrategy } from './types-CTdoTOxM.js';
|
|
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';
|
|
6
6
|
import { UserProfile as UserProfile$1, ProfileInfo } from '@spfn/auth';
|
|
7
7
|
import { BaseRepository } from '@spfn/core/db';
|
|
8
8
|
import { c as ClientIdentity } from './wire-version-CtzMKvBB.js';
|
|
@@ -10,7 +10,7 @@ import { Context } from 'hono';
|
|
|
10
10
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
11
11
|
import { NamedMiddleware } from '@spfn/core/route';
|
|
12
12
|
export { KeyPair, generateClientToken, generateKeyPair, generateKeyPairES256, generateKeyPairRS256, getKeySize, shouldRotateKey } from './crypto.js';
|
|
13
|
-
export { S as SessionData, g as getSessionInfo, i as isSafeReturnPath, s as sealSession, a as shouldRefreshSession, u as unsealSession } from './session-
|
|
13
|
+
export { S as SessionData, g as getSessionInfo, i as isSafeReturnPath, s as sealSession, a as shouldRefreshSession, u as unsealSession } from './session-BbhAGZtA.js';
|
|
14
14
|
import { JWTPayload } from 'jose';
|
|
15
15
|
import { SSETokenManager, SSETokenStore } from '@spfn/core/event/sse';
|
|
16
16
|
import * as _spfn_core_logger from '@spfn/core/logger';
|
|
@@ -21,95 +21,6 @@ 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
|
-
|
|
113
24
|
/**
|
|
114
25
|
* @spfn/auth - Global Configuration
|
|
115
26
|
*
|
|
@@ -341,6 +252,27 @@ declare function getCsrfMode(): CsrfMode;
|
|
|
341
252
|
* Get the paths exempted from the CSRF check (exact match, backend route paths)
|
|
342
253
|
*/
|
|
343
254
|
declare function getCsrfExemptPaths(): string[];
|
|
255
|
+
/**
|
|
256
|
+
* How long a key bound to a passkey lives, in milliseconds.
|
|
257
|
+
*
|
|
258
|
+
* A positive override is honoured; anything else falls back to the policy
|
|
259
|
+
* constant. Nothing refuses boot over it — unlike the passkey relying party, a
|
|
260
|
+
* nonsensical value here does not make every ceremony fail, it just means the
|
|
261
|
+
* default applies.
|
|
262
|
+
*/
|
|
263
|
+
declare function getBoundKeyTtlMs(): number;
|
|
264
|
+
/** How long past expiry a bound key may still be renewed, in milliseconds. */
|
|
265
|
+
declare function getBoundKeyRenewGraceMs(): number;
|
|
266
|
+
/** How close two sightings from two addresses must be to count as concurrent. */
|
|
267
|
+
declare function getConcurrentUseWindowMs(): number;
|
|
268
|
+
/**
|
|
269
|
+
* The page a bound session whose key expired is sent to.
|
|
270
|
+
*
|
|
271
|
+
* `RequireAuth` redirects here instead of to the sign-in page; the app renders a
|
|
272
|
+
* client component there that calls `renewSession(api)` and returns the person to
|
|
273
|
+
* where they were.
|
|
274
|
+
*/
|
|
275
|
+
declare function getSessionRenewPath(): string;
|
|
344
276
|
/**
|
|
345
277
|
* The relying party this deployment presents to authenticators, resolved.
|
|
346
278
|
*
|
|
@@ -421,6 +353,95 @@ interface MfaConfig {
|
|
|
421
353
|
*/
|
|
422
354
|
declare function getMfaConfig(): MfaConfig;
|
|
423
355
|
|
|
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
|
+
|
|
424
445
|
/**
|
|
425
446
|
* @spfn/auth - Users Entity
|
|
426
447
|
*
|
|
@@ -678,6 +699,36 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
678
699
|
identity: undefined;
|
|
679
700
|
generated: undefined;
|
|
680
701
|
}>;
|
|
702
|
+
sessionBinding: drizzle_orm_pg_core.PgBuildColumn<"users", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgTextBuilder<["none", "passkey"] & [string, ...string[]]>>>, {
|
|
703
|
+
name: string;
|
|
704
|
+
tableName: "users";
|
|
705
|
+
dataType: "string enum";
|
|
706
|
+
data: "none" | "passkey";
|
|
707
|
+
driverParam: string;
|
|
708
|
+
notNull: true;
|
|
709
|
+
hasDefault: true;
|
|
710
|
+
isPrimaryKey: false;
|
|
711
|
+
isAutoincrement: false;
|
|
712
|
+
hasRuntimeDefault: false;
|
|
713
|
+
enumValues: ["none", "passkey"] & [string, ...string[]];
|
|
714
|
+
identity: undefined;
|
|
715
|
+
generated: undefined;
|
|
716
|
+
}>;
|
|
717
|
+
sessionBindingChangedAt: drizzle_orm_pg_core.PgBuildColumn<"users", drizzle_orm_pg_core.PgTimestampBuilder, {
|
|
718
|
+
name: string;
|
|
719
|
+
tableName: "users";
|
|
720
|
+
dataType: "object date";
|
|
721
|
+
data: Date;
|
|
722
|
+
driverParam: string;
|
|
723
|
+
notNull: false;
|
|
724
|
+
hasDefault: false;
|
|
725
|
+
isPrimaryKey: false;
|
|
726
|
+
isAutoincrement: false;
|
|
727
|
+
hasRuntimeDefault: false;
|
|
728
|
+
enumValues: undefined;
|
|
729
|
+
identity: undefined;
|
|
730
|
+
generated: undefined;
|
|
731
|
+
}>;
|
|
681
732
|
lastLoginAt: drizzle_orm_pg_core.PgBuildColumn<"users", drizzle_orm_pg_core.PgTimestampBuilder, {
|
|
682
733
|
name: string;
|
|
683
734
|
tableName: "users";
|
|
@@ -725,6 +776,8 @@ declare function getUserByIdService(userId: number): Promise<{
|
|
|
725
776
|
emailVerifiedAt: Date | null;
|
|
726
777
|
phoneVerifiedAt: Date | null;
|
|
727
778
|
keyEpoch: number;
|
|
779
|
+
sessionBinding: "none" | "passkey";
|
|
780
|
+
sessionBindingChangedAt: Date | null;
|
|
728
781
|
lastLoginAt: Date | null;
|
|
729
782
|
}>;
|
|
730
783
|
/**
|
|
@@ -747,6 +800,8 @@ declare function getUserByEmailService(email: string): Promise<{
|
|
|
747
800
|
emailVerifiedAt: Date | null;
|
|
748
801
|
phoneVerifiedAt: Date | null;
|
|
749
802
|
keyEpoch: number;
|
|
803
|
+
sessionBinding: "none" | "passkey";
|
|
804
|
+
sessionBindingChangedAt: Date | null;
|
|
750
805
|
lastLoginAt: Date | null;
|
|
751
806
|
}>;
|
|
752
807
|
/**
|
|
@@ -769,6 +824,8 @@ declare function getUserByPhoneService(phone: string): Promise<{
|
|
|
769
824
|
emailVerifiedAt: Date | null;
|
|
770
825
|
phoneVerifiedAt: Date | null;
|
|
771
826
|
keyEpoch: number;
|
|
827
|
+
sessionBinding: "none" | "passkey";
|
|
828
|
+
sessionBindingChangedAt: Date | null;
|
|
772
829
|
lastLoginAt: Date | null;
|
|
773
830
|
}>;
|
|
774
831
|
/**
|
|
@@ -810,6 +867,8 @@ declare function updateUsernameService(userId: string | number | bigint, usernam
|
|
|
810
867
|
emailVerifiedAt: Date | null;
|
|
811
868
|
phoneVerifiedAt: Date | null;
|
|
812
869
|
keyEpoch: number;
|
|
870
|
+
sessionBinding: "none" | "passkey";
|
|
871
|
+
sessionBindingChangedAt: Date | null;
|
|
813
872
|
lastLoginAt: Date | null;
|
|
814
873
|
}>;
|
|
815
874
|
|
|
@@ -2839,282 +2898,57 @@ declare function revokeOAuth2TokenService(token: string, clientId: string): Prom
|
|
|
2839
2898
|
interface VerifiedOAuth2AccessToken {
|
|
2840
2899
|
/** The public `client_id` of the CLI holding the token. */
|
|
2841
2900
|
clientId: string;
|
|
2842
|
-
/** Scope names, as granted or as the refresh that minted it narrowed them to. */
|
|
2843
|
-
scopes: string[];
|
|
2844
|
-
/** Expiry as seconds since the epoch — the unit every OAuth field uses. */
|
|
2845
|
-
expiresAt: number;
|
|
2846
|
-
/** The account the CLI is acting for. */
|
|
2847
|
-
userId: string;
|
|
2848
|
-
}
|
|
2849
|
-
/**
|
|
2850
|
-
* Verify a bearer token presented to a protected resource.
|
|
2851
|
-
*
|
|
2852
|
-
* @param token - The raw bearer value
|
|
2853
|
-
* @param resource - The resource being accessed, e.g. `https://api.example.com/mcp`
|
|
2854
|
-
* @returns the principal, or null for any reason at all
|
|
2855
|
-
*/
|
|
2856
|
-
declare function verifyAccessToken(token: string, resource: string): Promise<VerifiedOAuth2AccessToken | null>;
|
|
2857
|
-
|
|
2858
|
-
/**
|
|
2859
|
-
* @spfn/auth - Database Schema Definition
|
|
2860
|
-
*
|
|
2861
|
-
* Defines the 'spfn_auth' PostgreSQL schema for all auth-related tables
|
|
2862
|
-
*/
|
|
2863
|
-
/**
|
|
2864
|
-
* Auth schema for all authentication and authorization tables
|
|
2865
|
-
* Tables: users, roles, permissions, user_invitations, etc.
|
|
2866
|
-
*/
|
|
2867
|
-
declare const authSchema: drizzle_orm_pg_core.PgSchema<string>;
|
|
2868
|
-
|
|
2869
|
-
/**
|
|
2870
|
-
* @spfn/auth - User Profiles Entity
|
|
2871
|
-
*
|
|
2872
|
-
* User profile information (separate from authentication data)
|
|
2873
|
-
*
|
|
2874
|
-
* Features:
|
|
2875
|
-
* - Display name and personal information
|
|
2876
|
-
* - Avatar and bio
|
|
2877
|
-
* - Locale and timezone preferences
|
|
2878
|
-
* - Optional demographic data
|
|
2879
|
-
* - Social links and professional info
|
|
2880
|
-
*/
|
|
2881
|
-
declare const userProfiles: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2882
|
-
name: "user_profiles";
|
|
2883
|
-
schema: string;
|
|
2884
|
-
columns: {
|
|
2885
|
-
createdAt: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTimestampBuilder>>, {
|
|
2886
|
-
name: string;
|
|
2887
|
-
tableName: "user_profiles";
|
|
2888
|
-
dataType: "object date";
|
|
2889
|
-
data: Date;
|
|
2890
|
-
driverParam: string;
|
|
2891
|
-
notNull: true;
|
|
2892
|
-
hasDefault: true;
|
|
2893
|
-
isPrimaryKey: false;
|
|
2894
|
-
isAutoincrement: false;
|
|
2895
|
-
hasRuntimeDefault: false;
|
|
2896
|
-
enumValues: undefined;
|
|
2897
|
-
identity: undefined;
|
|
2898
|
-
generated: undefined;
|
|
2899
|
-
}>;
|
|
2900
|
-
updatedAt: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTimestampBuilder>>>, {
|
|
2901
|
-
name: string;
|
|
2902
|
-
tableName: "user_profiles";
|
|
2903
|
-
dataType: "object date";
|
|
2904
|
-
data: Date;
|
|
2905
|
-
driverParam: string;
|
|
2906
|
-
notNull: true;
|
|
2907
|
-
hasDefault: true;
|
|
2908
|
-
isPrimaryKey: false;
|
|
2909
|
-
isAutoincrement: false;
|
|
2910
|
-
hasRuntimeDefault: false;
|
|
2911
|
-
enumValues: undefined;
|
|
2912
|
-
identity: undefined;
|
|
2913
|
-
generated: undefined;
|
|
2914
|
-
}>;
|
|
2915
|
-
id: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetIsPrimaryKey<drizzle_orm_pg_core.PgBigSerial53Builder>, {
|
|
2916
|
-
name: string;
|
|
2917
|
-
tableName: "user_profiles";
|
|
2918
|
-
dataType: "number int53";
|
|
2919
|
-
data: number;
|
|
2920
|
-
driverParam: number;
|
|
2921
|
-
notNull: true;
|
|
2922
|
-
hasDefault: true;
|
|
2923
|
-
isPrimaryKey: false;
|
|
2924
|
-
isAutoincrement: false;
|
|
2925
|
-
hasRuntimeDefault: false;
|
|
2926
|
-
enumValues: undefined;
|
|
2927
|
-
identity: undefined;
|
|
2928
|
-
generated: undefined;
|
|
2929
|
-
}>;
|
|
2930
|
-
userId: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgBigInt53Builder>, {
|
|
2931
|
-
name: string;
|
|
2932
|
-
tableName: "user_profiles";
|
|
2933
|
-
dataType: "number int53";
|
|
2934
|
-
data: number;
|
|
2935
|
-
driverParam: string | number;
|
|
2936
|
-
notNull: true;
|
|
2937
|
-
hasDefault: false;
|
|
2938
|
-
isPrimaryKey: false;
|
|
2939
|
-
isAutoincrement: false;
|
|
2940
|
-
hasRuntimeDefault: false;
|
|
2941
|
-
enumValues: undefined;
|
|
2942
|
-
identity: undefined;
|
|
2943
|
-
generated: undefined;
|
|
2944
|
-
}>;
|
|
2945
|
-
displayName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
2946
|
-
name: string;
|
|
2947
|
-
tableName: "user_profiles";
|
|
2948
|
-
dataType: "string";
|
|
2949
|
-
data: string;
|
|
2950
|
-
driverParam: string;
|
|
2951
|
-
notNull: false;
|
|
2952
|
-
hasDefault: false;
|
|
2953
|
-
isPrimaryKey: false;
|
|
2954
|
-
isAutoincrement: false;
|
|
2955
|
-
hasRuntimeDefault: false;
|
|
2956
|
-
enumValues: undefined;
|
|
2957
|
-
identity: undefined;
|
|
2958
|
-
generated: undefined;
|
|
2959
|
-
}>;
|
|
2960
|
-
firstName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
2961
|
-
name: string;
|
|
2962
|
-
tableName: "user_profiles";
|
|
2963
|
-
dataType: "string";
|
|
2964
|
-
data: string;
|
|
2965
|
-
driverParam: string;
|
|
2966
|
-
notNull: false;
|
|
2967
|
-
hasDefault: false;
|
|
2968
|
-
isPrimaryKey: false;
|
|
2969
|
-
isAutoincrement: false;
|
|
2970
|
-
hasRuntimeDefault: false;
|
|
2971
|
-
enumValues: undefined;
|
|
2972
|
-
identity: undefined;
|
|
2973
|
-
generated: undefined;
|
|
2974
|
-
}>;
|
|
2975
|
-
lastName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
2976
|
-
name: string;
|
|
2977
|
-
tableName: "user_profiles";
|
|
2978
|
-
dataType: "string";
|
|
2979
|
-
data: string;
|
|
2980
|
-
driverParam: string;
|
|
2981
|
-
notNull: false;
|
|
2982
|
-
hasDefault: false;
|
|
2983
|
-
isPrimaryKey: false;
|
|
2984
|
-
isAutoincrement: false;
|
|
2985
|
-
hasRuntimeDefault: false;
|
|
2986
|
-
enumValues: undefined;
|
|
2987
|
-
identity: undefined;
|
|
2988
|
-
generated: undefined;
|
|
2989
|
-
}>;
|
|
2990
|
-
avatarUrl: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
2991
|
-
name: string;
|
|
2992
|
-
tableName: "user_profiles";
|
|
2993
|
-
dataType: "string";
|
|
2994
|
-
data: string;
|
|
2995
|
-
driverParam: string;
|
|
2996
|
-
notNull: false;
|
|
2997
|
-
hasDefault: false;
|
|
2998
|
-
isPrimaryKey: false;
|
|
2999
|
-
isAutoincrement: false;
|
|
3000
|
-
hasRuntimeDefault: false;
|
|
3001
|
-
enumValues: undefined;
|
|
3002
|
-
identity: undefined;
|
|
3003
|
-
generated: undefined;
|
|
3004
|
-
}>;
|
|
3005
|
-
bio: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3006
|
-
name: string;
|
|
3007
|
-
tableName: "user_profiles";
|
|
3008
|
-
dataType: "string";
|
|
3009
|
-
data: string;
|
|
3010
|
-
driverParam: string;
|
|
3011
|
-
notNull: false;
|
|
3012
|
-
hasDefault: false;
|
|
3013
|
-
isPrimaryKey: false;
|
|
3014
|
-
isAutoincrement: false;
|
|
3015
|
-
hasRuntimeDefault: false;
|
|
3016
|
-
enumValues: undefined;
|
|
3017
|
-
identity: undefined;
|
|
3018
|
-
generated: undefined;
|
|
3019
|
-
}>;
|
|
3020
|
-
locale: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>>, {
|
|
3021
|
-
name: string;
|
|
3022
|
-
tableName: "user_profiles";
|
|
3023
|
-
dataType: "string";
|
|
3024
|
-
data: string;
|
|
3025
|
-
driverParam: string;
|
|
3026
|
-
notNull: false;
|
|
3027
|
-
hasDefault: true;
|
|
3028
|
-
isPrimaryKey: false;
|
|
3029
|
-
isAutoincrement: false;
|
|
3030
|
-
hasRuntimeDefault: false;
|
|
3031
|
-
enumValues: undefined;
|
|
3032
|
-
identity: undefined;
|
|
3033
|
-
generated: undefined;
|
|
3034
|
-
}>;
|
|
3035
|
-
timezone: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>>, {
|
|
3036
|
-
name: string;
|
|
3037
|
-
tableName: "user_profiles";
|
|
3038
|
-
dataType: "string";
|
|
3039
|
-
data: string;
|
|
3040
|
-
driverParam: string;
|
|
3041
|
-
notNull: false;
|
|
3042
|
-
hasDefault: true;
|
|
3043
|
-
isPrimaryKey: false;
|
|
3044
|
-
isAutoincrement: false;
|
|
3045
|
-
hasRuntimeDefault: false;
|
|
3046
|
-
enumValues: undefined;
|
|
3047
|
-
identity: undefined;
|
|
3048
|
-
generated: undefined;
|
|
3049
|
-
}>;
|
|
3050
|
-
dateOfBirth: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3051
|
-
name: string;
|
|
3052
|
-
tableName: "user_profiles";
|
|
3053
|
-
dataType: "string";
|
|
3054
|
-
data: string;
|
|
3055
|
-
driverParam: string;
|
|
3056
|
-
notNull: false;
|
|
3057
|
-
hasDefault: false;
|
|
3058
|
-
isPrimaryKey: false;
|
|
3059
|
-
isAutoincrement: false;
|
|
3060
|
-
hasRuntimeDefault: false;
|
|
3061
|
-
enumValues: undefined;
|
|
3062
|
-
identity: undefined;
|
|
3063
|
-
generated: undefined;
|
|
3064
|
-
}>;
|
|
3065
|
-
gender: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3066
|
-
name: string;
|
|
3067
|
-
tableName: "user_profiles";
|
|
3068
|
-
dataType: "string";
|
|
3069
|
-
data: string;
|
|
3070
|
-
driverParam: string;
|
|
3071
|
-
notNull: false;
|
|
3072
|
-
hasDefault: false;
|
|
3073
|
-
isPrimaryKey: false;
|
|
3074
|
-
isAutoincrement: false;
|
|
3075
|
-
hasRuntimeDefault: false;
|
|
3076
|
-
enumValues: undefined;
|
|
3077
|
-
identity: undefined;
|
|
3078
|
-
generated: undefined;
|
|
3079
|
-
}>;
|
|
3080
|
-
website: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3081
|
-
name: string;
|
|
3082
|
-
tableName: "user_profiles";
|
|
3083
|
-
dataType: "string";
|
|
3084
|
-
data: string;
|
|
3085
|
-
driverParam: string;
|
|
3086
|
-
notNull: false;
|
|
3087
|
-
hasDefault: false;
|
|
3088
|
-
isPrimaryKey: false;
|
|
3089
|
-
isAutoincrement: false;
|
|
3090
|
-
hasRuntimeDefault: false;
|
|
3091
|
-
enumValues: undefined;
|
|
3092
|
-
identity: undefined;
|
|
3093
|
-
generated: undefined;
|
|
3094
|
-
}>;
|
|
3095
|
-
location: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3096
|
-
name: string;
|
|
3097
|
-
tableName: "user_profiles";
|
|
3098
|
-
dataType: "string";
|
|
3099
|
-
data: string;
|
|
3100
|
-
driverParam: string;
|
|
3101
|
-
notNull: false;
|
|
3102
|
-
hasDefault: false;
|
|
3103
|
-
isPrimaryKey: false;
|
|
3104
|
-
isAutoincrement: false;
|
|
3105
|
-
hasRuntimeDefault: false;
|
|
3106
|
-
enumValues: undefined;
|
|
3107
|
-
identity: undefined;
|
|
3108
|
-
generated: undefined;
|
|
3109
|
-
}>;
|
|
3110
|
-
company: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
2901
|
+
/** Scope names, as granted or as the refresh that minted it narrowed them to. */
|
|
2902
|
+
scopes: string[];
|
|
2903
|
+
/** Expiry as seconds since the epoch — the unit every OAuth field uses. */
|
|
2904
|
+
expiresAt: number;
|
|
2905
|
+
/** The account the CLI is acting for. */
|
|
2906
|
+
userId: string;
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* Verify a bearer token presented to a protected resource.
|
|
2910
|
+
*
|
|
2911
|
+
* @param token - The raw bearer value
|
|
2912
|
+
* @param resource - The resource being accessed, e.g. `https://api.example.com/mcp`
|
|
2913
|
+
* @returns the principal, or null for any reason at all
|
|
2914
|
+
*/
|
|
2915
|
+
declare function verifyAccessToken(token: string, resource: string): Promise<VerifiedOAuth2AccessToken | null>;
|
|
2916
|
+
|
|
2917
|
+
/**
|
|
2918
|
+
* @spfn/auth - Database Schema Definition
|
|
2919
|
+
*
|
|
2920
|
+
* Defines the 'spfn_auth' PostgreSQL schema for all auth-related tables
|
|
2921
|
+
*/
|
|
2922
|
+
/**
|
|
2923
|
+
* Auth schema for all authentication and authorization tables
|
|
2924
|
+
* Tables: users, roles, permissions, user_invitations, etc.
|
|
2925
|
+
*/
|
|
2926
|
+
declare const authSchema: drizzle_orm_pg_core.PgSchema<string>;
|
|
2927
|
+
|
|
2928
|
+
/**
|
|
2929
|
+
* @spfn/auth - User Profiles Entity
|
|
2930
|
+
*
|
|
2931
|
+
* User profile information (separate from authentication data)
|
|
2932
|
+
*
|
|
2933
|
+
* Features:
|
|
2934
|
+
* - Display name and personal information
|
|
2935
|
+
* - Avatar and bio
|
|
2936
|
+
* - Locale and timezone preferences
|
|
2937
|
+
* - Optional demographic data
|
|
2938
|
+
* - Social links and professional info
|
|
2939
|
+
*/
|
|
2940
|
+
declare const userProfiles: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2941
|
+
name: "user_profiles";
|
|
2942
|
+
schema: string;
|
|
2943
|
+
columns: {
|
|
2944
|
+
createdAt: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTimestampBuilder>>, {
|
|
3111
2945
|
name: string;
|
|
3112
2946
|
tableName: "user_profiles";
|
|
3113
|
-
dataType: "
|
|
3114
|
-
data:
|
|
2947
|
+
dataType: "object date";
|
|
2948
|
+
data: Date;
|
|
3115
2949
|
driverParam: string;
|
|
3116
|
-
notNull:
|
|
3117
|
-
hasDefault:
|
|
2950
|
+
notNull: true;
|
|
2951
|
+
hasDefault: true;
|
|
3118
2952
|
isPrimaryKey: false;
|
|
3119
2953
|
isAutoincrement: false;
|
|
3120
2954
|
hasRuntimeDefault: false;
|
|
@@ -3122,14 +2956,14 @@ declare const userProfiles: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3122
2956
|
identity: undefined;
|
|
3123
2957
|
generated: undefined;
|
|
3124
2958
|
}>;
|
|
3125
|
-
|
|
2959
|
+
updatedAt: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTimestampBuilder>>>, {
|
|
3126
2960
|
name: string;
|
|
3127
2961
|
tableName: "user_profiles";
|
|
3128
|
-
dataType: "
|
|
3129
|
-
data:
|
|
2962
|
+
dataType: "object date";
|
|
2963
|
+
data: Date;
|
|
3130
2964
|
driverParam: string;
|
|
3131
|
-
notNull:
|
|
3132
|
-
hasDefault:
|
|
2965
|
+
notNull: true;
|
|
2966
|
+
hasDefault: true;
|
|
3133
2967
|
isPrimaryKey: false;
|
|
3134
2968
|
isAutoincrement: false;
|
|
3135
2969
|
hasRuntimeDefault: false;
|
|
@@ -3137,44 +2971,9 @@ declare const userProfiles: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3137
2971
|
identity: undefined;
|
|
3138
2972
|
generated: undefined;
|
|
3139
2973
|
}>;
|
|
3140
|
-
|
|
2974
|
+
id: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetIsPrimaryKey<drizzle_orm_pg_core.PgBigSerial53Builder>, {
|
|
3141
2975
|
name: string;
|
|
3142
2976
|
tableName: "user_profiles";
|
|
3143
|
-
dataType: "object json";
|
|
3144
|
-
data: Record<string, any>;
|
|
3145
|
-
driverParam: unknown;
|
|
3146
|
-
notNull: false;
|
|
3147
|
-
hasDefault: false;
|
|
3148
|
-
isPrimaryKey: false;
|
|
3149
|
-
isAutoincrement: false;
|
|
3150
|
-
hasRuntimeDefault: false;
|
|
3151
|
-
enumValues: undefined;
|
|
3152
|
-
identity: undefined;
|
|
3153
|
-
generated: undefined;
|
|
3154
|
-
}>;
|
|
3155
|
-
};
|
|
3156
|
-
dialect: "pg";
|
|
3157
|
-
}>;
|
|
3158
|
-
type UserProfile = typeof userProfiles.$inferSelect;
|
|
3159
|
-
type NewUserProfile = typeof userProfiles.$inferInsert;
|
|
3160
|
-
|
|
3161
|
-
/**
|
|
3162
|
-
* @spfn/auth - User Public Keys Entity
|
|
3163
|
-
*
|
|
3164
|
-
* Stores client-generated public keys for JWT verification
|
|
3165
|
-
* Supports key rotation and multi-key management per user
|
|
3166
|
-
*/
|
|
3167
|
-
/**
|
|
3168
|
-
* User Public Keys Table
|
|
3169
|
-
* Each user can have multiple public keys (for rotation)
|
|
3170
|
-
*/
|
|
3171
|
-
declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3172
|
-
name: "user_public_keys";
|
|
3173
|
-
schema: string;
|
|
3174
|
-
columns: {
|
|
3175
|
-
id: drizzle_orm_pg_core.PgBuildColumn<"user_public_keys", drizzle_orm_pg_core.SetIsPrimaryKey<drizzle_orm_pg_core.PgBigSerial53Builder>, {
|
|
3176
|
-
name: string;
|
|
3177
|
-
tableName: "user_public_keys";
|
|
3178
2977
|
dataType: "number int53";
|
|
3179
2978
|
data: number;
|
|
3180
2979
|
driverParam: number;
|
|
@@ -3187,9 +2986,9 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3187
2986
|
identity: undefined;
|
|
3188
2987
|
generated: undefined;
|
|
3189
2988
|
}>;
|
|
3190
|
-
userId: drizzle_orm_pg_core.PgBuildColumn<"
|
|
2989
|
+
userId: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgBigInt53Builder>, {
|
|
3191
2990
|
name: string;
|
|
3192
|
-
tableName: "
|
|
2991
|
+
tableName: "user_profiles";
|
|
3193
2992
|
dataType: "number int53";
|
|
3194
2993
|
data: number;
|
|
3195
2994
|
driverParam: string | number;
|
|
@@ -3202,13 +3001,13 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3202
3001
|
identity: undefined;
|
|
3203
3002
|
generated: undefined;
|
|
3204
3003
|
}>;
|
|
3205
|
-
|
|
3004
|
+
displayName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3206
3005
|
name: string;
|
|
3207
|
-
tableName: "
|
|
3006
|
+
tableName: "user_profiles";
|
|
3208
3007
|
dataType: "string";
|
|
3209
3008
|
data: string;
|
|
3210
3009
|
driverParam: string;
|
|
3211
|
-
notNull:
|
|
3010
|
+
notNull: false;
|
|
3212
3011
|
hasDefault: false;
|
|
3213
3012
|
isPrimaryKey: false;
|
|
3214
3013
|
isAutoincrement: false;
|
|
@@ -3217,13 +3016,13 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3217
3016
|
identity: undefined;
|
|
3218
3017
|
generated: undefined;
|
|
3219
3018
|
}>;
|
|
3220
|
-
|
|
3019
|
+
firstName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3221
3020
|
name: string;
|
|
3222
|
-
tableName: "
|
|
3021
|
+
tableName: "user_profiles";
|
|
3223
3022
|
dataType: "string";
|
|
3224
3023
|
data: string;
|
|
3225
3024
|
driverParam: string;
|
|
3226
|
-
notNull:
|
|
3025
|
+
notNull: false;
|
|
3227
3026
|
hasDefault: false;
|
|
3228
3027
|
isPrimaryKey: false;
|
|
3229
3028
|
isAutoincrement: false;
|
|
@@ -3232,28 +3031,13 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3232
3031
|
identity: undefined;
|
|
3233
3032
|
generated: undefined;
|
|
3234
3033
|
}>;
|
|
3235
|
-
|
|
3236
|
-
name: string;
|
|
3237
|
-
tableName: "user_public_keys";
|
|
3238
|
-
dataType: "string enum";
|
|
3239
|
-
data: "ES256" | "RS256";
|
|
3240
|
-
driverParam: string;
|
|
3241
|
-
notNull: true;
|
|
3242
|
-
hasDefault: true;
|
|
3243
|
-
isPrimaryKey: false;
|
|
3244
|
-
isAutoincrement: false;
|
|
3245
|
-
hasRuntimeDefault: false;
|
|
3246
|
-
enumValues: ["ES256", "RS256"] & [string, ...string[]];
|
|
3247
|
-
identity: undefined;
|
|
3248
|
-
generated: undefined;
|
|
3249
|
-
}>;
|
|
3250
|
-
fingerprint: drizzle_orm_pg_core.PgBuildColumn<"user_public_keys", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>>, {
|
|
3034
|
+
lastName: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3251
3035
|
name: string;
|
|
3252
|
-
tableName: "
|
|
3036
|
+
tableName: "user_profiles";
|
|
3253
3037
|
dataType: "string";
|
|
3254
3038
|
data: string;
|
|
3255
3039
|
driverParam: string;
|
|
3256
|
-
notNull:
|
|
3040
|
+
notNull: false;
|
|
3257
3041
|
hasDefault: false;
|
|
3258
3042
|
isPrimaryKey: false;
|
|
3259
3043
|
isAutoincrement: false;
|
|
@@ -3262,9 +3046,9 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3262
3046
|
identity: undefined;
|
|
3263
3047
|
generated: undefined;
|
|
3264
3048
|
}>;
|
|
3265
|
-
|
|
3049
|
+
avatarUrl: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3266
3050
|
name: string;
|
|
3267
|
-
tableName: "
|
|
3051
|
+
tableName: "user_profiles";
|
|
3268
3052
|
dataType: "string";
|
|
3269
3053
|
data: string;
|
|
3270
3054
|
driverParam: string;
|
|
@@ -3277,24 +3061,9 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3277
3061
|
identity: undefined;
|
|
3278
3062
|
generated: undefined;
|
|
3279
3063
|
}>;
|
|
3280
|
-
|
|
3281
|
-
name: string;
|
|
3282
|
-
tableName: "user_public_keys";
|
|
3283
|
-
dataType: "string enum";
|
|
3284
|
-
data: "ios" | "android" | "web" | "desktop";
|
|
3285
|
-
driverParam: string;
|
|
3286
|
-
notNull: false;
|
|
3287
|
-
hasDefault: false;
|
|
3288
|
-
isPrimaryKey: false;
|
|
3289
|
-
isAutoincrement: false;
|
|
3290
|
-
hasRuntimeDefault: false;
|
|
3291
|
-
enumValues: ["ios", "android", "web", "desktop"] & [string, ...string[]];
|
|
3292
|
-
identity: undefined;
|
|
3293
|
-
generated: undefined;
|
|
3294
|
-
}>;
|
|
3295
|
-
registeredIp: drizzle_orm_pg_core.PgBuildColumn<"user_public_keys", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3064
|
+
bio: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3296
3065
|
name: string;
|
|
3297
|
-
tableName: "
|
|
3066
|
+
tableName: "user_profiles";
|
|
3298
3067
|
dataType: "string";
|
|
3299
3068
|
data: string;
|
|
3300
3069
|
driverParam: string;
|
|
@@ -3307,14 +3076,14 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3307
3076
|
identity: undefined;
|
|
3308
3077
|
generated: undefined;
|
|
3309
3078
|
}>;
|
|
3310
|
-
|
|
3079
|
+
locale: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>>, {
|
|
3311
3080
|
name: string;
|
|
3312
|
-
tableName: "
|
|
3081
|
+
tableName: "user_profiles";
|
|
3313
3082
|
dataType: "string";
|
|
3314
3083
|
data: string;
|
|
3315
3084
|
driverParam: string;
|
|
3316
3085
|
notNull: false;
|
|
3317
|
-
hasDefault:
|
|
3086
|
+
hasDefault: true;
|
|
3318
3087
|
isPrimaryKey: false;
|
|
3319
3088
|
isAutoincrement: false;
|
|
3320
3089
|
hasRuntimeDefault: false;
|
|
@@ -3322,24 +3091,24 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3322
3091
|
identity: undefined;
|
|
3323
3092
|
generated: undefined;
|
|
3324
3093
|
}>;
|
|
3325
|
-
|
|
3094
|
+
timezone: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>>, {
|
|
3326
3095
|
name: string;
|
|
3327
|
-
tableName: "
|
|
3328
|
-
dataType: "string
|
|
3329
|
-
data:
|
|
3096
|
+
tableName: "user_profiles";
|
|
3097
|
+
dataType: "string";
|
|
3098
|
+
data: string;
|
|
3330
3099
|
driverParam: string;
|
|
3331
3100
|
notNull: false;
|
|
3332
|
-
hasDefault:
|
|
3101
|
+
hasDefault: true;
|
|
3333
3102
|
isPrimaryKey: false;
|
|
3334
3103
|
isAutoincrement: false;
|
|
3335
3104
|
hasRuntimeDefault: false;
|
|
3336
|
-
enumValues:
|
|
3105
|
+
enumValues: undefined;
|
|
3337
3106
|
identity: undefined;
|
|
3338
3107
|
generated: undefined;
|
|
3339
3108
|
}>;
|
|
3340
|
-
|
|
3109
|
+
dateOfBirth: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3341
3110
|
name: string;
|
|
3342
|
-
tableName: "
|
|
3111
|
+
tableName: "user_profiles";
|
|
3343
3112
|
dataType: "string";
|
|
3344
3113
|
data: string;
|
|
3345
3114
|
driverParam: string;
|
|
@@ -3352,9 +3121,9 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3352
3121
|
identity: undefined;
|
|
3353
3122
|
generated: undefined;
|
|
3354
3123
|
}>;
|
|
3355
|
-
|
|
3124
|
+
gender: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3356
3125
|
name: string;
|
|
3357
|
-
tableName: "
|
|
3126
|
+
tableName: "user_profiles";
|
|
3358
3127
|
dataType: "string";
|
|
3359
3128
|
data: string;
|
|
3360
3129
|
driverParam: string;
|
|
@@ -3367,11 +3136,11 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3367
3136
|
identity: undefined;
|
|
3368
3137
|
generated: undefined;
|
|
3369
3138
|
}>;
|
|
3370
|
-
|
|
3139
|
+
website: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3371
3140
|
name: string;
|
|
3372
|
-
tableName: "
|
|
3373
|
-
dataType: "
|
|
3374
|
-
data:
|
|
3141
|
+
tableName: "user_profiles";
|
|
3142
|
+
dataType: "string";
|
|
3143
|
+
data: string;
|
|
3375
3144
|
driverParam: string;
|
|
3376
3145
|
notNull: false;
|
|
3377
3146
|
hasDefault: false;
|
|
@@ -3382,41 +3151,11 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3382
3151
|
identity: undefined;
|
|
3383
3152
|
generated: undefined;
|
|
3384
3153
|
}>;
|
|
3385
|
-
|
|
3386
|
-
name: string;
|
|
3387
|
-
tableName: "user_public_keys";
|
|
3388
|
-
dataType: "boolean";
|
|
3389
|
-
data: boolean;
|
|
3390
|
-
driverParam: boolean;
|
|
3391
|
-
notNull: true;
|
|
3392
|
-
hasDefault: true;
|
|
3393
|
-
isPrimaryKey: false;
|
|
3394
|
-
isAutoincrement: false;
|
|
3395
|
-
hasRuntimeDefault: false;
|
|
3396
|
-
enumValues: undefined;
|
|
3397
|
-
identity: undefined;
|
|
3398
|
-
generated: undefined;
|
|
3399
|
-
}>;
|
|
3400
|
-
createdAt: drizzle_orm_pg_core.PgBuildColumn<"user_public_keys", drizzle_orm_pg_core.SetHasDefault<drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgTimestampBuilder>>, {
|
|
3401
|
-
name: string;
|
|
3402
|
-
tableName: "user_public_keys";
|
|
3403
|
-
dataType: "object date";
|
|
3404
|
-
data: Date;
|
|
3405
|
-
driverParam: string;
|
|
3406
|
-
notNull: true;
|
|
3407
|
-
hasDefault: true;
|
|
3408
|
-
isPrimaryKey: false;
|
|
3409
|
-
isAutoincrement: false;
|
|
3410
|
-
hasRuntimeDefault: false;
|
|
3411
|
-
enumValues: undefined;
|
|
3412
|
-
identity: undefined;
|
|
3413
|
-
generated: undefined;
|
|
3414
|
-
}>;
|
|
3415
|
-
lastUsedAt: drizzle_orm_pg_core.PgBuildColumn<"user_public_keys", drizzle_orm_pg_core.PgTimestampBuilder, {
|
|
3154
|
+
location: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3416
3155
|
name: string;
|
|
3417
|
-
tableName: "
|
|
3418
|
-
dataType: "
|
|
3419
|
-
data:
|
|
3156
|
+
tableName: "user_profiles";
|
|
3157
|
+
dataType: "string";
|
|
3158
|
+
data: string;
|
|
3420
3159
|
driverParam: string;
|
|
3421
3160
|
notNull: false;
|
|
3422
3161
|
hasDefault: false;
|
|
@@ -3427,11 +3166,11 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3427
3166
|
identity: undefined;
|
|
3428
3167
|
generated: undefined;
|
|
3429
3168
|
}>;
|
|
3430
|
-
|
|
3169
|
+
company: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3431
3170
|
name: string;
|
|
3432
|
-
tableName: "
|
|
3433
|
-
dataType: "
|
|
3434
|
-
data:
|
|
3171
|
+
tableName: "user_profiles";
|
|
3172
|
+
dataType: "string";
|
|
3173
|
+
data: string;
|
|
3435
3174
|
driverParam: string;
|
|
3436
3175
|
notNull: false;
|
|
3437
3176
|
hasDefault: false;
|
|
@@ -3442,11 +3181,11 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3442
3181
|
identity: undefined;
|
|
3443
3182
|
generated: undefined;
|
|
3444
3183
|
}>;
|
|
3445
|
-
|
|
3184
|
+
jobTitle: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.PgTextBuilder<[string, ...string[]]>, {
|
|
3446
3185
|
name: string;
|
|
3447
|
-
tableName: "
|
|
3448
|
-
dataType: "
|
|
3449
|
-
data:
|
|
3186
|
+
tableName: "user_profiles";
|
|
3187
|
+
dataType: "string";
|
|
3188
|
+
data: string;
|
|
3450
3189
|
driverParam: string;
|
|
3451
3190
|
notNull: false;
|
|
3452
3191
|
hasDefault: false;
|
|
@@ -3457,12 +3196,12 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3457
3196
|
identity: undefined;
|
|
3458
3197
|
generated: undefined;
|
|
3459
3198
|
}>;
|
|
3460
|
-
|
|
3199
|
+
metadata: drizzle_orm_pg_core.PgBuildColumn<"user_profiles", drizzle_orm_pg_core.Set$Type<drizzle_orm_pg_core.PgJsonbBuilder, Record<string, any>>, {
|
|
3461
3200
|
name: string;
|
|
3462
|
-
tableName: "
|
|
3463
|
-
dataType: "
|
|
3464
|
-
data: string
|
|
3465
|
-
driverParam:
|
|
3201
|
+
tableName: "user_profiles";
|
|
3202
|
+
dataType: "object json";
|
|
3203
|
+
data: Record<string, any>;
|
|
3204
|
+
driverParam: unknown;
|
|
3466
3205
|
notNull: false;
|
|
3467
3206
|
hasDefault: false;
|
|
3468
3207
|
isPrimaryKey: false;
|
|
@@ -3475,8 +3214,8 @@ declare const userPublicKeys: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3475
3214
|
};
|
|
3476
3215
|
dialect: "pg";
|
|
3477
3216
|
}>;
|
|
3478
|
-
type
|
|
3479
|
-
type
|
|
3217
|
+
type UserProfile = typeof userProfiles.$inferSelect;
|
|
3218
|
+
type NewUserProfile = typeof userProfiles.$inferInsert;
|
|
3480
3219
|
|
|
3481
3220
|
/**
|
|
3482
3221
|
* @spfn/auth - User Social Accounts Entity
|
|
@@ -4429,8 +4168,15 @@ type NewKeyRevokeAllToken = typeof keyRevokeAllTokens.$inferInsert;
|
|
|
4429
4168
|
* direction that matters most — an assertion collected as a second factor is
|
|
4430
4169
|
* not a sign-in, and `passkeys/login/verify` refuses it for exactly the reason
|
|
4431
4170
|
* the column exists.
|
|
4171
|
+
*
|
|
4172
|
+
* `'renewal'` is the fourth: the assertion that renews a bound session key, and
|
|
4173
|
+
* the one that lets an account leave `session_binding: 'passkey'`. It is its own
|
|
4174
|
+
* kind rather than a reused `'authentication'` because that kind's challenge is
|
|
4175
|
+
* minted for nobody in particular — a discoverable sign-in names no account —
|
|
4176
|
+
* while a renewal challenge is bound to the account it was issued for, and
|
|
4177
|
+
* spending one where the other was expected would cross those two rules.
|
|
4432
4178
|
*/
|
|
4433
|
-
declare const WEBAUTHN_CHALLENGE_KINDS: readonly ["registration", "authentication", "mfa"];
|
|
4179
|
+
declare const WEBAUTHN_CHALLENGE_KINDS: readonly ["registration", "authentication", "mfa", "renewal"];
|
|
4434
4180
|
type WebAuthnChallengeKind = typeof WEBAUTHN_CHALLENGE_KINDS[number];
|
|
4435
4181
|
declare const webauthnChallenges: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
4436
4182
|
name: "webauthn_challenges";
|
|
@@ -4466,18 +4212,18 @@ declare const webauthnChallenges: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
4466
4212
|
identity: undefined;
|
|
4467
4213
|
generated: undefined;
|
|
4468
4214
|
}>;
|
|
4469
|
-
kind: drizzle_orm_pg_core.PgBuildColumn<"webauthn_challenges", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgTextBuilder<["registration", "authentication", "mfa"] & [string, ...string[]]>>, {
|
|
4215
|
+
kind: drizzle_orm_pg_core.PgBuildColumn<"webauthn_challenges", drizzle_orm_pg_core.SetNotNull<drizzle_orm_pg_core.PgTextBuilder<["registration", "authentication", "mfa", "renewal"] & [string, ...string[]]>>, {
|
|
4470
4216
|
name: string;
|
|
4471
4217
|
tableName: "webauthn_challenges";
|
|
4472
4218
|
dataType: "string enum";
|
|
4473
|
-
data: "registration" | "authentication" | "mfa";
|
|
4219
|
+
data: "registration" | "authentication" | "mfa" | "renewal";
|
|
4474
4220
|
driverParam: string;
|
|
4475
4221
|
notNull: true;
|
|
4476
4222
|
hasDefault: false;
|
|
4477
4223
|
isPrimaryKey: false;
|
|
4478
4224
|
isAutoincrement: false;
|
|
4479
4225
|
hasRuntimeDefault: false;
|
|
4480
|
-
enumValues: ["registration", "authentication", "mfa"] & [string, ...string[]];
|
|
4226
|
+
enumValues: ["registration", "authentication", "mfa", "renewal"] & [string, ...string[]];
|
|
4481
4227
|
identity: undefined;
|
|
4482
4228
|
generated: undefined;
|
|
4483
4229
|
}>;
|
|
@@ -6294,6 +6040,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6294
6040
|
emailVerifiedAt: Date | null;
|
|
6295
6041
|
phoneVerifiedAt: Date | null;
|
|
6296
6042
|
keyEpoch: number;
|
|
6043
|
+
sessionBinding: "none" | "passkey";
|
|
6044
|
+
sessionBindingChangedAt: Date | null;
|
|
6297
6045
|
lastLoginAt: Date | null;
|
|
6298
6046
|
}>;
|
|
6299
6047
|
/**
|
|
@@ -6320,6 +6068,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6320
6068
|
emailVerifiedAt: Date | null;
|
|
6321
6069
|
phoneVerifiedAt: Date | null;
|
|
6322
6070
|
keyEpoch: number;
|
|
6071
|
+
sessionBinding: "none" | "passkey";
|
|
6072
|
+
sessionBindingChangedAt: Date | null;
|
|
6323
6073
|
lastLoginAt: Date | null;
|
|
6324
6074
|
}>;
|
|
6325
6075
|
/**
|
|
@@ -6357,6 +6107,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6357
6107
|
emailVerifiedAt: Date | null;
|
|
6358
6108
|
phoneVerifiedAt: Date | null;
|
|
6359
6109
|
keyEpoch: number;
|
|
6110
|
+
sessionBinding: "none" | "passkey";
|
|
6111
|
+
sessionBindingChangedAt: Date | null;
|
|
6360
6112
|
lastLoginAt: Date | null;
|
|
6361
6113
|
}>;
|
|
6362
6114
|
/**
|
|
@@ -6390,6 +6142,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6390
6142
|
emailVerifiedAt: Date | null;
|
|
6391
6143
|
phoneVerifiedAt: Date | null;
|
|
6392
6144
|
keyEpoch: number;
|
|
6145
|
+
sessionBinding: "none" | "passkey";
|
|
6146
|
+
sessionBindingChangedAt: Date | null;
|
|
6393
6147
|
lastLoginAt: Date | null;
|
|
6394
6148
|
}>;
|
|
6395
6149
|
/**
|
|
@@ -6413,6 +6167,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6413
6167
|
emailVerifiedAt: Date | null;
|
|
6414
6168
|
phoneVerifiedAt: Date | null;
|
|
6415
6169
|
keyEpoch: number;
|
|
6170
|
+
sessionBinding: "none" | "passkey";
|
|
6171
|
+
sessionBindingChangedAt: Date | null;
|
|
6416
6172
|
lastLoginAt: Date | null;
|
|
6417
6173
|
}>;
|
|
6418
6174
|
/**
|
|
@@ -6436,6 +6192,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6436
6192
|
emailVerifiedAt: Date | null;
|
|
6437
6193
|
phoneVerifiedAt: Date | null;
|
|
6438
6194
|
keyEpoch: number;
|
|
6195
|
+
sessionBinding: "none" | "passkey";
|
|
6196
|
+
sessionBindingChangedAt: Date | null;
|
|
6439
6197
|
lastLoginAt: Date | null;
|
|
6440
6198
|
}>;
|
|
6441
6199
|
/**
|
|
@@ -6459,6 +6217,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6459
6217
|
emailVerifiedAt: Date | null;
|
|
6460
6218
|
phoneVerifiedAt: Date | null;
|
|
6461
6219
|
keyEpoch: number;
|
|
6220
|
+
sessionBinding: "none" | "passkey";
|
|
6221
|
+
sessionBindingChangedAt: Date | null;
|
|
6462
6222
|
lastLoginAt: Date | null;
|
|
6463
6223
|
}>;
|
|
6464
6224
|
/**
|
|
@@ -6482,6 +6242,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6482
6242
|
emailVerifiedAt: Date | null;
|
|
6483
6243
|
phoneVerifiedAt: Date | null;
|
|
6484
6244
|
keyEpoch: number;
|
|
6245
|
+
sessionBinding: "none" | "passkey";
|
|
6246
|
+
sessionBindingChangedAt: Date | null;
|
|
6485
6247
|
lastLoginAt: Date | null;
|
|
6486
6248
|
} | null>;
|
|
6487
6249
|
/**
|
|
@@ -6508,6 +6270,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6508
6270
|
emailVerifiedAt: Date | null;
|
|
6509
6271
|
phoneVerifiedAt: Date | null;
|
|
6510
6272
|
keyEpoch: number;
|
|
6273
|
+
sessionBinding: "none" | "passkey";
|
|
6274
|
+
sessionBindingChangedAt: Date | null;
|
|
6511
6275
|
lastLoginAt: Date | null;
|
|
6512
6276
|
};
|
|
6513
6277
|
role: {
|
|
@@ -6523,6 +6287,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6523
6287
|
create(data: NewUser): Promise<{
|
|
6524
6288
|
email: string | null;
|
|
6525
6289
|
phone: string | null;
|
|
6290
|
+
sessionBinding: "none" | "passkey";
|
|
6526
6291
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6527
6292
|
publicId: string;
|
|
6528
6293
|
passwordChangeRequired: boolean;
|
|
@@ -6535,6 +6300,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6535
6300
|
emailVerifiedAt: Date | null;
|
|
6536
6301
|
phoneVerifiedAt: Date | null;
|
|
6537
6302
|
keyEpoch: number;
|
|
6303
|
+
sessionBindingChangedAt: Date | null;
|
|
6538
6304
|
lastLoginAt: Date | null;
|
|
6539
6305
|
deletedAt: Date | null;
|
|
6540
6306
|
deletedBy: string | null;
|
|
@@ -6605,6 +6371,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6605
6371
|
emailVerifiedAt: Date | null;
|
|
6606
6372
|
phoneVerifiedAt: Date | null;
|
|
6607
6373
|
keyEpoch: number;
|
|
6374
|
+
sessionBinding: "none" | "passkey";
|
|
6375
|
+
sessionBindingChangedAt: Date | null;
|
|
6608
6376
|
lastLoginAt: Date | null;
|
|
6609
6377
|
}>;
|
|
6610
6378
|
/**
|
|
@@ -6633,6 +6401,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6633
6401
|
emailVerifiedAt: Date | null;
|
|
6634
6402
|
phoneVerifiedAt: Date | null;
|
|
6635
6403
|
keyEpoch: number;
|
|
6404
|
+
sessionBinding: "none" | "passkey";
|
|
6405
|
+
sessionBindingChangedAt: Date | null;
|
|
6636
6406
|
lastLoginAt: Date | null;
|
|
6637
6407
|
}>;
|
|
6638
6408
|
/**
|
|
@@ -6656,6 +6426,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6656
6426
|
emailVerifiedAt: Date | null;
|
|
6657
6427
|
phoneVerifiedAt: Date | null;
|
|
6658
6428
|
keyEpoch: number;
|
|
6429
|
+
sessionBinding: "none" | "passkey";
|
|
6430
|
+
sessionBindingChangedAt: Date | null;
|
|
6659
6431
|
lastLoginAt: Date | null;
|
|
6660
6432
|
}>;
|
|
6661
6433
|
/**
|
|
@@ -6679,6 +6451,8 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6679
6451
|
emailVerifiedAt: Date | null;
|
|
6680
6452
|
phoneVerifiedAt: Date | null;
|
|
6681
6453
|
keyEpoch: number;
|
|
6454
|
+
sessionBinding: "none" | "passkey";
|
|
6455
|
+
sessionBindingChangedAt: Date | null;
|
|
6682
6456
|
lastLoginAt: Date | null;
|
|
6683
6457
|
}>;
|
|
6684
6458
|
/**
|
|
@@ -6688,6 +6462,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6688
6462
|
deleteById(id: number): Promise<{
|
|
6689
6463
|
email: string | null;
|
|
6690
6464
|
phone: string | null;
|
|
6465
|
+
sessionBinding: "none" | "passkey";
|
|
6691
6466
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
6692
6467
|
publicId: string;
|
|
6693
6468
|
passwordChangeRequired: boolean;
|
|
@@ -6700,6 +6475,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
6700
6475
|
emailVerifiedAt: Date | null;
|
|
6701
6476
|
phoneVerifiedAt: Date | null;
|
|
6702
6477
|
keyEpoch: number;
|
|
6478
|
+
sessionBindingChangedAt: Date | null;
|
|
6703
6479
|
lastLoginAt: Date | null;
|
|
6704
6480
|
deletedAt: Date | null;
|
|
6705
6481
|
deletedBy: string | null;
|
|
@@ -6803,6 +6579,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6803
6579
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
6804
6580
|
registeredIp: string | null;
|
|
6805
6581
|
registeredUserAgent: string | null;
|
|
6582
|
+
registeredUaFamily: string | null;
|
|
6583
|
+
lastSeenIp: string | null;
|
|
6584
|
+
lastSeenAt: Date | null;
|
|
6585
|
+
concurrentUseAt: Date | null;
|
|
6586
|
+
binding: "none" | "passkey";
|
|
6806
6587
|
clientKind: "ios" | "android" | "web" | null;
|
|
6807
6588
|
clientVersion: string | null;
|
|
6808
6589
|
clientContractVersion: string | null;
|
|
@@ -6829,6 +6610,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6829
6610
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
6830
6611
|
registeredIp: string | null;
|
|
6831
6612
|
registeredUserAgent: string | null;
|
|
6613
|
+
registeredUaFamily: string | null;
|
|
6614
|
+
lastSeenIp: string | null;
|
|
6615
|
+
lastSeenAt: Date | null;
|
|
6616
|
+
concurrentUseAt: Date | null;
|
|
6617
|
+
binding: "none" | "passkey";
|
|
6832
6618
|
clientKind: "ios" | "android" | "web" | null;
|
|
6833
6619
|
clientVersion: string | null;
|
|
6834
6620
|
clientContractVersion: string | null;
|
|
@@ -6855,6 +6641,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6855
6641
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
6856
6642
|
registeredIp: string | null;
|
|
6857
6643
|
registeredUserAgent: string | null;
|
|
6644
|
+
registeredUaFamily: string | null;
|
|
6645
|
+
lastSeenIp: string | null;
|
|
6646
|
+
lastSeenAt: Date | null;
|
|
6647
|
+
concurrentUseAt: Date | null;
|
|
6648
|
+
binding: "none" | "passkey";
|
|
6858
6649
|
clientKind: "ios" | "android" | "web" | null;
|
|
6859
6650
|
clientVersion: string | null;
|
|
6860
6651
|
clientContractVersion: string | null;
|
|
@@ -6874,6 +6665,10 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6874
6665
|
*
|
|
6875
6666
|
* `includeRevoked`는 이미 끊은 기기까지 보여준다 — "내가 언제 무엇을 끊었나"를
|
|
6876
6667
|
* 확인하는 용도라, 폐기 시각과 사유를 함께 고른다.
|
|
6668
|
+
*
|
|
6669
|
+
* `lastSeenIp` is not selected, deliberately. The concurrent-use moment is
|
|
6670
|
+
* what the owner acts on; the trail of addresses behind it is stored PII the
|
|
6671
|
+
* account surface has no use for.
|
|
6877
6672
|
* Read replica 사용
|
|
6878
6673
|
*/
|
|
6879
6674
|
listForUser(userId: number, includeRevoked?: boolean): Promise<{
|
|
@@ -6889,6 +6684,8 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6889
6684
|
revokedAt: Date | null;
|
|
6890
6685
|
registeredIp: string | null;
|
|
6891
6686
|
registeredUserAgent: string | null;
|
|
6687
|
+
binding: "none" | "passkey";
|
|
6688
|
+
concurrentUseAt: Date | null;
|
|
6892
6689
|
}[]>;
|
|
6893
6690
|
/**
|
|
6894
6691
|
* 공개키 생성
|
|
@@ -6910,6 +6707,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6910
6707
|
lastUsedAt: Date | null;
|
|
6911
6708
|
registeredIp: string | null;
|
|
6912
6709
|
registeredUserAgent: string | null;
|
|
6710
|
+
registeredUaFamily: string | null;
|
|
6711
|
+
lastSeenIp: string | null;
|
|
6712
|
+
lastSeenAt: Date | null;
|
|
6713
|
+
concurrentUseAt: Date | null;
|
|
6714
|
+
binding: "none" | "passkey";
|
|
6913
6715
|
clientKind: "ios" | "android" | "web" | null;
|
|
6914
6716
|
clientVersion: string | null;
|
|
6915
6717
|
clientContractVersion: string | null;
|
|
@@ -6937,6 +6739,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
6937
6739
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
6938
6740
|
registeredIp: string | null;
|
|
6939
6741
|
registeredUserAgent: string | null;
|
|
6742
|
+
registeredUaFamily: string | null;
|
|
6743
|
+
lastSeenIp: string | null;
|
|
6744
|
+
lastSeenAt: Date | null;
|
|
6745
|
+
concurrentUseAt: Date | null;
|
|
6746
|
+
binding: "none" | "passkey";
|
|
6940
6747
|
clientKind: "ios" | "android" | "web" | null;
|
|
6941
6748
|
clientVersion: string | null;
|
|
6942
6749
|
clientContractVersion: string | null;
|
|
@@ -7000,6 +6807,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7000
6807
|
lastUsedAt: Date | null;
|
|
7001
6808
|
registeredIp: string | null;
|
|
7002
6809
|
registeredUserAgent: string | null;
|
|
6810
|
+
registeredUaFamily: string | null;
|
|
6811
|
+
lastSeenIp: string | null;
|
|
6812
|
+
lastSeenAt: Date | null;
|
|
6813
|
+
concurrentUseAt: Date | null;
|
|
6814
|
+
binding: "none" | "passkey";
|
|
7003
6815
|
clientKind: "ios" | "android" | "web" | null;
|
|
7004
6816
|
clientVersion: string | null;
|
|
7005
6817
|
clientContractVersion: string | null;
|
|
@@ -7029,6 +6841,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7029
6841
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
7030
6842
|
registeredIp: string | null;
|
|
7031
6843
|
registeredUserAgent: string | null;
|
|
6844
|
+
registeredUaFamily: string | null;
|
|
6845
|
+
lastSeenIp: string | null;
|
|
6846
|
+
lastSeenAt: Date | null;
|
|
6847
|
+
concurrentUseAt: Date | null;
|
|
6848
|
+
binding: "none" | "passkey";
|
|
7032
6849
|
clientKind: "ios" | "android" | "web" | null;
|
|
7033
6850
|
clientVersion: string | null;
|
|
7034
6851
|
clientContractVersion: string | null;
|
|
@@ -7055,6 +6872,46 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7055
6872
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
7056
6873
|
registeredIp: string | null;
|
|
7057
6874
|
registeredUserAgent: string | null;
|
|
6875
|
+
registeredUaFamily: string | null;
|
|
6876
|
+
lastSeenIp: string | null;
|
|
6877
|
+
lastSeenAt: Date | null;
|
|
6878
|
+
concurrentUseAt: Date | null;
|
|
6879
|
+
binding: "none" | "passkey";
|
|
6880
|
+
clientKind: "ios" | "android" | "web" | null;
|
|
6881
|
+
clientVersion: string | null;
|
|
6882
|
+
clientContractVersion: string | null;
|
|
6883
|
+
clientSeenAt: Date | null;
|
|
6884
|
+
isActive: boolean;
|
|
6885
|
+
createdAt: Date;
|
|
6886
|
+
lastUsedAt: Date | null;
|
|
6887
|
+
expiresAt: Date | null;
|
|
6888
|
+
revokedAt: Date | null;
|
|
6889
|
+
revokedReason: string | null;
|
|
6890
|
+
}>;
|
|
6891
|
+
/**
|
|
6892
|
+
* Bind one live key to the account's passkey, and give it the short life
|
|
6893
|
+
* that goes with it.
|
|
6894
|
+
*
|
|
6895
|
+
* Scoped by user and by `isActive`, like every other targeted update here, so
|
|
6896
|
+
* the answer is "this call bound something" rather than "a row exists".
|
|
6897
|
+
* Write primary 사용
|
|
6898
|
+
*/
|
|
6899
|
+
bindByKeyIdAndUserId(keyId: string, userId: number, expiresAt: Date): Promise<{
|
|
6900
|
+
id: number;
|
|
6901
|
+
userId: number;
|
|
6902
|
+
keyId: string;
|
|
6903
|
+
publicKey: string;
|
|
6904
|
+
algorithm: "ES256" | "RS256";
|
|
6905
|
+
fingerprint: string;
|
|
6906
|
+
deviceName: string | null;
|
|
6907
|
+
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
6908
|
+
registeredIp: string | null;
|
|
6909
|
+
registeredUserAgent: string | null;
|
|
6910
|
+
registeredUaFamily: string | null;
|
|
6911
|
+
lastSeenIp: string | null;
|
|
6912
|
+
lastSeenAt: Date | null;
|
|
6913
|
+
concurrentUseAt: Date | null;
|
|
6914
|
+
binding: "none" | "passkey";
|
|
7058
6915
|
clientKind: "ios" | "android" | "web" | null;
|
|
7059
6916
|
clientVersion: string | null;
|
|
7060
6917
|
clientContractVersion: string | null;
|
|
@@ -7066,6 +6923,15 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7066
6923
|
revokedAt: Date | null;
|
|
7067
6924
|
revokedReason: string | null;
|
|
7068
6925
|
}>;
|
|
6926
|
+
/**
|
|
6927
|
+
* Return every one of a user's bound keys to an ordinary long-lived key.
|
|
6928
|
+
*
|
|
6929
|
+
* One statement, because turning the setting off has to leave no key behind:
|
|
6930
|
+
* a row still marked `'passkey'` would keep expiring in hours with nothing
|
|
6931
|
+
* left to renew it, and its owner has just said they do not want that.
|
|
6932
|
+
* Write primary 사용
|
|
6933
|
+
*/
|
|
6934
|
+
unbindActiveByUserId(userId: number, expiresAt: Date): Promise<number>;
|
|
7069
6935
|
/**
|
|
7070
6936
|
* Key ID로 공개키 조회 — 활성 여부 무관 (clientProofV1 admission의 revocation 판정용)
|
|
7071
6937
|
*
|
|
@@ -7084,6 +6950,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7084
6950
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
7085
6951
|
registeredIp: string | null;
|
|
7086
6952
|
registeredUserAgent: string | null;
|
|
6953
|
+
registeredUaFamily: string | null;
|
|
6954
|
+
lastSeenIp: string | null;
|
|
6955
|
+
lastSeenAt: Date | null;
|
|
6956
|
+
concurrentUseAt: Date | null;
|
|
6957
|
+
binding: "none" | "passkey";
|
|
7087
6958
|
clientKind: "ios" | "android" | "web" | null;
|
|
7088
6959
|
clientVersion: string | null;
|
|
7089
6960
|
clientContractVersion: string | null;
|
|
@@ -7110,6 +6981,11 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7110
6981
|
platform: "ios" | "android" | "web" | "desktop" | null;
|
|
7111
6982
|
registeredIp: string | null;
|
|
7112
6983
|
registeredUserAgent: string | null;
|
|
6984
|
+
registeredUaFamily: string | null;
|
|
6985
|
+
lastSeenIp: string | null;
|
|
6986
|
+
lastSeenAt: Date | null;
|
|
6987
|
+
concurrentUseAt: Date | null;
|
|
6988
|
+
binding: "none" | "passkey";
|
|
7113
6989
|
clientKind: "ios" | "android" | "web" | null;
|
|
7114
6990
|
clientVersion: string | null;
|
|
7115
6991
|
clientContractVersion: string | null;
|
|
@@ -7140,8 +7016,28 @@ declare class KeysRepository extends BaseRepository {
|
|
|
7140
7016
|
* `clientSeenAt` moves only when one of the three values differs from what is
|
|
7141
7017
|
* stored, so it answers "since when has this device been on this release"
|
|
7142
7018
|
* rather than "when was it last seen", which lastUsedAt already answers.
|
|
7019
|
+
*
|
|
7020
|
+
* `ip` is the client address this request resolved to, or null when none did.
|
|
7021
|
+
* It joins this statement rather than getting one of its own: the rule the
|
|
7022
|
+
* concurrent-use signal needs — write the address, and move
|
|
7023
|
+
* `concurrentUseAt` when it differs from the stored one inside the window —
|
|
7024
|
+
* is the rule already implemented here, and a second fire-and-forget write
|
|
7025
|
+
* beside it would double the per-request write on the authenticated path. It
|
|
7026
|
+
* is also why the comparison is a `CASE` over the stored value rather than a
|
|
7027
|
+
* read followed by a write: the row comes off the read replica, and a
|
|
7028
|
+
* replica-lagged address compared in application code both misses real
|
|
7029
|
+
* switches and invents ones that did not happen.
|
|
7030
|
+
*/
|
|
7031
|
+
updateLastUsedById(id: number, identity?: ClientIdentity | null, ip?: string | null): Promise<void>;
|
|
7032
|
+
/**
|
|
7033
|
+
* The boundary a previous sighting has to be newer than to count as concurrent.
|
|
7034
|
+
*
|
|
7035
|
+
* Computed here rather than written as `now() - interval` so that the moment
|
|
7036
|
+
* the row is stamped with and the moment the window is measured from are the
|
|
7037
|
+
* same one — a statement that used the database clock for the boundary and
|
|
7038
|
+
* ours for the value would disagree with itself by the round trip.
|
|
7143
7039
|
*/
|
|
7144
|
-
|
|
7040
|
+
private concurrentUseSince;
|
|
7145
7041
|
}
|
|
7146
7042
|
declare const keysRepository: KeysRepository;
|
|
7147
7043
|
|
|
@@ -9661,6 +9557,31 @@ declare function verifyKeyFingerprint(publicKeyB64: string, expectedFingerprint:
|
|
|
9661
9557
|
*/
|
|
9662
9558
|
declare function assertKeyMatchesAlgorithm(publicKeyB64: string, algorithm: KeyAlgorithmType): void;
|
|
9663
9559
|
|
|
9560
|
+
/**
|
|
9561
|
+
* Whether a key may sign a renewal — the one clause that differs from `authenticate`.
|
|
9562
|
+
*
|
|
9563
|
+
* Bound, and within its grace. Early renewal is allowed, because a browser that
|
|
9564
|
+
* asks a minute before its key runs out should not have to wait for the failure
|
|
9565
|
+
* first; late renewal is allowed for the grace window, so a laptop closed over a
|
|
9566
|
+
* long weekend comes back to one prompt instead of a sign-in. Past it there is
|
|
9567
|
+
* nothing to continue, and an unbound key was never in this ceremony at all.
|
|
9568
|
+
*/
|
|
9569
|
+
declare function admitsForRenewal(key: UserPublicKey): boolean;
|
|
9570
|
+
/**
|
|
9571
|
+
* Renewal authentication middleware
|
|
9572
|
+
*
|
|
9573
|
+
* Auto-skips the global `auth` middleware, the way `optionalAuth` does: a route
|
|
9574
|
+
* that carries this one must not also be asked for a live key.
|
|
9575
|
+
*
|
|
9576
|
+
* @example
|
|
9577
|
+
* ```typescript
|
|
9578
|
+
* export const sessionRenewOptions = route.post('/_auth/session/renew/options')
|
|
9579
|
+
* .use([authenticateForRenewal])
|
|
9580
|
+
* .handler(async (c) => startSessionRenewService({ expiredKeyId: getAuth(c).keyId }));
|
|
9581
|
+
* ```
|
|
9582
|
+
*/
|
|
9583
|
+
declare const authenticateForRenewal: _spfn_core_route.NamedMiddleware<"authForRenewal">;
|
|
9584
|
+
|
|
9664
9585
|
/**
|
|
9665
9586
|
* @spfn/auth - Permission Middleware
|
|
9666
9587
|
*
|
|
@@ -10005,6 +9926,7 @@ declare function getUser(c: Context | {
|
|
|
10005
9926
|
}): {
|
|
10006
9927
|
email: string | null;
|
|
10007
9928
|
phone: string | null;
|
|
9929
|
+
sessionBinding: "none" | "passkey";
|
|
10008
9930
|
status: "active" | "inactive" | "suspended" | "pending_deletion" | "deleted";
|
|
10009
9931
|
publicId: string;
|
|
10010
9932
|
passwordChangeRequired: boolean;
|
|
@@ -10017,6 +9939,7 @@ declare function getUser(c: Context | {
|
|
|
10017
9939
|
emailVerifiedAt: Date | null;
|
|
10018
9940
|
phoneVerifiedAt: Date | null;
|
|
10019
9941
|
keyEpoch: number;
|
|
9942
|
+
sessionBindingChangedAt: Date | null;
|
|
10020
9943
|
lastLoginAt: Date | null;
|
|
10021
9944
|
deletedAt: Date | null;
|
|
10022
9945
|
deletedBy: string | null;
|
|
@@ -11011,4 +10934,4 @@ declare const authJobRouter: _spfn_core_job.JobRouter<{
|
|
|
11011
10934
|
*/
|
|
11012
10935
|
declare const createAuthDeletionJobRouter: typeof createAuthJobRouter;
|
|
11013
10936
|
|
|
11014
|
-
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,
|
|
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 };
|