@spfn/auth 0.2.0-beta.12 → 0.2.0-beta.14
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 +46 -2
- package/dist/{authenticate-xfEpwIjH.d.ts → authenticate-CriFdelv.d.ts} +12 -2
- package/dist/config.d.ts +16 -0
- package/dist/config.js +11 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/nextjs/client.d.ts +28 -0
- package/dist/server.d.ts +49 -49
- package/dist/server.js +39 -5
- package/dist/server.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @spfn/auth - Technical Documentation
|
|
2
2
|
|
|
3
|
-
**Version:** 0.2.0-beta.
|
|
3
|
+
**Version:** 0.2.0-beta.13
|
|
4
4
|
**Status:** Alpha - Internal Development
|
|
5
5
|
|
|
6
6
|
> **Note:** This is a technical documentation for developers working on the @spfn/auth package.
|
|
@@ -138,6 +138,7 @@ SPFN_AUTH_GOOGLE_CLIENT_SECRET=GOCSPX-...
|
|
|
138
138
|
SPFN_APP_URL=http://localhost:3000
|
|
139
139
|
|
|
140
140
|
# Google OAuth (Optional)
|
|
141
|
+
SPFN_AUTH_GOOGLE_SCOPES=email,profile,https://www.googleapis.com/auth/gmail.readonly
|
|
141
142
|
SPFN_AUTH_GOOGLE_REDIRECT_URI=http://localhost:8790/_auth/oauth/google/callback
|
|
142
143
|
SPFN_AUTH_OAUTH_SUCCESS_URL=/auth/callback
|
|
143
144
|
SPFN_AUTH_OAUTH_ERROR_URL=http://localhost:3000/auth/error?error={error}
|
|
@@ -583,6 +584,9 @@ import {
|
|
|
583
584
|
// User Profile
|
|
584
585
|
getUserProfileService,
|
|
585
586
|
updateUserProfileService,
|
|
587
|
+
|
|
588
|
+
// OAuth - Google API Access
|
|
589
|
+
getGoogleAccessToken,
|
|
586
590
|
} from '@spfn/auth/server';
|
|
587
591
|
```
|
|
588
592
|
|
|
@@ -1127,6 +1131,7 @@ SPFN_AUTH_GOOGLE_CLIENT_SECRET=GOCSPX-your-secret
|
|
|
1127
1131
|
SPFN_APP_URL=http://localhost:3000
|
|
1128
1132
|
|
|
1129
1133
|
# Optional
|
|
1134
|
+
SPFN_AUTH_GOOGLE_SCOPES=email,profile # default (comma-separated)
|
|
1130
1135
|
SPFN_AUTH_GOOGLE_REDIRECT_URI=http://localhost:8790/_auth/oauth/google/callback # default
|
|
1131
1136
|
SPFN_AUTH_OAUTH_SUCCESS_URL=/auth/callback # default
|
|
1132
1137
|
```
|
|
@@ -1243,6 +1248,45 @@ OAuth 세션 완료. 인터셉터가 pending session에서 full session을 생
|
|
|
1243
1248
|
|
|
1244
1249
|
---
|
|
1245
1250
|
|
|
1251
|
+
### Google API Access
|
|
1252
|
+
|
|
1253
|
+
OAuth 로그인 후 저장된 access token으로 Google API를 호출할 수 있습니다.
|
|
1254
|
+
|
|
1255
|
+
#### Custom Scopes 설정
|
|
1256
|
+
|
|
1257
|
+
`SPFN_AUTH_GOOGLE_SCOPES` 환경변수로 추가 스코프를 요청합니다. 미설정 시 `email,profile`이 기본값입니다.
|
|
1258
|
+
|
|
1259
|
+
```bash
|
|
1260
|
+
# Gmail + Calendar 읽기 권한 추가
|
|
1261
|
+
SPFN_AUTH_GOOGLE_SCOPES=email,profile,https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/calendar.readonly
|
|
1262
|
+
```
|
|
1263
|
+
|
|
1264
|
+
> **Note:** Google Cloud Console에서 해당 API를 활성화해야 합니다.
|
|
1265
|
+
|
|
1266
|
+
#### Access Token 사용
|
|
1267
|
+
|
|
1268
|
+
`getGoogleAccessToken(userId)`은 유효한 access token을 반환합니다. 토큰이 만료 임박(5분 이내) 또는 만료 상태이면 자동으로 refresh token을 사용하여 갱신합니다.
|
|
1269
|
+
|
|
1270
|
+
```typescript
|
|
1271
|
+
import { getGoogleAccessToken } from '@spfn/auth/server';
|
|
1272
|
+
|
|
1273
|
+
// 항상 유효한 토큰 반환 (만료 시 자동 갱신)
|
|
1274
|
+
const token = await getGoogleAccessToken(userId);
|
|
1275
|
+
|
|
1276
|
+
// Gmail API 호출
|
|
1277
|
+
const response = await fetch(
|
|
1278
|
+
'https://gmail.googleapis.com/gmail/v1/users/me/messages?maxResults=10',
|
|
1279
|
+
{ headers: { Authorization: `Bearer ${token}` } }
|
|
1280
|
+
);
|
|
1281
|
+
const data = await response.json();
|
|
1282
|
+
```
|
|
1283
|
+
|
|
1284
|
+
**에러 케이스:**
|
|
1285
|
+
- Google 계정 미연결 → `'No Google account linked'`
|
|
1286
|
+
- Refresh token 없음 → `'Google refresh token not available'` (재로그인 필요)
|
|
1287
|
+
|
|
1288
|
+
---
|
|
1289
|
+
|
|
1246
1290
|
### Security
|
|
1247
1291
|
|
|
1248
1292
|
- **State 암호화**: JWE (A256GCM)로 state 파라미터 암호화. CSRF 방지용 nonce 포함.
|
|
@@ -2246,4 +2290,4 @@ MIT License - See LICENSE file for details.
|
|
|
2246
2290
|
|
|
2247
2291
|
**Last Updated:** 2026-01-27
|
|
2248
2292
|
**Document Version:** 2.4.0 (Technical Documentation)
|
|
2249
|
-
**Package Version:** 0.2.0-beta.
|
|
2293
|
+
**Package Version:** 0.2.0-beta.13
|
|
@@ -432,6 +432,16 @@ declare function isOAuthProviderEnabled(provider: SocialProvider): boolean;
|
|
|
432
432
|
* 활성화된 모든 OAuth provider 목록
|
|
433
433
|
*/
|
|
434
434
|
declare function getEnabledOAuthProviders(): SocialProvider[];
|
|
435
|
+
/**
|
|
436
|
+
* Google access token 조회 (만료 시 자동 리프레시)
|
|
437
|
+
*
|
|
438
|
+
* 저장된 토큰이 만료 임박(5분 이내) 또는 만료 상태이면
|
|
439
|
+
* refresh token으로 자동 갱신 후 DB 업데이트하여 유효한 토큰 반환.
|
|
440
|
+
*
|
|
441
|
+
* @param userId - 사용자 ID
|
|
442
|
+
* @returns 유효한 Google access token
|
|
443
|
+
*/
|
|
444
|
+
declare function getGoogleAccessToken(userId: number): Promise<string>;
|
|
435
445
|
|
|
436
446
|
/**
|
|
437
447
|
* @spfn/auth - Main Router
|
|
@@ -530,7 +540,7 @@ declare const mainAuthRouter: _spfn_core_route.Router<{
|
|
|
530
540
|
id: number;
|
|
531
541
|
name: string;
|
|
532
542
|
displayName: string;
|
|
533
|
-
category: "
|
|
543
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
534
544
|
}[];
|
|
535
545
|
userId: number;
|
|
536
546
|
email: string | null;
|
|
@@ -744,4 +754,4 @@ declare module 'hono' {
|
|
|
744
754
|
*/
|
|
745
755
|
declare const authenticate: _spfn_core_route.NamedMiddleware<"auth">;
|
|
746
756
|
|
|
747
|
-
export { getEnabledOAuthProviders as $, type AuthSession as A, type ChangePasswordParams as B, type CheckAccountExistsResult as C, sendVerificationCodeService as D, verifyCodeService as E, type SendVerificationCodeParams as F, type VerifyCodeParams as G, type VerifyCodeResult as H, INVITATION_STATUSES as I, registerPublicKeyService as J, KEY_ALGORITHM as K, type LoginResult as L, rotateKeyService as M, revokeKeyService as N, type OAuthStartResult as O, type PermissionConfig as P, type RegisterPublicKeyParams as Q, type RoleConfig as R, type SendVerificationCodeResult as S, type RotateKeyParams as T, type UserProfile as U, type VerificationTargetType as V, type RevokeKeyParams as W, oauthStartService as X, oauthCallbackService as Y, buildOAuthErrorUrl as Z, isOAuthProviderEnabled as _, type RegisterResult as a, type OAuthStartParams as
|
|
757
|
+
export { getEnabledOAuthProviders as $, type AuthSession as A, type ChangePasswordParams as B, type CheckAccountExistsResult as C, sendVerificationCodeService as D, verifyCodeService as E, type SendVerificationCodeParams as F, type VerifyCodeParams as G, type VerifyCodeResult as H, INVITATION_STATUSES as I, registerPublicKeyService as J, KEY_ALGORITHM as K, type LoginResult as L, rotateKeyService as M, revokeKeyService as N, type OAuthStartResult as O, type PermissionConfig as P, type RegisterPublicKeyParams as Q, type RoleConfig as R, type SendVerificationCodeResult as S, type RotateKeyParams as T, type UserProfile as U, type VerificationTargetType as V, type RevokeKeyParams as W, oauthStartService as X, oauthCallbackService as Y, buildOAuthErrorUrl as Z, isOAuthProviderEnabled as _, type RegisterResult as a, getGoogleAccessToken as a0, type OAuthStartParams as a1, type OAuthCallbackParams as a2, type OAuthCallbackResult as a3, authenticate as a4, EmailSchema as a5, PhoneSchema as a6, PasswordSchema as a7, TargetTypeSchema as a8, VerificationPurposeSchema as a9, type RotateKeyResult as b, type ProfileInfo as c, USER_STATUSES as d, SOCIAL_PROVIDERS as e, type VerificationPurpose as f, VERIFICATION_TARGET_TYPES as g, VERIFICATION_PURPOSES as h, PERMISSION_CATEGORIES as i, type PermissionCategory as j, type AuthInitOptions as k, type KeyAlgorithmType as l, mainAuthRouter as m, type InvitationStatus as n, type UserStatus as o, type SocialProvider as p, type AuthContext as q, checkAccountExistsService as r, registerService as s, loginService as t, logoutService as u, changePasswordService as v, type CheckAccountExistsParams as w, type RegisterParams as x, type LoginParams as y, type LogoutParams as z };
|
package/dist/config.d.ts
CHANGED
|
@@ -240,6 +240,14 @@ declare const authEnvSchema: {
|
|
|
240
240
|
} & {
|
|
241
241
|
key: "SPFN_AUTH_GOOGLE_CLIENT_SECRET";
|
|
242
242
|
};
|
|
243
|
+
SPFN_AUTH_GOOGLE_SCOPES: {
|
|
244
|
+
description: string;
|
|
245
|
+
required: boolean;
|
|
246
|
+
examples: string[];
|
|
247
|
+
type: "string";
|
|
248
|
+
} & {
|
|
249
|
+
key: "SPFN_AUTH_GOOGLE_SCOPES";
|
|
250
|
+
};
|
|
243
251
|
SPFN_AUTH_GOOGLE_REDIRECT_URI: {
|
|
244
252
|
description: string;
|
|
245
253
|
required: boolean;
|
|
@@ -482,6 +490,14 @@ declare const env: _spfn_core_env.InferEnvType<{
|
|
|
482
490
|
} & {
|
|
483
491
|
key: "SPFN_AUTH_GOOGLE_CLIENT_SECRET";
|
|
484
492
|
};
|
|
493
|
+
SPFN_AUTH_GOOGLE_SCOPES: {
|
|
494
|
+
description: string;
|
|
495
|
+
required: boolean;
|
|
496
|
+
examples: string[];
|
|
497
|
+
type: "string";
|
|
498
|
+
} & {
|
|
499
|
+
key: "SPFN_AUTH_GOOGLE_SCOPES";
|
|
500
|
+
};
|
|
485
501
|
SPFN_AUTH_GOOGLE_REDIRECT_URI: {
|
|
486
502
|
description: string;
|
|
487
503
|
required: boolean;
|
package/dist/config.js
CHANGED
|
@@ -261,6 +261,17 @@ var authEnvSchema = defineEnvSchema({
|
|
|
261
261
|
examples: ["GOCSPX-abcdefghijklmnop"]
|
|
262
262
|
})
|
|
263
263
|
},
|
|
264
|
+
SPFN_AUTH_GOOGLE_SCOPES: {
|
|
265
|
+
...envString({
|
|
266
|
+
description: 'Comma-separated Google OAuth scopes. Defaults to "email,profile" if not set.',
|
|
267
|
+
required: false,
|
|
268
|
+
examples: [
|
|
269
|
+
"email,profile",
|
|
270
|
+
"email,profile,https://www.googleapis.com/auth/gmail.readonly",
|
|
271
|
+
"email,profile,https://www.googleapis.com/auth/calendar.readonly"
|
|
272
|
+
]
|
|
273
|
+
})
|
|
274
|
+
},
|
|
264
275
|
SPFN_AUTH_GOOGLE_REDIRECT_URI: {
|
|
265
276
|
...envString({
|
|
266
277
|
description: "Google OAuth callback URL. Defaults to {SPFN_API_URL}/_auth/oauth/google/callback",
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["/**\n * Core Package Configuration\n *\n * @example\n * ```typescript\n * import { registry } from '@spfn/core/config';\n *\n * const env = registry.validate();\n * console.log(env.DB_POOL_MAX);\n * ```\n *\n * @module config\n */\n\nimport { createEnvRegistry } from '@spfn/core/env';\nimport { authEnvSchema } from './schema';\n\nexport { authEnvSchema as envSchema } from './schema';\n\n/**\n * Environment registry\n */\nconst registry = createEnvRegistry(authEnvSchema);\nexport const env = registry.validate();","/**\n * Auth Environment Variable Schema\n *\n * Centralized schema definition for all environment variables used in @spfn/auth.\n * This provides type safety, validation, and documentation for Auth configuration.\n *\n * @module config/schema\n */\n\nimport {\n defineEnvSchema,\n envString,\n envNumber,\n createSecureSecretParser,\n createPasswordParser,\n} from '@spfn/core/env';\n\n/**\n * Auth environment variable schema\n *\n * Defines all Auth environment variables with:\n * - Type information\n * - Default values\n * - Validation rules\n * - Documentation\n *\n * @example\n * ```typescript\n * import { authEnvSchema } from '@spfn/auth/config';\n *\n * // Access schema information\n * console.log(authEnvSchema.SPFN_AUTH_SESSION_SECRET.description);\n * console.log(authEnvSchema.SPFN_AUTH_JWT_EXPIRES_IN.default);\n * ```\n */\nexport const authEnvSchema = defineEnvSchema({\n // ============================================================================\n // Session Configuration\n // ============================================================================\n SPFN_AUTH_SESSION_SECRET: {\n ...envString({\n description: 'Session encryption secret (minimum 32 characters for AES-256)',\n required: true,\n fallbackKeys: ['SESSION_SECRET'],\n validator: createSecureSecretParser({\n minLength: 32,\n minUniqueChars: 16,\n minEntropy: 3.5,\n }),\n sensitive: true,\n nextjs: true, // Required for Next.js RSC session validation\n examples: [\n 'my-super-secret-session-key-at-least-32-chars-long',\n 'use-a-cryptographically-secure-random-string-here',\n ],\n }),\n },\n\n SPFN_AUTH_SESSION_TTL: {\n ...envString({\n description: 'Session TTL (time to live) - supports duration strings like \\'7d\\', \\'12h\\', \\'45m\\'',\n default: '7d',\n required: false,\n nextjs: true, // May be needed for session validation in Next.js RSC\n examples: ['7d', '30d', '12h', '45m', '3600'],\n }),\n },\n\n // ============================================================================\n // JWT Configuration\n // ============================================================================\n SPFN_AUTH_JWT_SECRET: {\n ...envString({\n description: 'JWT signing secret for server-signed tokens (legacy mode)',\n default: 'dev-secret-key-change-in-production',\n required: false,\n examples: [\n 'your-jwt-secret-key-here',\n 'use-different-from-session-secret',\n ],\n }),\n },\n\n SPFN_AUTH_JWT_EXPIRES_IN: {\n ...envString({\n description: 'JWT token expiration time (e.g., \\'7d\\', \\'24h\\', \\'1h\\')',\n default: '7d',\n required: false,\n examples: ['7d', '24h', '1h', '30m'],\n }),\n },\n\n // ============================================================================\n // Security Configuration\n // ============================================================================\n SPFN_AUTH_BCRYPT_SALT_ROUNDS: {\n ...envNumber({\n description: 'Bcrypt salt rounds (cost factor, higher = more secure but slower)',\n default: 10,\n required: false,\n examples: [10, 12, 14],\n }),\n key: 'SPFN_AUTH_BCRYPT_SALT_ROUNDS',\n },\n\n SPFN_AUTH_VERIFICATION_TOKEN_SECRET: {\n ...envString({\n description: 'Verification token secret for email verification, password reset, etc.',\n required: true,\n examples: [\n 'your-verification-token-secret',\n 'can-be-different-from-jwt-secret',\n ],\n }),\n },\n\n // ============================================================================\n // Admin Account Configuration\n // ============================================================================\n SPFN_AUTH_ADMIN_ACCOUNTS: {\n ...envString({\n description: 'JSON array of admin accounts (recommended for multiple admins)',\n required: false,\n examples: [\n '[{\"email\":\"admin@example.com\",\"password\":\"secure-pass\",\"role\":\"admin\"}]',\n '[{\"email\":\"super@example.com\",\"password\":\"pass1\",\"role\":\"superadmin\"},{\"email\":\"admin@example.com\",\"password\":\"pass2\",\"role\":\"admin\"}]',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAILS: {\n ...envString({\n description: 'Comma-separated list of admin emails (legacy CSV format)',\n required: false,\n examples: [\n 'admin@example.com,user@example.com',\n 'super@example.com,admin@example.com,user@example.com',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORDS: {\n ...envString({\n description: 'Comma-separated list of admin passwords (legacy CSV format)',\n required: false,\n examples: [\n 'admin-pass,user-pass',\n 'super-pass,admin-pass,user-pass',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_ROLES: {\n ...envString({\n description: 'Comma-separated list of admin roles (legacy CSV format)',\n required: false,\n examples: [\n 'admin,user',\n 'superadmin,admin,user',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAIL: {\n ...envString({\n description: 'Single admin email (simplest format)',\n required: false,\n examples: ['admin@example.com'],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORD: {\n ...envString({\n description: 'Single admin password (simplest format)',\n required: false,\n validator: createPasswordParser({\n minLength: 8,\n requireUppercase: true,\n requireLowercase: true,\n requireNumber: true,\n requireSpecial: true,\n }),\n sensitive: true,\n examples: ['SecureAdmin123!'],\n }),\n },\n\n // ============================================================================\n // API Configuration\n // ============================================================================\n SPFN_API_URL: {\n ...envString({\n description: 'Base API URL for invitation links and other external-facing URLs',\n default: 'http://localhost:8790',\n required: false,\n examples: [\n 'https://api.example.com',\n 'http://localhost:8790',\n ],\n }),\n },\n\n // ============================================================================\n // AWS SNS Configuration (SMS)\n // ============================================================================\n SPFN_AUTH_AWS_REGION: {\n ...envString({\n description: 'AWS region for SNS service',\n default: 'ap-northeast-2',\n required: false,\n examples: ['ap-northeast-2', 'us-east-1', 'eu-west-1'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SNS access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SNS secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SENDER_ID: {\n ...envString({\n description: 'SMS sender ID displayed to recipients (max 11 characters, alphanumeric)',\n required: false,\n examples: ['MyApp', 'YourBrand'],\n }),\n },\n\n // ============================================================================\n // AWS SES Configuration (Email)\n // ============================================================================\n SPFN_AUTH_AWS_SES_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SES access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SES secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_EMAIL: {\n ...envString({\n description: 'Sender email address (must be verified in AWS SES)',\n required: false,\n examples: ['noreply@example.com', 'auth@yourdomain.com'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_NAME: {\n ...envString({\n description: 'Sender display name',\n required: false,\n examples: ['MyApp', 'Your Company'],\n }),\n },\n\n SPFN_APP_URL: {\n ...envString({\n description: 'Next.js application URL. Used for OAuth callback redirects.',\n default: 'http://localhost:3000',\n required: false,\n examples: [\n 'https://app.example.com',\n 'http://localhost:3000',\n ],\n }),\n },\n\n // ============================================================================\n // OAuth Configuration - Google\n // ============================================================================\n SPFN_AUTH_GOOGLE_CLIENT_ID: {\n ...envString({\n description: 'Google OAuth 2.0 Client ID. When set, Google OAuth routes are automatically enabled.',\n required: false,\n examples: ['123456789-abc123.apps.googleusercontent.com'],\n }),\n },\n\n SPFN_AUTH_GOOGLE_CLIENT_SECRET: {\n ...envString({\n description: 'Google OAuth 2.0 Client Secret',\n required: false,\n sensitive: true,\n examples: ['GOCSPX-abcdefghijklmnop'],\n }),\n },\n\n SPFN_AUTH_GOOGLE_REDIRECT_URI: {\n ...envString({\n description: 'Google OAuth callback URL. Defaults to {SPFN_API_URL}/_auth/oauth/google/callback',\n required: false,\n examples: [\n 'https://api.example.com/_auth/oauth/google/callback',\n 'http://localhost:8790/_auth/oauth/google/callback',\n ],\n }),\n },\n\n SPFN_AUTH_OAUTH_SUCCESS_URL: {\n ...envString({\n description: 'OAuth callback page URL. This page should use OAuthCallback component to finalize session.',\n required: false,\n default: '/auth/callback',\n examples: [\n '/auth/callback',\n 'https://app.example.com/auth/callback',\n ],\n }),\n },\n\n SPFN_AUTH_OAUTH_ERROR_URL: {\n ...envString({\n description: 'URL to redirect after OAuth error. Use {error} placeholder for error message.',\n required: false,\n default: 'http://localhost:3000/auth/error?error={error}',\n examples: [\n 'https://app.example.com/auth/error?error={error}',\n 'http://localhost:3000/auth/error?error={error}',\n ],\n }),\n },\n});"],"mappings":";AAcA,SAAS,yBAAyB;;;ACLlC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAoBA,IAAM,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIzC,0BAA0B;AAAA,IACtB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,cAAc,CAAC,gBAAgB;AAAA,MAC/B,WAAW,yBAAyB;AAAA,QAChC,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,YAAY;AAAA,MAChB,CAAC;AAAA,MACD,WAAW;AAAA,MACX,QAAQ;AAAA;AAAA,MACR,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEA,uBAAuB;AAAA,IACnB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA;AAAA,MACR,UAAU,CAAC,MAAM,OAAO,OAAO,OAAO,MAAM;AAAA,IAChD,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKA,sBAAsB;AAAA,IAClB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEA,0BAA0B;AAAA,IACtB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU,CAAC,MAAM,OAAO,MAAM,KAAK;AAAA,IACvC,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA,EAKA,8BAA8B;AAAA,IAC1B,GAAG,UAAU;AAAA,MAC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AAAA,MACb,UAAU;AAAA,MACV,SAAS;AAAA,MACT,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MACJ;AAAA,IACJ,CAAC;AAAA,EACL;AACJ,CAAC;;;ADjUD,IAAM,WAAW,kBAAkB,aAAa;AACzC,IAAM,MAAM,SAAS,SAAS;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/config/index.ts","../src/config/schema.ts"],"sourcesContent":["/**\n * Core Package Configuration\n *\n * @example\n * ```typescript\n * import { registry } from '@spfn/core/config';\n *\n * const env = registry.validate();\n * console.log(env.DB_POOL_MAX);\n * ```\n *\n * @module config\n */\n\nimport { createEnvRegistry } from '@spfn/core/env';\nimport { authEnvSchema } from './schema';\n\nexport { authEnvSchema as envSchema } from './schema';\n\n/**\n * Environment registry\n */\nconst registry = createEnvRegistry(authEnvSchema);\nexport const env = registry.validate();","/**\n * Auth Environment Variable Schema\n *\n * Centralized schema definition for all environment variables used in @spfn/auth.\n * This provides type safety, validation, and documentation for Auth configuration.\n *\n * @module config/schema\n */\n\nimport {\n defineEnvSchema,\n envString,\n envNumber,\n createSecureSecretParser,\n createPasswordParser,\n} from '@spfn/core/env';\n\n/**\n * Auth environment variable schema\n *\n * Defines all Auth environment variables with:\n * - Type information\n * - Default values\n * - Validation rules\n * - Documentation\n *\n * @example\n * ```typescript\n * import { authEnvSchema } from '@spfn/auth/config';\n *\n * // Access schema information\n * console.log(authEnvSchema.SPFN_AUTH_SESSION_SECRET.description);\n * console.log(authEnvSchema.SPFN_AUTH_JWT_EXPIRES_IN.default);\n * ```\n */\nexport const authEnvSchema = defineEnvSchema({\n // ============================================================================\n // Session Configuration\n // ============================================================================\n SPFN_AUTH_SESSION_SECRET: {\n ...envString({\n description: 'Session encryption secret (minimum 32 characters for AES-256)',\n required: true,\n fallbackKeys: ['SESSION_SECRET'],\n validator: createSecureSecretParser({\n minLength: 32,\n minUniqueChars: 16,\n minEntropy: 3.5,\n }),\n sensitive: true,\n nextjs: true, // Required for Next.js RSC session validation\n examples: [\n 'my-super-secret-session-key-at-least-32-chars-long',\n 'use-a-cryptographically-secure-random-string-here',\n ],\n }),\n },\n\n SPFN_AUTH_SESSION_TTL: {\n ...envString({\n description: 'Session TTL (time to live) - supports duration strings like \\'7d\\', \\'12h\\', \\'45m\\'',\n default: '7d',\n required: false,\n nextjs: true, // May be needed for session validation in Next.js RSC\n examples: ['7d', '30d', '12h', '45m', '3600'],\n }),\n },\n\n // ============================================================================\n // JWT Configuration\n // ============================================================================\n SPFN_AUTH_JWT_SECRET: {\n ...envString({\n description: 'JWT signing secret for server-signed tokens (legacy mode)',\n default: 'dev-secret-key-change-in-production',\n required: false,\n examples: [\n 'your-jwt-secret-key-here',\n 'use-different-from-session-secret',\n ],\n }),\n },\n\n SPFN_AUTH_JWT_EXPIRES_IN: {\n ...envString({\n description: 'JWT token expiration time (e.g., \\'7d\\', \\'24h\\', \\'1h\\')',\n default: '7d',\n required: false,\n examples: ['7d', '24h', '1h', '30m'],\n }),\n },\n\n // ============================================================================\n // Security Configuration\n // ============================================================================\n SPFN_AUTH_BCRYPT_SALT_ROUNDS: {\n ...envNumber({\n description: 'Bcrypt salt rounds (cost factor, higher = more secure but slower)',\n default: 10,\n required: false,\n examples: [10, 12, 14],\n }),\n key: 'SPFN_AUTH_BCRYPT_SALT_ROUNDS',\n },\n\n SPFN_AUTH_VERIFICATION_TOKEN_SECRET: {\n ...envString({\n description: 'Verification token secret for email verification, password reset, etc.',\n required: true,\n examples: [\n 'your-verification-token-secret',\n 'can-be-different-from-jwt-secret',\n ],\n }),\n },\n\n // ============================================================================\n // Admin Account Configuration\n // ============================================================================\n SPFN_AUTH_ADMIN_ACCOUNTS: {\n ...envString({\n description: 'JSON array of admin accounts (recommended for multiple admins)',\n required: false,\n examples: [\n '[{\"email\":\"admin@example.com\",\"password\":\"secure-pass\",\"role\":\"admin\"}]',\n '[{\"email\":\"super@example.com\",\"password\":\"pass1\",\"role\":\"superadmin\"},{\"email\":\"admin@example.com\",\"password\":\"pass2\",\"role\":\"admin\"}]',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAILS: {\n ...envString({\n description: 'Comma-separated list of admin emails (legacy CSV format)',\n required: false,\n examples: [\n 'admin@example.com,user@example.com',\n 'super@example.com,admin@example.com,user@example.com',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORDS: {\n ...envString({\n description: 'Comma-separated list of admin passwords (legacy CSV format)',\n required: false,\n examples: [\n 'admin-pass,user-pass',\n 'super-pass,admin-pass,user-pass',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_ROLES: {\n ...envString({\n description: 'Comma-separated list of admin roles (legacy CSV format)',\n required: false,\n examples: [\n 'admin,user',\n 'superadmin,admin,user',\n ],\n }),\n },\n\n SPFN_AUTH_ADMIN_EMAIL: {\n ...envString({\n description: 'Single admin email (simplest format)',\n required: false,\n examples: ['admin@example.com'],\n }),\n },\n\n SPFN_AUTH_ADMIN_PASSWORD: {\n ...envString({\n description: 'Single admin password (simplest format)',\n required: false,\n validator: createPasswordParser({\n minLength: 8,\n requireUppercase: true,\n requireLowercase: true,\n requireNumber: true,\n requireSpecial: true,\n }),\n sensitive: true,\n examples: ['SecureAdmin123!'],\n }),\n },\n\n // ============================================================================\n // API Configuration\n // ============================================================================\n SPFN_API_URL: {\n ...envString({\n description: 'Base API URL for invitation links and other external-facing URLs',\n default: 'http://localhost:8790',\n required: false,\n examples: [\n 'https://api.example.com',\n 'http://localhost:8790',\n ],\n }),\n },\n\n // ============================================================================\n // AWS SNS Configuration (SMS)\n // ============================================================================\n SPFN_AUTH_AWS_REGION: {\n ...envString({\n description: 'AWS region for SNS service',\n default: 'ap-northeast-2',\n required: false,\n examples: ['ap-northeast-2', 'us-east-1', 'eu-west-1'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SNS access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SNS secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SNS_SENDER_ID: {\n ...envString({\n description: 'SMS sender ID displayed to recipients (max 11 characters, alphanumeric)',\n required: false,\n examples: ['MyApp', 'YourBrand'],\n }),\n },\n\n // ============================================================================\n // AWS SES Configuration (Email)\n // ============================================================================\n SPFN_AUTH_AWS_SES_ACCESS_KEY_ID: {\n ...envString({\n description: 'AWS SES access key ID (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['AKIAIOSFODNN7EXAMPLE'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_SECRET_ACCESS_KEY: {\n ...envString({\n description: 'AWS SES secret access key (optional, uses default credentials chain if not provided)',\n required: false,\n sensitive: true,\n examples: ['wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_EMAIL: {\n ...envString({\n description: 'Sender email address (must be verified in AWS SES)',\n required: false,\n examples: ['noreply@example.com', 'auth@yourdomain.com'],\n }),\n },\n\n SPFN_AUTH_AWS_SES_FROM_NAME: {\n ...envString({\n description: 'Sender display name',\n required: false,\n examples: ['MyApp', 'Your Company'],\n }),\n },\n\n SPFN_APP_URL: {\n ...envString({\n description: 'Next.js application URL. Used for OAuth callback redirects.',\n default: 'http://localhost:3000',\n required: false,\n examples: [\n 'https://app.example.com',\n 'http://localhost:3000',\n ],\n }),\n },\n\n // ============================================================================\n // OAuth Configuration - Google\n // ============================================================================\n SPFN_AUTH_GOOGLE_CLIENT_ID: {\n ...envString({\n description: 'Google OAuth 2.0 Client ID. When set, Google OAuth routes are automatically enabled.',\n required: false,\n examples: ['123456789-abc123.apps.googleusercontent.com'],\n }),\n },\n\n SPFN_AUTH_GOOGLE_CLIENT_SECRET: {\n ...envString({\n description: 'Google OAuth 2.0 Client Secret',\n required: false,\n sensitive: true,\n examples: ['GOCSPX-abcdefghijklmnop'],\n }),\n },\n\n SPFN_AUTH_GOOGLE_SCOPES: {\n ...envString({\n description: 'Comma-separated Google OAuth scopes. Defaults to \"email,profile\" if not set.',\n required: false,\n examples: [\n 'email,profile',\n 'email,profile,https://www.googleapis.com/auth/gmail.readonly',\n 'email,profile,https://www.googleapis.com/auth/calendar.readonly',\n ],\n }),\n },\n\n SPFN_AUTH_GOOGLE_REDIRECT_URI: {\n ...envString({\n description: 'Google OAuth callback URL. Defaults to {SPFN_API_URL}/_auth/oauth/google/callback',\n required: false,\n examples: [\n 'https://api.example.com/_auth/oauth/google/callback',\n 'http://localhost:8790/_auth/oauth/google/callback',\n ],\n }),\n },\n\n SPFN_AUTH_OAUTH_SUCCESS_URL: {\n ...envString({\n description: 'OAuth callback page URL. This page should use OAuthCallback component to finalize session.',\n required: false,\n default: '/auth/callback',\n examples: [\n '/auth/callback',\n 'https://app.example.com/auth/callback',\n ],\n }),\n },\n\n SPFN_AUTH_OAUTH_ERROR_URL: {\n ...envString({\n description: 'URL to redirect after OAuth error. Use {error} placeholder for error message.',\n required: false,\n default: 'http://localhost:3000/auth/error?error={error}',\n examples: [\n 'https://app.example.com/auth/error?error={error}',\n 'http://localhost:3000/auth/error?error={error}',\n ],\n }),\n },\n});"],"mappings":";AAcA,SAAS,yBAAyB;;;ACLlC;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAoBA,IAAM,gBAAgB,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIzC,0BAA0B;AAAA,IACtB,GAAG,UAAU;AAAA,MACT,aAAa;AAAA,MACb,UAAU;AAAA,MACV,cAAc,CAAC,gBAAgB;AAAA,MAC/B,WAAW,yBAAyB;AAAA,QAChC,WAAW;AAAA,QACX,gBAAgB;AAAA,QA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@spfn/core/nextjs';
|
|
2
|
-
import { R as RoleConfig, P as PermissionConfig, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, O as OAuthStartResult, U as UserProfile, c as ProfileInfo, m as mainAuthRouter } from './authenticate-
|
|
3
|
-
export { k as AuthInitOptions, A as AuthSession, I as INVITATION_STATUSES, n as InvitationStatus, K as KEY_ALGORITHM, l as KeyAlgorithmType, i as PERMISSION_CATEGORIES, j as PermissionCategory, e as SOCIAL_PROVIDERS, p as SocialProvider, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, f as VerificationPurpose, V as VerificationTargetType } from './authenticate-
|
|
2
|
+
import { R as RoleConfig, P as PermissionConfig, C as CheckAccountExistsResult, S as SendVerificationCodeResult, a as RegisterResult, L as LoginResult, b as RotateKeyResult, O as OAuthStartResult, U as UserProfile, c as ProfileInfo, m as mainAuthRouter } from './authenticate-CriFdelv.js';
|
|
3
|
+
export { k as AuthInitOptions, A as AuthSession, I as INVITATION_STATUSES, n as InvitationStatus, K as KEY_ALGORITHM, l as KeyAlgorithmType, i as PERMISSION_CATEGORIES, j as PermissionCategory, e as SOCIAL_PROVIDERS, p as SocialProvider, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, f as VerificationPurpose, V as VerificationTargetType } from './authenticate-CriFdelv.js';
|
|
4
4
|
import * as _spfn_core_route from '@spfn/core/route';
|
|
5
5
|
import { HttpMethod } from '@spfn/core/route';
|
|
6
6
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
@@ -168,7 +168,7 @@ declare const authApi: _spfn_core_nextjs.Client<_spfn_core_route.Router<{
|
|
|
168
168
|
id: number;
|
|
169
169
|
name: string;
|
|
170
170
|
displayName: string;
|
|
171
|
-
category: "
|
|
171
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
172
172
|
}[];
|
|
173
173
|
userId: number;
|
|
174
174
|
email: string | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface OAuthCallbackProps {
|
|
4
|
+
/**
|
|
5
|
+
* API base path for RPC calls
|
|
6
|
+
* @default '/api/rpc'
|
|
7
|
+
*/
|
|
8
|
+
apiBasePath?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Custom loading component
|
|
11
|
+
*/
|
|
12
|
+
loadingComponent?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Custom error component
|
|
15
|
+
*/
|
|
16
|
+
errorComponent?: (error: string) => React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Callback after successful OAuth
|
|
19
|
+
*/
|
|
20
|
+
onSuccess?: (userId: string) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Callback on error
|
|
23
|
+
*/
|
|
24
|
+
onError?: (error: string) => void;
|
|
25
|
+
}
|
|
26
|
+
declare function OAuthCallback({ apiBasePath, loadingComponent, errorComponent, onSuccess, onError, }: OAuthCallbackProps): react_jsx_runtime.JSX.Element | null;
|
|
27
|
+
|
|
28
|
+
export { OAuthCallback, type OAuthCallbackProps };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as AuthInitOptions, l as KeyAlgorithmType, n as InvitationStatus, f as VerificationPurpose, j as PermissionCategory, p as SocialProvider, q as AuthContext } from './authenticate-
|
|
2
|
-
export { B as ChangePasswordParams, w as CheckAccountExistsParams, C as CheckAccountExistsResult,
|
|
1
|
+
import { k as AuthInitOptions, l as KeyAlgorithmType, n as InvitationStatus, f as VerificationPurpose, j as PermissionCategory, p as SocialProvider, q as AuthContext } from './authenticate-CriFdelv.js';
|
|
2
|
+
export { B as ChangePasswordParams, w as CheckAccountExistsParams, C as CheckAccountExistsResult, a5 as EmailSchema, I as INVITATION_STATUSES, K as KEY_ALGORITHM, y as LoginParams, L as LoginResult, z as LogoutParams, a2 as OAuthCallbackParams, a3 as OAuthCallbackResult, a1 as OAuthStartParams, O as OAuthStartResult, a7 as PasswordSchema, a6 as PhoneSchema, x as RegisterParams, Q as RegisterPublicKeyParams, a as RegisterResult, W as RevokeKeyParams, T as RotateKeyParams, b as RotateKeyResult, e as SOCIAL_PROVIDERS, F as SendVerificationCodeParams, S as SendVerificationCodeResult, a8 as TargetTypeSchema, d as USER_STATUSES, o as UserStatus, h as VERIFICATION_PURPOSES, g as VERIFICATION_TARGET_TYPES, a9 as VerificationPurposeSchema, V as VerificationTargetType, G as VerifyCodeParams, H as VerifyCodeResult, m as authRouter, a4 as authenticate, Z as buildOAuthErrorUrl, v as changePasswordService, r as checkAccountExistsService, $ as getEnabledOAuthProviders, a0 as getGoogleAccessToken, _ as isOAuthProviderEnabled, t as loginService, u as logoutService, Y as oauthCallbackService, X as oauthStartService, J as registerPublicKeyService, s as registerService, N as revokeKeyService, M as rotateKeyService, D as sendVerificationCodeService, E as verifyCodeService } from './authenticate-CriFdelv.js';
|
|
3
3
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
4
4
|
import { UserProfile as UserProfile$1, ProfileInfo } from '@spfn/auth';
|
|
5
5
|
import { BaseRepository } from '@spfn/core/db';
|
|
@@ -1255,7 +1255,7 @@ declare function getAuthSessionService(userId: string | number | bigint): Promis
|
|
|
1255
1255
|
id: number;
|
|
1256
1256
|
name: string;
|
|
1257
1257
|
displayName: string;
|
|
1258
|
-
category: "
|
|
1258
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
1259
1259
|
}[];
|
|
1260
1260
|
userId: number;
|
|
1261
1261
|
email: string | null;
|
|
@@ -2384,7 +2384,7 @@ declare const permissions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2384
2384
|
tableName: "permissions";
|
|
2385
2385
|
dataType: "string";
|
|
2386
2386
|
columnType: "PgText";
|
|
2387
|
-
data: "
|
|
2387
|
+
data: "custom" | "user" | "auth" | "rbac" | "system";
|
|
2388
2388
|
driverParam: string;
|
|
2389
2389
|
notNull: false;
|
|
2390
2390
|
hasDefault: false;
|
|
@@ -2833,13 +2833,13 @@ declare class UsersRepository extends BaseRepository {
|
|
|
2833
2833
|
create(data: NewUser): Promise<{
|
|
2834
2834
|
email: string | null;
|
|
2835
2835
|
phone: string | null;
|
|
2836
|
+
status: "active" | "inactive" | "suspended";
|
|
2836
2837
|
id: number;
|
|
2838
|
+
createdAt: Date;
|
|
2839
|
+
updatedAt: Date;
|
|
2837
2840
|
passwordHash: string | null;
|
|
2838
2841
|
passwordChangeRequired: boolean;
|
|
2839
2842
|
roleId: number;
|
|
2840
|
-
createdAt: Date;
|
|
2841
|
-
updatedAt: Date;
|
|
2842
|
-
status: "active" | "inactive" | "suspended";
|
|
2843
2843
|
emailVerifiedAt: Date | null;
|
|
2844
2844
|
phoneVerifiedAt: Date | null;
|
|
2845
2845
|
lastLoginAt: Date | null;
|
|
@@ -2905,13 +2905,13 @@ declare class UsersRepository extends BaseRepository {
|
|
|
2905
2905
|
deleteById(id: number): Promise<{
|
|
2906
2906
|
email: string | null;
|
|
2907
2907
|
phone: string | null;
|
|
2908
|
+
status: "active" | "inactive" | "suspended";
|
|
2908
2909
|
id: number;
|
|
2910
|
+
createdAt: Date;
|
|
2911
|
+
updatedAt: Date;
|
|
2909
2912
|
passwordHash: string | null;
|
|
2910
2913
|
passwordChangeRequired: boolean;
|
|
2911
2914
|
roleId: number;
|
|
2912
|
-
createdAt: Date;
|
|
2913
|
-
updatedAt: Date;
|
|
2914
|
-
status: "active" | "inactive" | "suspended";
|
|
2915
2915
|
emailVerifiedAt: Date | null;
|
|
2916
2916
|
phoneVerifiedAt: Date | null;
|
|
2917
2917
|
lastLoginAt: Date | null;
|
|
@@ -2934,7 +2934,7 @@ declare class UsersRepository extends BaseRepository {
|
|
|
2934
2934
|
id: number;
|
|
2935
2935
|
name: string;
|
|
2936
2936
|
displayName: string;
|
|
2937
|
-
category: "
|
|
2937
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | undefined;
|
|
2938
2938
|
}[];
|
|
2939
2939
|
}>;
|
|
2940
2940
|
/**
|
|
@@ -3044,16 +3044,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3044
3044
|
* Write primary 사용
|
|
3045
3045
|
*/
|
|
3046
3046
|
create(data: NewUserPublicKey): Promise<{
|
|
3047
|
-
publicKey: string;
|
|
3048
|
-
keyId: string;
|
|
3049
|
-
fingerprint: string;
|
|
3050
|
-
algorithm: "ES256" | "RS256";
|
|
3051
3047
|
userId: number;
|
|
3048
|
+
keyId: string;
|
|
3052
3049
|
id: number;
|
|
3053
3050
|
isActive: boolean;
|
|
3054
3051
|
createdAt: Date;
|
|
3055
|
-
|
|
3052
|
+
publicKey: string;
|
|
3053
|
+
algorithm: "ES256" | "RS256";
|
|
3054
|
+
fingerprint: string;
|
|
3056
3055
|
lastUsedAt: Date | null;
|
|
3056
|
+
expiresAt: Date | null;
|
|
3057
3057
|
revokedAt: Date | null;
|
|
3058
3058
|
revokedReason: string | null;
|
|
3059
3059
|
}>;
|
|
@@ -3080,16 +3080,16 @@ declare class KeysRepository extends BaseRepository {
|
|
|
3080
3080
|
* Write primary 사용
|
|
3081
3081
|
*/
|
|
3082
3082
|
deleteByKeyIdAndUserId(keyId: string, userId: number): Promise<{
|
|
3083
|
-
publicKey: string;
|
|
3084
|
-
keyId: string;
|
|
3085
|
-
fingerprint: string;
|
|
3086
|
-
algorithm: "ES256" | "RS256";
|
|
3087
3083
|
userId: number;
|
|
3084
|
+
keyId: string;
|
|
3088
3085
|
id: number;
|
|
3089
3086
|
isActive: boolean;
|
|
3090
3087
|
createdAt: Date;
|
|
3091
|
-
|
|
3088
|
+
publicKey: string;
|
|
3089
|
+
algorithm: "ES256" | "RS256";
|
|
3090
|
+
fingerprint: string;
|
|
3092
3091
|
lastUsedAt: Date | null;
|
|
3092
|
+
expiresAt: Date | null;
|
|
3093
3093
|
revokedAt: Date | null;
|
|
3094
3094
|
revokedReason: string | null;
|
|
3095
3095
|
}>;
|
|
@@ -3204,14 +3204,14 @@ declare class VerificationCodesRepository extends BaseRepository {
|
|
|
3204
3204
|
* Write primary 사용
|
|
3205
3205
|
*/
|
|
3206
3206
|
create(data: NewVerificationCode): Promise<{
|
|
3207
|
-
target: string;
|
|
3208
|
-
targetType: "email" | "phone";
|
|
3209
|
-
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3210
|
-
code: string;
|
|
3211
3207
|
id: number;
|
|
3212
3208
|
createdAt: Date;
|
|
3213
3209
|
updatedAt: Date;
|
|
3214
3210
|
expiresAt: Date;
|
|
3211
|
+
target: string;
|
|
3212
|
+
targetType: "email" | "phone";
|
|
3213
|
+
code: string;
|
|
3214
|
+
purpose: "registration" | "login" | "password_reset" | "email_change" | "phone_change";
|
|
3215
3215
|
usedAt: Date | null;
|
|
3216
3216
|
attempts: number;
|
|
3217
3217
|
}>;
|
|
@@ -3400,7 +3400,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3400
3400
|
name: string;
|
|
3401
3401
|
displayName: string;
|
|
3402
3402
|
description: string | null;
|
|
3403
|
-
category: "
|
|
3403
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3404
3404
|
isBuiltin: boolean;
|
|
3405
3405
|
isSystem: boolean;
|
|
3406
3406
|
isActive: boolean;
|
|
@@ -3416,7 +3416,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3416
3416
|
name: string;
|
|
3417
3417
|
displayName: string;
|
|
3418
3418
|
description: string | null;
|
|
3419
|
-
category: "
|
|
3419
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3420
3420
|
isBuiltin: boolean;
|
|
3421
3421
|
isSystem: boolean;
|
|
3422
3422
|
isActive: boolean;
|
|
@@ -3456,7 +3456,7 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3456
3456
|
name: string;
|
|
3457
3457
|
displayName: string;
|
|
3458
3458
|
description: string | null;
|
|
3459
|
-
category: "
|
|
3459
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3460
3460
|
isBuiltin: boolean;
|
|
3461
3461
|
isSystem: boolean;
|
|
3462
3462
|
isActive: boolean;
|
|
@@ -3475,8 +3475,8 @@ declare class PermissionsRepository extends BaseRepository {
|
|
|
3475
3475
|
isActive: boolean;
|
|
3476
3476
|
createdAt: Date;
|
|
3477
3477
|
updatedAt: Date;
|
|
3478
|
-
category: "auth" | "custom" | "user" | "rbac" | "system" | null;
|
|
3479
3478
|
metadata: Record<string, any> | null;
|
|
3479
|
+
category: "custom" | "user" | "auth" | "rbac" | "system" | null;
|
|
3480
3480
|
}>;
|
|
3481
3481
|
}
|
|
3482
3482
|
declare const permissionsRepository: PermissionsRepository;
|
|
@@ -3521,9 +3521,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3521
3521
|
*/
|
|
3522
3522
|
createMany(data: NewRolePermission[]): Promise<{
|
|
3523
3523
|
id: number;
|
|
3524
|
-
roleId: number;
|
|
3525
3524
|
createdAt: Date;
|
|
3526
3525
|
updatedAt: Date;
|
|
3526
|
+
roleId: number;
|
|
3527
3527
|
permissionId: number;
|
|
3528
3528
|
}[]>;
|
|
3529
3529
|
/**
|
|
@@ -3539,9 +3539,9 @@ declare class RolePermissionsRepository extends BaseRepository {
|
|
|
3539
3539
|
*/
|
|
3540
3540
|
setPermissionsForRole(roleId: number, permissionIds: number[]): Promise<{
|
|
3541
3541
|
id: number;
|
|
3542
|
-
roleId: number;
|
|
3543
3542
|
createdAt: Date;
|
|
3544
3543
|
updatedAt: Date;
|
|
3544
|
+
roleId: number;
|
|
3545
3545
|
permissionId: number;
|
|
3546
3546
|
}[]>;
|
|
3547
3547
|
}
|
|
@@ -3606,10 +3606,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
3606
3606
|
id: number;
|
|
3607
3607
|
createdAt: Date;
|
|
3608
3608
|
updatedAt: Date;
|
|
3609
|
-
permissionId: number;
|
|
3610
3609
|
expiresAt: Date | null;
|
|
3611
|
-
|
|
3610
|
+
permissionId: number;
|
|
3612
3611
|
granted: boolean;
|
|
3612
|
+
reason: string | null;
|
|
3613
3613
|
}>;
|
|
3614
3614
|
/**
|
|
3615
3615
|
* 사용자 권한 오버라이드 업데이트
|
|
@@ -3632,10 +3632,10 @@ declare class UserPermissionsRepository extends BaseRepository {
|
|
|
3632
3632
|
id: number;
|
|
3633
3633
|
createdAt: Date;
|
|
3634
3634
|
updatedAt: Date;
|
|
3635
|
-
permissionId: number;
|
|
3636
3635
|
expiresAt: Date | null;
|
|
3637
|
-
|
|
3636
|
+
permissionId: number;
|
|
3638
3637
|
granted: boolean;
|
|
3638
|
+
reason: string | null;
|
|
3639
3639
|
}>;
|
|
3640
3640
|
/**
|
|
3641
3641
|
* 사용자의 모든 권한 오버라이드 삭제
|
|
@@ -3714,7 +3714,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3714
3714
|
displayName: string;
|
|
3715
3715
|
createdAt: Date;
|
|
3716
3716
|
updatedAt: Date;
|
|
3717
|
-
metadata: Record<string, any> | null;
|
|
3718
3717
|
firstName: string | null;
|
|
3719
3718
|
lastName: string | null;
|
|
3720
3719
|
avatarUrl: string | null;
|
|
@@ -3727,6 +3726,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3727
3726
|
location: string | null;
|
|
3728
3727
|
company: string | null;
|
|
3729
3728
|
jobTitle: string | null;
|
|
3729
|
+
metadata: Record<string, any> | null;
|
|
3730
3730
|
}>;
|
|
3731
3731
|
/**
|
|
3732
3732
|
* 프로필 업데이트 (by ID)
|
|
@@ -3783,7 +3783,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3783
3783
|
displayName: string;
|
|
3784
3784
|
createdAt: Date;
|
|
3785
3785
|
updatedAt: Date;
|
|
3786
|
-
metadata: Record<string, any> | null;
|
|
3787
3786
|
firstName: string | null;
|
|
3788
3787
|
lastName: string | null;
|
|
3789
3788
|
avatarUrl: string | null;
|
|
@@ -3796,6 +3795,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3796
3795
|
location: string | null;
|
|
3797
3796
|
company: string | null;
|
|
3798
3797
|
jobTitle: string | null;
|
|
3798
|
+
metadata: Record<string, any> | null;
|
|
3799
3799
|
}>;
|
|
3800
3800
|
/**
|
|
3801
3801
|
* 프로필 삭제 (by User ID)
|
|
@@ -3806,7 +3806,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3806
3806
|
displayName: string;
|
|
3807
3807
|
createdAt: Date;
|
|
3808
3808
|
updatedAt: Date;
|
|
3809
|
-
metadata: Record<string, any> | null;
|
|
3810
3809
|
firstName: string | null;
|
|
3811
3810
|
lastName: string | null;
|
|
3812
3811
|
avatarUrl: string | null;
|
|
@@ -3819,6 +3818,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3819
3818
|
location: string | null;
|
|
3820
3819
|
company: string | null;
|
|
3821
3820
|
jobTitle: string | null;
|
|
3821
|
+
metadata: Record<string, any> | null;
|
|
3822
3822
|
}>;
|
|
3823
3823
|
/**
|
|
3824
3824
|
* 프로필 Upsert (by User ID)
|
|
@@ -3832,7 +3832,6 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3832
3832
|
displayName: string;
|
|
3833
3833
|
createdAt: Date;
|
|
3834
3834
|
updatedAt: Date;
|
|
3835
|
-
metadata: Record<string, any> | null;
|
|
3836
3835
|
firstName: string | null;
|
|
3837
3836
|
lastName: string | null;
|
|
3838
3837
|
avatarUrl: string | null;
|
|
@@ -3845,6 +3844,7 @@ declare class UserProfilesRepository extends BaseRepository {
|
|
|
3845
3844
|
location: string | null;
|
|
3846
3845
|
company: string | null;
|
|
3847
3846
|
jobTitle: string | null;
|
|
3847
|
+
metadata: Record<string, any> | null;
|
|
3848
3848
|
}>;
|
|
3849
3849
|
/**
|
|
3850
3850
|
* User ID로 프로필 데이터 조회 (formatted)
|
|
@@ -3972,15 +3972,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
3972
3972
|
*/
|
|
3973
3973
|
create(data: NewInvitation): Promise<{
|
|
3974
3974
|
email: string;
|
|
3975
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
3975
3976
|
id: number;
|
|
3976
|
-
roleId: number;
|
|
3977
3977
|
createdAt: Date;
|
|
3978
3978
|
updatedAt: Date;
|
|
3979
|
-
|
|
3979
|
+
roleId: number;
|
|
3980
3980
|
metadata: Record<string, any> | null;
|
|
3981
|
+
expiresAt: Date;
|
|
3981
3982
|
token: string;
|
|
3982
3983
|
invitedBy: number;
|
|
3983
|
-
expiresAt: Date;
|
|
3984
3984
|
acceptedAt: Date | null;
|
|
3985
3985
|
cancelledAt: Date | null;
|
|
3986
3986
|
}>;
|
|
@@ -4006,15 +4006,15 @@ declare class InvitationsRepository extends BaseRepository {
|
|
|
4006
4006
|
*/
|
|
4007
4007
|
deleteById(id: number): Promise<{
|
|
4008
4008
|
email: string;
|
|
4009
|
+
status: "pending" | "accepted" | "expired" | "cancelled";
|
|
4009
4010
|
id: number;
|
|
4010
|
-
roleId: number;
|
|
4011
4011
|
createdAt: Date;
|
|
4012
4012
|
updatedAt: Date;
|
|
4013
|
-
|
|
4013
|
+
roleId: number;
|
|
4014
4014
|
metadata: Record<string, any> | null;
|
|
4015
|
+
expiresAt: Date;
|
|
4015
4016
|
token: string;
|
|
4016
4017
|
invitedBy: number;
|
|
4017
|
-
expiresAt: Date;
|
|
4018
4018
|
acceptedAt: Date | null;
|
|
4019
4019
|
cancelledAt: Date | null;
|
|
4020
4020
|
}>;
|
|
@@ -4655,13 +4655,13 @@ declare function getUser(c: Context | {
|
|
|
4655
4655
|
}): {
|
|
4656
4656
|
email: string | null;
|
|
4657
4657
|
phone: string | null;
|
|
4658
|
+
status: "active" | "inactive" | "suspended";
|
|
4658
4659
|
id: number;
|
|
4660
|
+
createdAt: Date;
|
|
4661
|
+
updatedAt: Date;
|
|
4659
4662
|
passwordHash: string | null;
|
|
4660
4663
|
passwordChangeRequired: boolean;
|
|
4661
4664
|
roleId: number;
|
|
4662
|
-
createdAt: Date;
|
|
4663
|
-
updatedAt: Date;
|
|
4664
|
-
status: "active" | "inactive" | "suspended";
|
|
4665
4665
|
emailVerifiedAt: Date | null;
|
|
4666
4666
|
phoneVerifiedAt: Date | null;
|
|
4667
4667
|
lastLoginAt: Date | null;
|
|
@@ -4915,7 +4915,7 @@ declare function getGoogleOAuthConfig(): {
|
|
|
4915
4915
|
* Google 로그인 URL 생성
|
|
4916
4916
|
*
|
|
4917
4917
|
* @param state - CSRF 방지용 state 파라미터 (암호화된 returnUrl + nonce 포함)
|
|
4918
|
-
* @param scopes - 요청할 OAuth scopes (기본: email, profile)
|
|
4918
|
+
* @param scopes - 요청할 OAuth scopes (기본: env 또는 email, profile)
|
|
4919
4919
|
*/
|
|
4920
4920
|
declare function getGoogleAuthUrl(state: string, scopes?: string[]): string;
|
|
4921
4921
|
/**
|