@technomoron/api-server-base 1.1.13 → 2.0.0-beta.10
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.txt +25 -2
- package/dist/cjs/api-server-base.cjs +448 -111
- package/dist/cjs/api-server-base.d.ts +91 -34
- package/dist/cjs/auth-api/auth-module.d.ts +105 -0
- package/dist/cjs/auth-api/auth-module.js +1180 -0
- package/dist/cjs/auth-api/compat-auth-storage.d.ts +57 -0
- package/dist/cjs/auth-api/compat-auth-storage.js +128 -0
- package/dist/cjs/auth-api/mem-auth-store.d.ts +68 -0
- package/dist/cjs/auth-api/mem-auth-store.js +141 -0
- package/dist/cjs/{auth-module.d.ts → auth-api/module.d.ts} +7 -7
- package/dist/cjs/{auth-module.cjs → auth-api/module.js} +1 -1
- package/dist/cjs/auth-api/sql-auth-store.d.ts +77 -0
- package/dist/cjs/auth-api/sql-auth-store.js +172 -0
- package/dist/cjs/auth-api/storage.d.ts +38 -0
- package/dist/cjs/{auth-storage.cjs → auth-api/storage.js} +17 -7
- package/dist/cjs/auth-api/types.d.ts +34 -0
- package/dist/cjs/auth-api/types.js +2 -0
- package/dist/cjs/index.cjs +41 -7
- package/dist/cjs/index.d.ts +29 -5
- package/dist/cjs/oauth/base.d.ts +10 -0
- package/dist/cjs/oauth/base.js +6 -0
- package/dist/cjs/oauth/memory.d.ts +16 -0
- package/dist/cjs/oauth/memory.js +99 -0
- package/dist/cjs/oauth/models.d.ts +45 -0
- package/dist/cjs/oauth/models.js +58 -0
- package/dist/cjs/oauth/sequelize.d.ts +68 -0
- package/dist/cjs/oauth/sequelize.js +210 -0
- package/dist/cjs/oauth/types.d.ts +50 -0
- package/dist/cjs/oauth/types.js +3 -0
- package/dist/cjs/passkey/base.d.ts +16 -0
- package/dist/cjs/passkey/base.js +6 -0
- package/dist/cjs/passkey/memory.d.ts +27 -0
- package/dist/cjs/passkey/memory.js +86 -0
- package/dist/cjs/passkey/models.d.ts +25 -0
- package/dist/cjs/passkey/models.js +115 -0
- package/dist/cjs/passkey/sequelize.d.ts +55 -0
- package/dist/cjs/passkey/sequelize.js +220 -0
- package/dist/cjs/passkey/service.d.ts +20 -0
- package/dist/cjs/passkey/service.js +356 -0
- package/dist/cjs/passkey/types.d.ts +78 -0
- package/dist/cjs/passkey/types.js +2 -0
- package/dist/cjs/token/base.d.ts +38 -0
- package/dist/cjs/token/base.js +114 -0
- package/dist/cjs/token/memory.d.ts +19 -0
- package/dist/cjs/token/memory.js +149 -0
- package/dist/cjs/token/sequelize.d.ts +58 -0
- package/dist/cjs/token/sequelize.js +404 -0
- package/dist/cjs/token/types.d.ts +27 -0
- package/dist/cjs/token/types.js +2 -0
- package/dist/cjs/user/base.d.ts +26 -0
- package/dist/cjs/user/base.js +45 -0
- package/dist/cjs/user/memory.d.ts +35 -0
- package/dist/cjs/user/memory.js +173 -0
- package/dist/cjs/user/sequelize.d.ts +41 -0
- package/dist/cjs/user/sequelize.js +182 -0
- package/dist/cjs/user/types.d.ts +11 -0
- package/dist/cjs/user/types.js +2 -0
- package/dist/esm/api-server-base.d.ts +91 -34
- package/dist/esm/api-server-base.js +447 -110
- package/dist/esm/auth-api/auth-module.d.ts +105 -0
- package/dist/esm/auth-api/auth-module.js +1178 -0
- package/dist/esm/auth-api/compat-auth-storage.d.ts +57 -0
- package/dist/esm/auth-api/compat-auth-storage.js +124 -0
- package/dist/esm/auth-api/mem-auth-store.d.ts +68 -0
- package/dist/esm/auth-api/mem-auth-store.js +137 -0
- package/dist/esm/{auth-module.d.ts → auth-api/module.d.ts} +7 -7
- package/dist/esm/{auth-module.js → auth-api/module.js} +1 -1
- package/dist/esm/auth-api/sql-auth-store.d.ts +77 -0
- package/dist/esm/auth-api/sql-auth-store.js +168 -0
- package/dist/esm/auth-api/storage.d.ts +38 -0
- package/dist/esm/{auth-storage.js → auth-api/storage.js} +15 -5
- package/dist/esm/auth-api/types.d.ts +34 -0
- package/dist/esm/auth-api/types.js +1 -0
- package/dist/esm/index.d.ts +29 -5
- package/dist/esm/index.js +19 -2
- package/dist/esm/oauth/base.d.ts +10 -0
- package/dist/esm/oauth/base.js +2 -0
- package/dist/esm/oauth/memory.d.ts +16 -0
- package/dist/esm/oauth/memory.js +92 -0
- package/dist/esm/oauth/models.d.ts +45 -0
- package/dist/esm/oauth/models.js +51 -0
- package/dist/esm/oauth/sequelize.d.ts +68 -0
- package/dist/esm/oauth/sequelize.js +199 -0
- package/dist/esm/oauth/types.d.ts +50 -0
- package/dist/esm/oauth/types.js +2 -0
- package/dist/esm/passkey/base.d.ts +16 -0
- package/dist/esm/passkey/base.js +2 -0
- package/dist/esm/passkey/memory.d.ts +27 -0
- package/dist/esm/passkey/memory.js +82 -0
- package/dist/esm/passkey/models.d.ts +25 -0
- package/dist/esm/passkey/models.js +108 -0
- package/dist/esm/passkey/sequelize.d.ts +55 -0
- package/dist/esm/passkey/sequelize.js +216 -0
- package/dist/esm/passkey/service.d.ts +20 -0
- package/dist/esm/passkey/service.js +319 -0
- package/dist/esm/passkey/types.d.ts +78 -0
- package/dist/esm/passkey/types.js +1 -0
- package/dist/esm/token/base.d.ts +38 -0
- package/dist/esm/token/base.js +107 -0
- package/dist/esm/token/memory.d.ts +19 -0
- package/dist/esm/token/memory.js +145 -0
- package/dist/esm/token/sequelize.d.ts +58 -0
- package/dist/esm/token/sequelize.js +400 -0
- package/dist/esm/token/types.d.ts +27 -0
- package/dist/esm/token/types.js +1 -0
- package/dist/esm/user/base.d.ts +26 -0
- package/dist/esm/user/base.js +38 -0
- package/dist/esm/user/memory.d.ts +35 -0
- package/dist/esm/user/memory.js +169 -0
- package/dist/esm/user/sequelize.d.ts +41 -0
- package/dist/esm/user/sequelize.js +176 -0
- package/dist/esm/user/types.d.ts +11 -0
- package/dist/esm/user/types.js +1 -0
- package/package.json +13 -3
- package/dist/cjs/auth-storage.d.ts +0 -133
- package/dist/esm/auth-storage.d.ts +0 -133
|
@@ -4,49 +4,40 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { Application, Request, Response } from 'express';
|
|
8
|
-
import jwt, { JwtPayload, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
7
|
+
import { Application, Request, Response, type ErrorRequestHandler, type RequestHandler } from 'express';
|
|
9
8
|
import { ApiModule } from './api-module.js';
|
|
10
|
-
import type
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
9
|
+
import { TokenStore, type JwtDecodeResult, type JwtSignResult, type JwtVerifyResult } from './token/base.js';
|
|
10
|
+
import type { ApiAuthClass, ApiAuthType, ApiKey } from './api-module.js';
|
|
11
|
+
import type { AuthProviderModule } from './auth-api/module.js';
|
|
12
|
+
import type { AuthAdapter, AuthIdentifier } from './auth-api/types.js';
|
|
13
|
+
import type { OAuthStore } from './oauth/base.js';
|
|
14
|
+
import type { AuthCodeData, AuthCodeRequest, OAuthClient } from './oauth/types.js';
|
|
15
|
+
import type { PasskeyService } from './passkey/service.js';
|
|
16
|
+
import type { PasskeyChallenge, PasskeyChallengeParams, StoredPasskeyCredential, PasskeyVerificationParams, PasskeyVerificationResult } from './passkey/types.js';
|
|
17
|
+
import type { Token } from './token/types.js';
|
|
18
|
+
import type { UserStore } from './user/base.js';
|
|
19
|
+
import type { JwtPayload, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
13
20
|
export type { Application, Request, Response, NextFunction, Router } from 'express';
|
|
14
21
|
export type { Multer } from 'multer';
|
|
15
22
|
export type { JwtPayload, SignOptions, VerifyOptions } from 'jsonwebtoken';
|
|
16
|
-
export interface
|
|
23
|
+
export interface ExtendedReq extends Request {
|
|
17
24
|
file?: Express.Multer.File;
|
|
18
25
|
files?: Express.Multer.File[] | {
|
|
19
26
|
[fieldname: string]: Express.Multer.File[];
|
|
20
27
|
};
|
|
21
28
|
}
|
|
22
|
-
interface
|
|
23
|
-
success: boolean;
|
|
24
|
-
token?: string;
|
|
25
|
-
error?: string;
|
|
26
|
-
}
|
|
27
|
-
interface JwtVerifyResult<T> {
|
|
28
|
-
success: boolean;
|
|
29
|
-
data?: T;
|
|
30
|
-
expired?: boolean;
|
|
31
|
-
error?: string;
|
|
32
|
-
}
|
|
33
|
-
interface JwtDecodeResult<T> {
|
|
34
|
-
success: boolean;
|
|
35
|
-
data?: T;
|
|
36
|
-
error?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface ApiTokenData extends JwtPayload, AuthTokenMetadata {
|
|
29
|
+
export interface ApiTokenData extends JwtPayload, Partial<Token> {
|
|
39
30
|
uid: unknown;
|
|
40
31
|
iat?: number;
|
|
41
32
|
exp?: number;
|
|
42
33
|
}
|
|
43
34
|
export interface ApiRequest {
|
|
44
35
|
server: any;
|
|
45
|
-
req:
|
|
36
|
+
req: ExtendedReq;
|
|
46
37
|
res: Response;
|
|
47
38
|
tokenData?: ApiTokenData | null;
|
|
48
39
|
token?: string;
|
|
49
|
-
authToken?:
|
|
40
|
+
authToken?: Token | null;
|
|
50
41
|
apiKey?: ApiKey | null;
|
|
51
42
|
clientInfo?: ClientInfo;
|
|
52
43
|
realUid?: AuthIdentifier | null;
|
|
@@ -56,6 +47,12 @@ export interface ApiRequest {
|
|
|
56
47
|
getRealUid: () => AuthIdentifier | null;
|
|
57
48
|
isImpersonating: () => boolean;
|
|
58
49
|
}
|
|
50
|
+
export interface ExpressApiRequest extends ExtendedReq {
|
|
51
|
+
apiReq?: ApiRequest;
|
|
52
|
+
}
|
|
53
|
+
export interface ExpressApiLocals {
|
|
54
|
+
apiReq?: ApiRequest;
|
|
55
|
+
}
|
|
59
56
|
export interface ClientAgentProfile {
|
|
60
57
|
ua: string;
|
|
61
58
|
browser: string;
|
|
@@ -66,6 +63,16 @@ export interface ClientInfo extends ClientAgentProfile {
|
|
|
66
63
|
ip: string | null;
|
|
67
64
|
ipchain: string[];
|
|
68
65
|
}
|
|
66
|
+
export interface ApiServerAuthStores {
|
|
67
|
+
userStore: UserStore<any, any>;
|
|
68
|
+
tokenStore: TokenStore;
|
|
69
|
+
passkeyService?: PasskeyService;
|
|
70
|
+
oauthStore?: OAuthStore;
|
|
71
|
+
canImpersonate?: (params: {
|
|
72
|
+
realUserId: AuthIdentifier;
|
|
73
|
+
effectiveUserId: AuthIdentifier;
|
|
74
|
+
}) => boolean | Promise<boolean>;
|
|
75
|
+
}
|
|
69
76
|
export { ApiModule } from './api-module.js';
|
|
70
77
|
export type { ApiHandler, ApiAuthType, ApiAuthClass, ApiRoute, ApiKey } from './api-module.js';
|
|
71
78
|
export interface ApiErrorParams {
|
|
@@ -100,8 +107,11 @@ export interface ApiServerConf {
|
|
|
100
107
|
devMode: boolean;
|
|
101
108
|
hydrateGetBody: boolean;
|
|
102
109
|
validateTokens: boolean;
|
|
110
|
+
refreshMaybe: boolean;
|
|
103
111
|
apiVersion: string;
|
|
104
112
|
minClientVersion: string;
|
|
113
|
+
tokenStore?: TokenStore;
|
|
114
|
+
authStores?: ApiServerAuthStores;
|
|
105
115
|
}
|
|
106
116
|
export declare class ApiServer {
|
|
107
117
|
app: Application;
|
|
@@ -112,33 +122,69 @@ export declare class ApiServer {
|
|
|
112
122
|
private storageAdapter;
|
|
113
123
|
private moduleAdapter;
|
|
114
124
|
private apiNotFoundHandler;
|
|
125
|
+
private tokenStoreAdapter;
|
|
126
|
+
private userStoreAdapter;
|
|
127
|
+
private passkeyServiceAdapter;
|
|
128
|
+
private oauthStoreAdapter;
|
|
129
|
+
private canImpersonateAdapter;
|
|
130
|
+
private readonly jwtHelper;
|
|
115
131
|
constructor(config?: Partial<ApiServerConf>);
|
|
116
|
-
authStorage<UserRow, SafeUser>(storage:
|
|
132
|
+
authStorage<UserRow, SafeUser>(storage: AuthAdapter<UserRow, SafeUser>): this;
|
|
117
133
|
/**
|
|
118
134
|
* @deprecated Use {@link ApiServer.authStorage} instead.
|
|
119
135
|
*/
|
|
120
|
-
useAuthStorage<UserRow, SafeUser>(storage:
|
|
136
|
+
useAuthStorage<UserRow, SafeUser>(storage: AuthAdapter<UserRow, SafeUser>): this;
|
|
121
137
|
authModule<UserRow>(module: AuthProviderModule<UserRow>): this;
|
|
122
138
|
/**
|
|
123
139
|
* @deprecated Use {@link ApiServer.authModule} instead.
|
|
124
140
|
*/
|
|
125
141
|
useAuthModule<UserRow>(module: AuthProviderModule<UserRow>): this;
|
|
126
|
-
getAuthStorage():
|
|
142
|
+
getAuthStorage(): AuthAdapter<any, any>;
|
|
127
143
|
getAuthModule(): AuthProviderModule<any>;
|
|
144
|
+
setTokenStore(store: TokenStore): this;
|
|
145
|
+
getTokenStore(): TokenStore | null;
|
|
146
|
+
private ensureUserStore;
|
|
147
|
+
private ensureTokenStore;
|
|
148
|
+
private ensurePasskeyService;
|
|
149
|
+
listUserCredentials(userId: AuthIdentifier): Promise<StoredPasskeyCredential[]>;
|
|
150
|
+
deletePasskeyCredential(credentialId: Buffer | string): Promise<boolean>;
|
|
151
|
+
private ensureOAuthStore;
|
|
152
|
+
getUser(identifier: AuthIdentifier): Promise<any | null>;
|
|
153
|
+
getUserPasswordHash(user: any): string;
|
|
154
|
+
getUserId(user: any): AuthIdentifier;
|
|
155
|
+
filterUser(user: any): any;
|
|
156
|
+
verifyPassword(password: string, hash: string): Promise<boolean>;
|
|
157
|
+
storeToken(data: Token): Promise<void>;
|
|
158
|
+
getToken(query: Partial<Token> & {
|
|
159
|
+
userId?: AuthIdentifier;
|
|
160
|
+
ruid?: AuthIdentifier;
|
|
161
|
+
}, opts?: {
|
|
162
|
+
includeExpired?: boolean;
|
|
163
|
+
}): Promise<Token | null>;
|
|
164
|
+
deleteToken(query: Partial<Token> & {
|
|
165
|
+
userId?: AuthIdentifier;
|
|
166
|
+
ruid?: AuthIdentifier;
|
|
167
|
+
}): Promise<number>;
|
|
168
|
+
createPasskeyChallenge(params: PasskeyChallengeParams): Promise<PasskeyChallenge>;
|
|
169
|
+
verifyPasskeyResponse(params: PasskeyVerificationParams): Promise<PasskeyVerificationResult>;
|
|
170
|
+
getClient(clientId: string): Promise<OAuthClient | null>;
|
|
171
|
+
verifyClientSecret(client: OAuthClient, clientSecret: string | null): Promise<boolean>;
|
|
172
|
+
createAuthCode(request: AuthCodeRequest): Promise<AuthCodeData>;
|
|
173
|
+
consumeAuthCode(code: string, clientId: string): Promise<AuthCodeData | null>;
|
|
174
|
+
canImpersonate(params: {
|
|
175
|
+
realUserId: AuthIdentifier;
|
|
176
|
+
effectiveUserId: AuthIdentifier;
|
|
177
|
+
}): Promise<boolean>;
|
|
128
178
|
jwtSign(payload: any, secret: string, expiresInSeconds: number, options?: SignOptions): JwtSignResult;
|
|
129
179
|
jwtVerify<T>(token: string, secret: string, options?: VerifyOptions): JwtVerifyResult<T>;
|
|
130
|
-
jwtDecode<T>(token: string, options?:
|
|
180
|
+
jwtDecode<T>(token: string, options?: import('jsonwebtoken').DecodeOptions): JwtDecodeResult<T>;
|
|
131
181
|
getApiKey<T = ApiKey>(token: string): Promise<T | null>;
|
|
132
182
|
authenticateUser(params: {
|
|
133
183
|
login: string;
|
|
134
184
|
password: string;
|
|
135
185
|
}): Promise<boolean>;
|
|
136
|
-
updateToken(updates: {
|
|
137
|
-
accessToken: string;
|
|
186
|
+
updateToken(updates: Partial<Token> & {
|
|
138
187
|
refreshToken: string;
|
|
139
|
-
expires?: Date;
|
|
140
|
-
clientId?: string;
|
|
141
|
-
scope?: string[];
|
|
142
188
|
}): Promise<boolean>;
|
|
143
189
|
guessExceptionText(error: any, defMsg?: string): string;
|
|
144
190
|
protected authorize(apiReq: ApiRequest, requiredClass: ApiAuthClass): Promise<void>;
|
|
@@ -150,6 +196,9 @@ export declare class ApiServer {
|
|
|
150
196
|
private describeMissingEndpoint;
|
|
151
197
|
start(): this;
|
|
152
198
|
private verifyJWT;
|
|
199
|
+
private jwtCookieOptions;
|
|
200
|
+
private setAccessCookie;
|
|
201
|
+
private tryRefreshAccessToken;
|
|
153
202
|
private authenticate;
|
|
154
203
|
private tryAuthenticateApiKey;
|
|
155
204
|
private requiresAuthToken;
|
|
@@ -158,6 +207,14 @@ export declare class ApiServer {
|
|
|
158
207
|
private normalizeAuthIdentifier;
|
|
159
208
|
private extractTokenUserId;
|
|
160
209
|
private resolveRealUserId;
|
|
210
|
+
useExpress(path: string, ...handlers: Array<RequestHandler | ErrorRequestHandler>): this;
|
|
211
|
+
useExpress(...handlers: Array<RequestHandler | ErrorRequestHandler>): this;
|
|
212
|
+
private createApiRequest;
|
|
213
|
+
expressAuth(auth: {
|
|
214
|
+
type: ApiAuthType;
|
|
215
|
+
req: ApiAuthClass;
|
|
216
|
+
}): RequestHandler;
|
|
217
|
+
expressErrorHandler(): ErrorRequestHandler;
|
|
161
218
|
private handle_request;
|
|
162
219
|
api<T extends ApiModule<any>>(module: T): this;
|
|
163
220
|
dumpRequest(apiReq: ApiRequest): void;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type ApiRequest, type ApiRoute, type ApiServer } from '../api-server-base.js';
|
|
2
|
+
import { BaseAuthModule, type AuthProviderModule } from './module.js';
|
|
3
|
+
import type { AuthAdapter, AuthIdentifier } from './types.js';
|
|
4
|
+
import type { OAuthCallbackParams, OAuthCallbackResult, OAuthStartParams, OAuthStartResult } from '../oauth/types.js';
|
|
5
|
+
import type { TokenPair, Token } from '../token/types.js';
|
|
6
|
+
interface CanImpersonateContext<UserEntity> {
|
|
7
|
+
apiReq: ApiRequest;
|
|
8
|
+
realUser: UserEntity;
|
|
9
|
+
realUserId: AuthIdentifier;
|
|
10
|
+
targetUser: UserEntity;
|
|
11
|
+
effectiveUserId: AuthIdentifier;
|
|
12
|
+
}
|
|
13
|
+
interface AuthModuleOptions<UserEntity> {
|
|
14
|
+
namespace?: string;
|
|
15
|
+
defaultDomain?: string;
|
|
16
|
+
canImpersonate?: (context: CanImpersonateContext<UserEntity>) => Promise<boolean> | boolean;
|
|
17
|
+
}
|
|
18
|
+
type TokenMetadata = Partial<Token> & {
|
|
19
|
+
sessionCookie?: boolean;
|
|
20
|
+
};
|
|
21
|
+
interface TokenIssueOptions extends TokenMetadata {
|
|
22
|
+
expires?: Date;
|
|
23
|
+
sessionCookie?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface NormalizedTokenMetadata extends TokenMetadata {
|
|
26
|
+
domain: string;
|
|
27
|
+
fingerprint: string;
|
|
28
|
+
label: string;
|
|
29
|
+
browser: string;
|
|
30
|
+
device: string;
|
|
31
|
+
ip: string;
|
|
32
|
+
os: string;
|
|
33
|
+
}
|
|
34
|
+
type TokenClaims = TokenMetadata & {
|
|
35
|
+
uid: string;
|
|
36
|
+
exp?: number;
|
|
37
|
+
iat?: number;
|
|
38
|
+
};
|
|
39
|
+
type AuthCapableServer<PublicUser> = ApiServer & {
|
|
40
|
+
initiateOAuth?: (params: OAuthStartParams) => Promise<OAuthStartResult>;
|
|
41
|
+
completeOAuth?: (params: OAuthCallbackParams) => Promise<OAuthCallbackResult<PublicUser>>;
|
|
42
|
+
};
|
|
43
|
+
export default class AuthModule<UserEntity, PublicUser> extends BaseAuthModule<UserEntity> implements AuthProviderModule<UserEntity> {
|
|
44
|
+
static defaultNamespace: string;
|
|
45
|
+
server: AuthCapableServer<PublicUser>;
|
|
46
|
+
private readonly defaultDomain?;
|
|
47
|
+
private readonly canImpersonateHook?;
|
|
48
|
+
constructor(options?: AuthModuleOptions<UserEntity>);
|
|
49
|
+
protected get storage(): AuthAdapter<UserEntity, PublicUser>;
|
|
50
|
+
protected canImpersonate(apiReq: ApiRequest, realUser: UserEntity, targetUser: UserEntity): Promise<boolean>;
|
|
51
|
+
protected ensureImpersonationAllowed(apiReq: ApiRequest, realUser: UserEntity, targetUser: UserEntity): Promise<void>;
|
|
52
|
+
protected buildTokenPayload(user: UserEntity, metadata?: TokenMetadata): TokenClaims;
|
|
53
|
+
protected buildTokenMetadata(metadata?: TokenMetadata): NormalizedTokenMetadata;
|
|
54
|
+
protected enrichTokenMetadata(apiReq: ApiRequest, metadata?: TokenMetadata): TokenMetadata;
|
|
55
|
+
private sessionRefreshTtlSeconds;
|
|
56
|
+
private normalizeRefreshTtlSeconds;
|
|
57
|
+
private resolveSessionPreferences;
|
|
58
|
+
private mergeSessionPreferences;
|
|
59
|
+
private sessionPrefsFromRecord;
|
|
60
|
+
private validateCredentialId;
|
|
61
|
+
private normalizeCredentialId;
|
|
62
|
+
private toIsoDate;
|
|
63
|
+
private cookieOptions;
|
|
64
|
+
private setJwtCookies;
|
|
65
|
+
issueTokens(apiReq: ApiRequest, user: UserEntity, metadata?: TokenIssueOptions): Promise<TokenPair>;
|
|
66
|
+
private assertAuthReady;
|
|
67
|
+
private parseLoginBody;
|
|
68
|
+
private parseImpersonationRequest;
|
|
69
|
+
private resolveImpersonationIdentifier;
|
|
70
|
+
private buildImpersonationMetadata;
|
|
71
|
+
private getUserOrThrow;
|
|
72
|
+
private getRealUserIdentifier;
|
|
73
|
+
private resolveActorContext;
|
|
74
|
+
private extractRefreshToken;
|
|
75
|
+
private normalizeScope;
|
|
76
|
+
private postLogin;
|
|
77
|
+
private postRefresh;
|
|
78
|
+
private postLogout;
|
|
79
|
+
private postWhoAmI;
|
|
80
|
+
private postPasskeyChallenge;
|
|
81
|
+
private postPasskeyVerify;
|
|
82
|
+
private getPasskeys;
|
|
83
|
+
private deletePasskey;
|
|
84
|
+
private postImpersonation;
|
|
85
|
+
private deleteImpersonation;
|
|
86
|
+
private getUserFromPasskey;
|
|
87
|
+
private postOAuthStart;
|
|
88
|
+
private postOAuthCallback;
|
|
89
|
+
private postOAuthAuthorize;
|
|
90
|
+
private postOAuthToken;
|
|
91
|
+
private handleAuthorizationCodeGrant;
|
|
92
|
+
private handleRefreshTokenGrant;
|
|
93
|
+
private clearOAuthCookies;
|
|
94
|
+
private buildTokenResponse;
|
|
95
|
+
private resolveScope;
|
|
96
|
+
private resolveClientAuthentication;
|
|
97
|
+
private assertRedirectUriAllowed;
|
|
98
|
+
private resolveUserForOAuth;
|
|
99
|
+
private hasPasskeyService;
|
|
100
|
+
private hasOAuthStore;
|
|
101
|
+
private storageImplements;
|
|
102
|
+
private storageImplementsAll;
|
|
103
|
+
defineRoutes(): ApiRoute[];
|
|
104
|
+
}
|
|
105
|
+
export {};
|