alepha 0.14.4 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -4
- package/dist/api/audits/index.d.ts +619 -731
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -298
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +0 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +245 -356
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -350
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +499 -611
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.browser.js +1 -2
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1697 -1804
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +178 -151
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +132 -132
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +122 -122
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +1 -2
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +163 -163
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +46 -46
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/index.d.ts +302 -299
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +966 -564
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +303 -299
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +11 -7
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +419 -99
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +718 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +420 -99
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +419 -99
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +44 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +4 -4
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +97 -50
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +129 -33
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +7981 -14
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/file/index.d.ts +523 -390
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +253 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +208 -208
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +25 -26
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +197 -197
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/orm/chunk-DtkW-qnP.js +38 -0
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +2814 -0
- package/dist/orm/index.bun.js.map +1 -0
- package/dist/orm/index.d.ts +1205 -1057
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2056 -1753
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +248 -248
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/redis/index.bun.js +285 -0
- package/dist/redis/index.bun.js.map +1 -0
- package/dist/redis/index.d.ts +118 -136
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +18 -38
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +69 -69
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +25 -25
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +5 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +417 -254
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +386 -86
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +277 -277
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +20 -20
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +60 -57
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +1 -1
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +3 -3
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/cookies/index.d.ts +6 -6
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +288 -122
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -12
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +0 -1
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/helmet/index.d.ts +2 -2
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +84 -85
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +1 -2
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/multipart/index.d.ts +6 -6
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/proxy/index.d.ts +102 -103
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +16 -16
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/static/index.d.ts +44 -44
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1 -2
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +13 -11
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +7 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +71 -72
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/topic/core/index.d.ts +318 -318
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/redis/index.d.ts +6 -6
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/vite/index.d.ts +5720 -159
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +41 -18
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +6 -6
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +247 -247
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +6 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +9 -14
- package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
- package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
- package/src/api/users/entities/users.ts +1 -1
- package/src/api/users/index.ts +8 -8
- package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
- package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
- package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
- package/src/api/users/services/CredentialService.ts +7 -7
- package/src/api/users/services/IdentityService.ts +4 -4
- package/src/api/users/services/RegistrationService.spec.ts +25 -27
- package/src/api/users/services/RegistrationService.ts +38 -27
- package/src/api/users/services/SessionCrudService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +3 -3
- package/src/api/users/services/SessionService.ts +28 -9
- package/src/api/users/services/UserService.ts +7 -7
- package/src/batch/providers/BatchProvider.ts +1 -2
- package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
- package/src/cli/assets/apiHelloControllerTs.ts +18 -0
- package/src/cli/assets/apiIndexTs.ts +16 -0
- package/src/cli/assets/claudeMd.ts +303 -0
- package/src/cli/assets/mainBrowserTs.ts +2 -2
- package/src/cli/assets/mainServerTs.ts +24 -0
- package/src/cli/assets/webAppRouterTs.ts +15 -0
- package/src/cli/assets/webHelloComponentTsx.ts +16 -0
- package/src/cli/assets/webIndexTs.ts +16 -0
- package/src/cli/commands/build.ts +41 -21
- package/src/cli/commands/db.ts +21 -18
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +13 -17
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/init.ts +74 -29
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -2
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +4 -2
- package/src/cli/services/AlephaCliUtils.ts +39 -600
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.ts +15 -3
- package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/core/primitives/$hook.ts +6 -2
- package/src/core/primitives/$module.spec.ts +4 -0
- package/src/core/providers/AlsProvider.ts +1 -1
- package/src/core/providers/CodecManager.spec.ts +12 -6
- package/src/core/providers/CodecManager.ts +26 -6
- package/src/core/providers/EventManager.ts +169 -13
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
- package/src/core/providers/StateManager.spec.ts +27 -16
- package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
- package/src/email/providers/LocalEmailProvider.ts +52 -15
- package/src/email/providers/NodemailerEmailProvider.ts +167 -56
- package/src/file/errors/FileError.ts +7 -0
- package/src/file/index.ts +9 -1
- package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
- package/src/orm/index.browser.ts +1 -19
- package/src/orm/index.bun.ts +77 -0
- package/src/orm/index.shared-server.ts +22 -0
- package/src/orm/index.shared.ts +15 -0
- package/src/orm/index.ts +19 -39
- package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
- package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
- package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
- package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
- package/src/orm/services/Repository.ts +8 -0
- package/src/redis/index.bun.ts +35 -0
- package/src/redis/providers/BunRedisProvider.ts +12 -43
- package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
- package/src/redis/providers/NodeRedisProvider.ts +16 -34
- package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
- package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
- package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
- package/src/security/index.browser.ts +5 -0
- package/src/security/index.ts +90 -7
- package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
- package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
- package/src/security/primitives/$role.ts +5 -5
- package/src/security/primitives/$serviceAccount.spec.ts +5 -5
- package/src/security/primitives/$serviceAccount.ts +3 -3
- package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
- package/src/server/auth/primitives/$auth.ts +10 -10
- package/src/server/auth/primitives/$authCredentials.ts +3 -3
- package/src/server/auth/primitives/$authGithub.ts +3 -3
- package/src/server/auth/primitives/$authGoogle.ts +3 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
- package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
- package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
- package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
- package/src/server/core/providers/ServerProvider.ts +144 -21
- package/src/server/core/providers/ServerRouterProvider.ts +259 -115
- package/src/server/core/providers/ServerTimingProvider.ts +2 -2
- package/src/server/links/index.ts +1 -1
- package/src/server/links/providers/LinkProvider.ts +1 -1
- package/src/server/swagger/index.ts +1 -1
- package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
- package/src/sms/providers/LocalSmsProvider.ts +8 -7
- package/src/vite/helpers/boot.ts +28 -17
- package/src/vite/tasks/buildServer.ts +12 -1
- package/src/vite/tasks/devServer.ts +3 -1
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- package/dist/server/security/index.browser.js +0 -13
- package/dist/server/security/index.browser.js.map +0 -1
- package/dist/server/security/index.d.ts +0 -173
- package/dist/server/security/index.d.ts.map +0 -1
- package/dist/server/security/index.js +0 -311
- package/dist/server/security/index.js.map +0 -1
- package/src/cli/assets/appRouterTs.ts +0 -9
- package/src/cli/assets/mainTs.ts +0 -13
- package/src/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha181 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static } from "alepha";
|
|
3
3
|
import * as alepha_server_cookies0 from "alepha/server/cookies";
|
|
4
4
|
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
5
5
|
import { DateTimeProvider } from "alepha/datetime";
|
|
6
|
-
import { AccessTokenResponse,
|
|
6
|
+
import { AccessTokenResponse, IssuerPrimitive, SecurityProvider, UserAccount } from "alepha/security";
|
|
7
7
|
import { Configuration } from "openid-client";
|
|
8
8
|
import * as alepha_logger0 from "alepha/logger";
|
|
9
9
|
import * as alepha_server0 from "alepha/server";
|
|
@@ -20,45 +20,45 @@ declare const alephaServerAuthRoutes: {
|
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region ../../src/server/auth/schemas/authenticationProviderSchema.d.ts
|
|
23
|
-
declare const authenticationProviderSchema:
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
23
|
+
declare const authenticationProviderSchema: alepha181.TObject<{
|
|
24
|
+
name: alepha181.TString;
|
|
25
|
+
type: alepha181.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
26
26
|
}>;
|
|
27
27
|
type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region ../../src/server/auth/schemas/tokenResponseSchema.d.ts
|
|
30
|
-
declare const tokenResponseSchema:
|
|
31
|
-
provider:
|
|
32
|
-
access_token:
|
|
33
|
-
issued_at:
|
|
34
|
-
expires_in:
|
|
35
|
-
refresh_token:
|
|
36
|
-
refresh_token_expires_in:
|
|
37
|
-
refresh_expires_in:
|
|
38
|
-
id_token:
|
|
39
|
-
scope:
|
|
40
|
-
user:
|
|
41
|
-
id:
|
|
42
|
-
name:
|
|
43
|
-
email:
|
|
44
|
-
username:
|
|
45
|
-
picture:
|
|
46
|
-
sessionId:
|
|
47
|
-
organizations:
|
|
48
|
-
roles:
|
|
30
|
+
declare const tokenResponseSchema: alepha181.TObject<{
|
|
31
|
+
provider: alepha181.TString;
|
|
32
|
+
access_token: alepha181.TString;
|
|
33
|
+
issued_at: alepha181.TNumber;
|
|
34
|
+
expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
35
|
+
refresh_token: alepha181.TOptional<alepha181.TString>;
|
|
36
|
+
refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
37
|
+
refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
38
|
+
id_token: alepha181.TOptional<alepha181.TString>;
|
|
39
|
+
scope: alepha181.TOptional<alepha181.TString>;
|
|
40
|
+
user: alepha181.TObject<{
|
|
41
|
+
id: alepha181.TString;
|
|
42
|
+
name: alepha181.TOptional<alepha181.TString>;
|
|
43
|
+
email: alepha181.TOptional<alepha181.TString>;
|
|
44
|
+
username: alepha181.TOptional<alepha181.TString>;
|
|
45
|
+
picture: alepha181.TOptional<alepha181.TString>;
|
|
46
|
+
sessionId: alepha181.TOptional<alepha181.TString>;
|
|
47
|
+
organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
48
|
+
roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
49
49
|
}>;
|
|
50
|
-
api:
|
|
51
|
-
prefix:
|
|
52
|
-
links:
|
|
53
|
-
name:
|
|
54
|
-
group:
|
|
55
|
-
path:
|
|
56
|
-
method:
|
|
57
|
-
requestBodyType:
|
|
58
|
-
service:
|
|
59
|
-
rawSchema:
|
|
60
|
-
body:
|
|
61
|
-
response:
|
|
50
|
+
api: alepha181.TObject<{
|
|
51
|
+
prefix: alepha181.TOptional<alepha181.TString>;
|
|
52
|
+
links: alepha181.TArray<alepha181.TObject<{
|
|
53
|
+
name: alepha181.TString;
|
|
54
|
+
group: alepha181.TOptional<alepha181.TString>;
|
|
55
|
+
path: alepha181.TString;
|
|
56
|
+
method: alepha181.TOptional<alepha181.TString>;
|
|
57
|
+
requestBodyType: alepha181.TOptional<alepha181.TString>;
|
|
58
|
+
service: alepha181.TOptional<alepha181.TString>;
|
|
59
|
+
rawSchema: alepha181.TOptional<alepha181.TObject<{
|
|
60
|
+
body: alepha181.TOptional<alepha181.TString>;
|
|
61
|
+
response: alepha181.TOptional<alepha181.TString>;
|
|
62
62
|
}>>;
|
|
63
63
|
}>>;
|
|
64
64
|
}>;
|
|
@@ -66,43 +66,43 @@ declare const tokenResponseSchema: alepha165.TObject<{
|
|
|
66
66
|
type TokenResponse = Static<typeof tokenResponseSchema>;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region ../../src/server/auth/schemas/tokensSchema.d.ts
|
|
69
|
-
declare const tokensSchema:
|
|
70
|
-
provider:
|
|
71
|
-
access_token:
|
|
72
|
-
issued_at:
|
|
73
|
-
expires_in:
|
|
74
|
-
refresh_token:
|
|
75
|
-
refresh_token_expires_in:
|
|
76
|
-
refresh_expires_in:
|
|
77
|
-
id_token:
|
|
78
|
-
scope:
|
|
69
|
+
declare const tokensSchema: alepha181.TObject<{
|
|
70
|
+
provider: alepha181.TString;
|
|
71
|
+
access_token: alepha181.TString;
|
|
72
|
+
issued_at: alepha181.TNumber;
|
|
73
|
+
expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
74
|
+
refresh_token: alepha181.TOptional<alepha181.TString>;
|
|
75
|
+
refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
76
|
+
refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
77
|
+
id_token: alepha181.TOptional<alepha181.TString>;
|
|
78
|
+
scope: alepha181.TOptional<alepha181.TString>;
|
|
79
79
|
}>;
|
|
80
80
|
type Tokens = Static<typeof tokensSchema>;
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region ../../src/server/auth/schemas/userinfoResponseSchema.d.ts
|
|
83
|
-
declare const userinfoResponseSchema:
|
|
84
|
-
user:
|
|
85
|
-
id:
|
|
86
|
-
name:
|
|
87
|
-
email:
|
|
88
|
-
username:
|
|
89
|
-
picture:
|
|
90
|
-
sessionId:
|
|
91
|
-
organizations:
|
|
92
|
-
roles:
|
|
83
|
+
declare const userinfoResponseSchema: alepha181.TObject<{
|
|
84
|
+
user: alepha181.TOptional<alepha181.TObject<{
|
|
85
|
+
id: alepha181.TString;
|
|
86
|
+
name: alepha181.TOptional<alepha181.TString>;
|
|
87
|
+
email: alepha181.TOptional<alepha181.TString>;
|
|
88
|
+
username: alepha181.TOptional<alepha181.TString>;
|
|
89
|
+
picture: alepha181.TOptional<alepha181.TString>;
|
|
90
|
+
sessionId: alepha181.TOptional<alepha181.TString>;
|
|
91
|
+
organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
92
|
+
roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
93
93
|
}>>;
|
|
94
|
-
api:
|
|
95
|
-
prefix:
|
|
96
|
-
links:
|
|
97
|
-
name:
|
|
98
|
-
group:
|
|
99
|
-
path:
|
|
100
|
-
method:
|
|
101
|
-
requestBodyType:
|
|
102
|
-
service:
|
|
103
|
-
rawSchema:
|
|
104
|
-
body:
|
|
105
|
-
response:
|
|
94
|
+
api: alepha181.TObject<{
|
|
95
|
+
prefix: alepha181.TOptional<alepha181.TString>;
|
|
96
|
+
links: alepha181.TArray<alepha181.TObject<{
|
|
97
|
+
name: alepha181.TString;
|
|
98
|
+
group: alepha181.TOptional<alepha181.TString>;
|
|
99
|
+
path: alepha181.TString;
|
|
100
|
+
method: alepha181.TOptional<alepha181.TString>;
|
|
101
|
+
requestBodyType: alepha181.TOptional<alepha181.TString>;
|
|
102
|
+
service: alepha181.TOptional<alepha181.TString>;
|
|
103
|
+
rawSchema: alepha181.TOptional<alepha181.TObject<{
|
|
104
|
+
body: alepha181.TOptional<alepha181.TString>;
|
|
105
|
+
response: alepha181.TOptional<alepha181.TString>;
|
|
106
106
|
}>>;
|
|
107
107
|
}>>;
|
|
108
108
|
}>;
|
|
@@ -116,173 +116,173 @@ declare class ServerAuthProvider {
|
|
|
116
116
|
protected readonly serverCookiesProvider: ServerCookiesProvider;
|
|
117
117
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
118
118
|
protected readonly serverLinksProvider: ServerLinksProvider;
|
|
119
|
-
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
120
|
-
provider:
|
|
121
|
-
realm:
|
|
122
|
-
codeVerifier:
|
|
123
|
-
redirectUri:
|
|
124
|
-
state:
|
|
125
|
-
nonce:
|
|
119
|
+
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha181.TObject<{
|
|
120
|
+
provider: alepha181.TString;
|
|
121
|
+
realm: alepha181.TOptional<alepha181.TString>;
|
|
122
|
+
codeVerifier: alepha181.TOptional<alepha181.TString>;
|
|
123
|
+
redirectUri: alepha181.TOptional<alepha181.TString>;
|
|
124
|
+
state: alepha181.TOptional<alepha181.TString>;
|
|
125
|
+
nonce: alepha181.TOptional<alepha181.TString>;
|
|
126
126
|
}>>;
|
|
127
|
-
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
128
|
-
provider:
|
|
129
|
-
access_token:
|
|
130
|
-
issued_at:
|
|
131
|
-
expires_in:
|
|
132
|
-
refresh_token:
|
|
133
|
-
refresh_token_expires_in:
|
|
134
|
-
refresh_expires_in:
|
|
135
|
-
id_token:
|
|
136
|
-
scope:
|
|
127
|
+
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha181.TObject<{
|
|
128
|
+
provider: alepha181.TString;
|
|
129
|
+
access_token: alepha181.TString;
|
|
130
|
+
issued_at: alepha181.TNumber;
|
|
131
|
+
expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
132
|
+
refresh_token: alepha181.TOptional<alepha181.TString>;
|
|
133
|
+
refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
134
|
+
refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
135
|
+
id_token: alepha181.TOptional<alepha181.TString>;
|
|
136
|
+
scope: alepha181.TOptional<alepha181.TString>;
|
|
137
137
|
}>>;
|
|
138
138
|
get identities(): Array<AuthPrimitive>;
|
|
139
139
|
getAuthenticationProviders(filters?: {
|
|
140
140
|
realmName?: string;
|
|
141
141
|
}): AuthenticationProvider[];
|
|
142
|
-
protected readonly configure:
|
|
142
|
+
protected readonly configure: alepha181.HookPrimitive<"configure">;
|
|
143
143
|
protected getAccessTokens(tokens: Tokens): string | undefined;
|
|
144
144
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
protected readonly onRequest:
|
|
145
|
+
* Fill request headers with access token from cookies or fallback to provider's fallback function.
|
|
146
|
+
*/
|
|
147
|
+
protected readonly onRequest: alepha181.HookPrimitive<"server:onRequest">;
|
|
148
148
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
* Convert cookies to tokens.
|
|
150
|
+
* If the tokens are expired, try to refresh them using the refresh token.
|
|
151
|
+
*/
|
|
152
152
|
protected cookiesToTokens(cookies: Cookies): Promise<Tokens | undefined>;
|
|
153
153
|
protected refreshTokens(tokens: Tokens): Promise<Tokens | undefined>;
|
|
154
154
|
/**
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
* Get user information.
|
|
156
|
+
*/
|
|
157
157
|
readonly userinfo: alepha_server0.RoutePrimitive<{
|
|
158
|
-
response:
|
|
159
|
-
user:
|
|
160
|
-
id:
|
|
161
|
-
name:
|
|
162
|
-
email:
|
|
163
|
-
username:
|
|
164
|
-
picture:
|
|
165
|
-
sessionId:
|
|
166
|
-
organizations:
|
|
167
|
-
roles:
|
|
158
|
+
response: alepha181.TObject<{
|
|
159
|
+
user: alepha181.TOptional<alepha181.TObject<{
|
|
160
|
+
id: alepha181.TString;
|
|
161
|
+
name: alepha181.TOptional<alepha181.TString>;
|
|
162
|
+
email: alepha181.TOptional<alepha181.TString>;
|
|
163
|
+
username: alepha181.TOptional<alepha181.TString>;
|
|
164
|
+
picture: alepha181.TOptional<alepha181.TString>;
|
|
165
|
+
sessionId: alepha181.TOptional<alepha181.TString>;
|
|
166
|
+
organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
167
|
+
roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
168
168
|
}>>;
|
|
169
|
-
api:
|
|
170
|
-
prefix:
|
|
171
|
-
links:
|
|
172
|
-
name:
|
|
173
|
-
group:
|
|
174
|
-
path:
|
|
175
|
-
method:
|
|
176
|
-
requestBodyType:
|
|
177
|
-
service:
|
|
178
|
-
rawSchema:
|
|
179
|
-
body:
|
|
180
|
-
response:
|
|
169
|
+
api: alepha181.TObject<{
|
|
170
|
+
prefix: alepha181.TOptional<alepha181.TString>;
|
|
171
|
+
links: alepha181.TArray<alepha181.TObject<{
|
|
172
|
+
name: alepha181.TString;
|
|
173
|
+
group: alepha181.TOptional<alepha181.TString>;
|
|
174
|
+
path: alepha181.TString;
|
|
175
|
+
method: alepha181.TOptional<alepha181.TString>;
|
|
176
|
+
requestBodyType: alepha181.TOptional<alepha181.TString>;
|
|
177
|
+
service: alepha181.TOptional<alepha181.TString>;
|
|
178
|
+
rawSchema: alepha181.TOptional<alepha181.TObject<{
|
|
179
|
+
body: alepha181.TOptional<alepha181.TString>;
|
|
180
|
+
response: alepha181.TOptional<alepha181.TString>;
|
|
181
181
|
}>>;
|
|
182
182
|
}>>;
|
|
183
183
|
}>;
|
|
184
184
|
}>;
|
|
185
185
|
}>;
|
|
186
186
|
/**
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
* Refresh a token for internal providers.
|
|
188
|
+
*/
|
|
189
189
|
readonly refresh: alepha_server0.RoutePrimitive<{
|
|
190
|
-
query:
|
|
191
|
-
provider:
|
|
190
|
+
query: alepha181.TObject<{
|
|
191
|
+
provider: alepha181.TString;
|
|
192
192
|
}>;
|
|
193
|
-
body:
|
|
194
|
-
refresh_token:
|
|
195
|
-
access_token:
|
|
193
|
+
body: alepha181.TObject<{
|
|
194
|
+
refresh_token: alepha181.TString;
|
|
195
|
+
access_token: alepha181.TOptional<alepha181.TString>;
|
|
196
196
|
}>;
|
|
197
|
-
response:
|
|
198
|
-
provider:
|
|
199
|
-
access_token:
|
|
200
|
-
issued_at:
|
|
201
|
-
expires_in:
|
|
202
|
-
refresh_token:
|
|
203
|
-
refresh_token_expires_in:
|
|
204
|
-
refresh_expires_in:
|
|
205
|
-
id_token:
|
|
206
|
-
scope:
|
|
197
|
+
response: alepha181.TObject<{
|
|
198
|
+
provider: alepha181.TString;
|
|
199
|
+
access_token: alepha181.TString;
|
|
200
|
+
issued_at: alepha181.TNumber;
|
|
201
|
+
expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
202
|
+
refresh_token: alepha181.TOptional<alepha181.TString>;
|
|
203
|
+
refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
204
|
+
refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
205
|
+
id_token: alepha181.TOptional<alepha181.TString>;
|
|
206
|
+
scope: alepha181.TOptional<alepha181.TString>;
|
|
207
207
|
}>;
|
|
208
208
|
}>;
|
|
209
209
|
/**
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
* Login for local password-based authentication.
|
|
211
|
+
*/
|
|
212
212
|
readonly token: alepha_server0.RoutePrimitive<{
|
|
213
|
-
query:
|
|
214
|
-
provider:
|
|
215
|
-
realm:
|
|
213
|
+
query: alepha181.TObject<{
|
|
214
|
+
provider: alepha181.TString;
|
|
215
|
+
realm: alepha181.TOptional<alepha181.TString>;
|
|
216
216
|
}>;
|
|
217
|
-
body:
|
|
218
|
-
username:
|
|
219
|
-
password:
|
|
217
|
+
body: alepha181.TObject<{
|
|
218
|
+
username: alepha181.TString;
|
|
219
|
+
password: alepha181.TString;
|
|
220
220
|
}>;
|
|
221
|
-
response:
|
|
222
|
-
provider:
|
|
223
|
-
access_token:
|
|
224
|
-
issued_at:
|
|
225
|
-
expires_in:
|
|
226
|
-
refresh_token:
|
|
227
|
-
refresh_token_expires_in:
|
|
228
|
-
refresh_expires_in:
|
|
229
|
-
id_token:
|
|
230
|
-
scope:
|
|
231
|
-
user:
|
|
232
|
-
id:
|
|
233
|
-
name:
|
|
234
|
-
email:
|
|
235
|
-
username:
|
|
236
|
-
picture:
|
|
237
|
-
sessionId:
|
|
238
|
-
organizations:
|
|
239
|
-
roles:
|
|
221
|
+
response: alepha181.TObject<{
|
|
222
|
+
provider: alepha181.TString;
|
|
223
|
+
access_token: alepha181.TString;
|
|
224
|
+
issued_at: alepha181.TNumber;
|
|
225
|
+
expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
226
|
+
refresh_token: alepha181.TOptional<alepha181.TString>;
|
|
227
|
+
refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
228
|
+
refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
|
|
229
|
+
id_token: alepha181.TOptional<alepha181.TString>;
|
|
230
|
+
scope: alepha181.TOptional<alepha181.TString>;
|
|
231
|
+
user: alepha181.TObject<{
|
|
232
|
+
id: alepha181.TString;
|
|
233
|
+
name: alepha181.TOptional<alepha181.TString>;
|
|
234
|
+
email: alepha181.TOptional<alepha181.TString>;
|
|
235
|
+
username: alepha181.TOptional<alepha181.TString>;
|
|
236
|
+
picture: alepha181.TOptional<alepha181.TString>;
|
|
237
|
+
sessionId: alepha181.TOptional<alepha181.TString>;
|
|
238
|
+
organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
239
|
+
roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
|
|
240
240
|
}>;
|
|
241
|
-
api:
|
|
242
|
-
prefix:
|
|
243
|
-
links:
|
|
244
|
-
name:
|
|
245
|
-
group:
|
|
246
|
-
path:
|
|
247
|
-
method:
|
|
248
|
-
requestBodyType:
|
|
249
|
-
service:
|
|
250
|
-
rawSchema:
|
|
251
|
-
body:
|
|
252
|
-
response:
|
|
241
|
+
api: alepha181.TObject<{
|
|
242
|
+
prefix: alepha181.TOptional<alepha181.TString>;
|
|
243
|
+
links: alepha181.TArray<alepha181.TObject<{
|
|
244
|
+
name: alepha181.TString;
|
|
245
|
+
group: alepha181.TOptional<alepha181.TString>;
|
|
246
|
+
path: alepha181.TString;
|
|
247
|
+
method: alepha181.TOptional<alepha181.TString>;
|
|
248
|
+
requestBodyType: alepha181.TOptional<alepha181.TString>;
|
|
249
|
+
service: alepha181.TOptional<alepha181.TString>;
|
|
250
|
+
rawSchema: alepha181.TOptional<alepha181.TObject<{
|
|
251
|
+
body: alepha181.TOptional<alepha181.TString>;
|
|
252
|
+
response: alepha181.TOptional<alepha181.TString>;
|
|
253
253
|
}>>;
|
|
254
254
|
}>>;
|
|
255
255
|
}>;
|
|
256
256
|
}>;
|
|
257
257
|
}>;
|
|
258
258
|
/**
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
* Oauth2/OIDC login route.
|
|
260
|
+
*/
|
|
261
261
|
readonly login: alepha_server0.RoutePrimitive<{
|
|
262
|
-
query:
|
|
263
|
-
provider:
|
|
264
|
-
realm:
|
|
265
|
-
redirect_uri:
|
|
262
|
+
query: alepha181.TObject<{
|
|
263
|
+
provider: alepha181.TString;
|
|
264
|
+
realm: alepha181.TOptional<alepha181.TString>;
|
|
265
|
+
redirect_uri: alepha181.TOptional<alepha181.TString>;
|
|
266
266
|
}>;
|
|
267
267
|
}>;
|
|
268
268
|
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
269
|
+
* Callback for OAuth2/OIDC providers.
|
|
270
|
+
* It handles the authorization code flow and retrieves the access token.
|
|
271
|
+
*/
|
|
272
272
|
readonly callback: alepha_server0.RoutePrimitive<alepha_server0.RequestConfigSchema>;
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
* Logout route for OAuth2/OIDC providers.
|
|
275
|
+
*/
|
|
276
276
|
readonly logout: alepha_server0.RoutePrimitive<{
|
|
277
|
-
query:
|
|
278
|
-
post_logout_redirect_uri:
|
|
277
|
+
query: alepha181.TObject<{
|
|
278
|
+
post_logout_redirect_uri: alepha181.TOptional<alepha181.TString>;
|
|
279
279
|
}>;
|
|
280
280
|
}>;
|
|
281
281
|
/**
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
* Find an auth provider by name and optionally by realm.
|
|
283
|
+
* When realm is specified, it filters providers by both name and realm.
|
|
284
|
+
* This enables multi-realm setups where multiple providers share the same name (e.g., "credentials").
|
|
285
|
+
*/
|
|
286
286
|
protected provider(opts: string | {
|
|
287
287
|
provider: string;
|
|
288
288
|
realm?: string;
|
|
@@ -362,13 +362,13 @@ declare const $auth: {
|
|
|
362
362
|
};
|
|
363
363
|
type AuthPrimitiveOptions = {
|
|
364
364
|
/**
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
* Name of the identity provider.
|
|
366
|
+
* If not provided, it will be derived from the property key.
|
|
367
|
+
*/
|
|
368
368
|
name?: string;
|
|
369
369
|
/**
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
* If true, auth provider will be skipped.
|
|
371
|
+
*/
|
|
372
372
|
disabled?: boolean;
|
|
373
373
|
} & (AuthExternal | AuthInternal);
|
|
374
374
|
/**
|
|
@@ -376,60 +376,60 @@ type AuthPrimitiveOptions = {
|
|
|
376
376
|
*/
|
|
377
377
|
type AuthExternal = {
|
|
378
378
|
/**
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
* Only OIDC is supported for external authentication.
|
|
380
|
+
*/
|
|
381
381
|
oidc: OidcOptions;
|
|
382
382
|
/**
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
383
|
+
* For anonymous access, this will expect a service account access token.
|
|
384
|
+
*
|
|
385
|
+
* ```ts
|
|
386
|
+
* class App {
|
|
387
|
+
* anonymous = $serviceAccount(...);
|
|
388
|
+
* auth = $auth({
|
|
389
|
+
* // ... config ...
|
|
390
|
+
* fallback: this.anonymous,
|
|
391
|
+
* })
|
|
392
|
+
* }
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
395
|
fallback?: () => Async<AccessToken>;
|
|
396
396
|
};
|
|
397
397
|
/**
|
|
398
398
|
* When using your own authentication system, e.g. using a database to store user accounts.
|
|
399
399
|
* This is usually used with a custom login form.
|
|
400
400
|
*
|
|
401
|
-
* This relies on the `
|
|
401
|
+
* This relies on the `issuer`, which is used to create/verify the access token.
|
|
402
402
|
*/
|
|
403
403
|
type AuthInternal = {
|
|
404
|
-
|
|
404
|
+
issuer: IssuerPrimitive;
|
|
405
405
|
} & ({
|
|
406
406
|
/**
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
407
|
+
* The common username/password authentication.
|
|
408
|
+
*
|
|
409
|
+
* - It uses the OAuth2 Client Credentials flow to obtain an access token.
|
|
410
|
+
*
|
|
411
|
+
* This is usually used with a custom login form on your website or mobile app.
|
|
412
|
+
*/
|
|
413
413
|
credentials: CredentialsOptions;
|
|
414
414
|
} | {
|
|
415
415
|
/**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
416
|
+
* OAuth2 authentication. Delegates authentication to an OAuth2 provider. (e.g. Google, GitHub, etc.)
|
|
417
|
+
*
|
|
418
|
+
* - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
|
|
419
|
+
*
|
|
420
|
+
* This is usually used with a login button that redirects to the OAuth2 provider.
|
|
421
|
+
*/
|
|
422
422
|
oauth: OAuth2Options;
|
|
423
423
|
} | {
|
|
424
424
|
/**
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
425
|
+
* Like OAuth2, but uses OIDC (OpenID Connect) for authentication and user information retrieval.
|
|
426
|
+
* OIDC is an identity layer on top of OAuth2, providing user authentication and profile information.
|
|
427
|
+
*
|
|
428
|
+
* - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
|
|
429
|
+
* - PCKE (Proof Key for Code Exchange) is recommended for security.
|
|
430
|
+
*
|
|
431
|
+
* This is usually used with a login button that redirects to the OIDC provider.
|
|
432
|
+
*/
|
|
433
433
|
oidc: OidcOptions;
|
|
434
434
|
});
|
|
435
435
|
type CredentialsOptions = {
|
|
@@ -442,36 +442,36 @@ interface Credentials {
|
|
|
442
442
|
}
|
|
443
443
|
interface OidcOptions {
|
|
444
444
|
/**
|
|
445
|
-
|
|
446
|
-
|
|
445
|
+
* URL of the OIDC issuer.
|
|
446
|
+
*/
|
|
447
447
|
issuer: string;
|
|
448
448
|
/**
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
* Client ID for the OIDC client.
|
|
450
|
+
*/
|
|
451
451
|
clientId: string;
|
|
452
452
|
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
453
|
+
* Client secret for the OIDC client.
|
|
454
|
+
* Optional if PKCE (Proof Key for Code Exchange) is used.
|
|
455
|
+
*/
|
|
456
456
|
clientSecret?: string;
|
|
457
457
|
/**
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
458
|
+
* Redirect URI for the OIDC client.
|
|
459
|
+
* This is where the user will be redirected after authentication.
|
|
460
|
+
*/
|
|
461
461
|
redirectUri?: string;
|
|
462
462
|
/**
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
* For external auth providers only.
|
|
464
|
+
* Take the ID token instead of the access token for validation.
|
|
465
|
+
*/
|
|
466
466
|
useIdToken?: boolean;
|
|
467
467
|
/**
|
|
468
|
-
|
|
469
|
-
|
|
468
|
+
* URI to redirect the user after logout.
|
|
469
|
+
*/
|
|
470
470
|
logoutUri?: string;
|
|
471
471
|
/**
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
472
|
+
* Optional scope for the OIDC client.
|
|
473
|
+
* @default "openid profile email".
|
|
474
|
+
*/
|
|
475
475
|
scope?: string;
|
|
476
476
|
account?: LinkAccountFn;
|
|
477
477
|
}
|
|
@@ -485,33 +485,33 @@ interface LinkAccountOptions {
|
|
|
485
485
|
type LinkAccountFn = (tokens: LinkAccountOptions) => Async<UserAccount>;
|
|
486
486
|
interface OAuth2Options {
|
|
487
487
|
/**
|
|
488
|
-
|
|
489
|
-
|
|
488
|
+
* URL of the OAuth2 authorization endpoint.
|
|
489
|
+
*/
|
|
490
490
|
clientId: string;
|
|
491
491
|
/**
|
|
492
|
-
|
|
493
|
-
|
|
492
|
+
* Client secret for the OAuth2 client.
|
|
493
|
+
*/
|
|
494
494
|
clientSecret: string;
|
|
495
495
|
/**
|
|
496
|
-
|
|
497
|
-
|
|
496
|
+
* URL of the OAuth2 authorization endpoint.
|
|
497
|
+
*/
|
|
498
498
|
authorization: string;
|
|
499
499
|
/**
|
|
500
|
-
|
|
501
|
-
|
|
500
|
+
* URL of the OAuth2 token endpoint.
|
|
501
|
+
*/
|
|
502
502
|
token: string;
|
|
503
503
|
/**
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
* Function to retrieve user profile information from the OAuth2 tokens.
|
|
505
|
+
*/
|
|
506
506
|
userinfo: (tokens: Tokens) => Async<OAuth2Profile>;
|
|
507
507
|
account?: LinkAccountFn;
|
|
508
508
|
/**
|
|
509
|
-
|
|
510
|
-
|
|
509
|
+
* URL of the OAuth2 authorization endpoint.
|
|
510
|
+
*/
|
|
511
511
|
redirectUri?: string;
|
|
512
512
|
/**
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
* URL of the OAuth2 authorization endpoint.
|
|
514
|
+
*/
|
|
515
515
|
scope?: string;
|
|
516
516
|
}
|
|
517
517
|
declare class AuthPrimitive extends Primitive<AuthPrimitiveOptions> {
|
|
@@ -519,19 +519,19 @@ declare class AuthPrimitive extends Primitive<AuthPrimitiveOptions> {
|
|
|
519
519
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
520
520
|
oauth?: Configuration;
|
|
521
521
|
get name(): string;
|
|
522
|
-
get
|
|
522
|
+
get issuer(): IssuerPrimitive | undefined;
|
|
523
523
|
get jwks_uri(): string;
|
|
524
524
|
get scope(): string | undefined;
|
|
525
525
|
get redirect_uri(): string | undefined;
|
|
526
526
|
/**
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
* Refreshes the access token using the refresh token.
|
|
528
|
+
* Can be used on oauth2, oidc or credentials auth providers.
|
|
529
|
+
*/
|
|
530
530
|
refresh(refreshToken: string, accessToken?: string): Promise<AccessTokenResponse>;
|
|
531
531
|
/**
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
532
|
+
* Extracts user information from the access token.
|
|
533
|
+
* This is used to create a user account from the access token.
|
|
534
|
+
*/
|
|
535
535
|
user(tokens: Tokens): Promise<UserAccount>;
|
|
536
536
|
protected getUserFromIdToken(idToken: string): OAuth2Profile;
|
|
537
537
|
prepare(): Promise<void>;
|
|
@@ -552,7 +552,7 @@ interface WithLoginFn {
|
|
|
552
552
|
*
|
|
553
553
|
* Uses username and password to authenticate users.
|
|
554
554
|
*/
|
|
555
|
-
declare const $authCredentials: (realm:
|
|
555
|
+
declare const $authCredentials: (realm: IssuerPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region ../../src/server/auth/primitives/$authGithub.d.ts
|
|
558
558
|
/**
|
|
@@ -565,7 +565,7 @@ declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?:
|
|
|
565
565
|
* - `GITHUB_CLIENT_ID`: The client ID obtained from the GitHub Developer Settings.
|
|
566
566
|
* - `GITHUB_CLIENT_SECRET`: The client secret obtained from the GitHub Developer Settings.
|
|
567
567
|
*/
|
|
568
|
-
declare const $authGithub: (realm:
|
|
568
|
+
declare const $authGithub: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
|
|
569
569
|
//#endregion
|
|
570
570
|
//#region ../../src/server/auth/primitives/$authGoogle.d.ts
|
|
571
571
|
/**
|
|
@@ -578,16 +578,16 @@ declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partia
|
|
|
578
578
|
* - `GOOGLE_CLIENT_ID`: The client ID obtained from the Google Developer Console.
|
|
579
579
|
* - `GOOGLE_CLIENT_SECRET`: The client secret obtained from the Google Developer Console.
|
|
580
580
|
*/
|
|
581
|
-
declare const $authGoogle: (realm:
|
|
581
|
+
declare const $authGoogle: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
|
|
582
582
|
//#endregion
|
|
583
583
|
//#region ../../src/server/auth/index.d.ts
|
|
584
584
|
declare module "alepha" {
|
|
585
585
|
interface State {
|
|
586
586
|
/**
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
587
|
+
* The authenticated user account attached to the server request state.
|
|
588
|
+
*
|
|
589
|
+
* @internal
|
|
590
|
+
*/
|
|
591
591
|
"alepha.server.request.user"?: UserAccount;
|
|
592
592
|
}
|
|
593
593
|
}
|
|
@@ -604,7 +604,7 @@ declare module "alepha" {
|
|
|
604
604
|
* @see {@link ServerAuthProvider}
|
|
605
605
|
* @module alepha.server.auth
|
|
606
606
|
*/
|
|
607
|
-
declare const AlephaServerAuth:
|
|
607
|
+
declare const AlephaServerAuth: alepha181.Service<alepha181.Module>;
|
|
608
608
|
//#endregion
|
|
609
609
|
export { $auth, $authCredentials, $authGithub, $authGoogle, AccessToken, AlephaServerAuth, AuthExternal, AuthInternal, AuthPrimitive, AuthPrimitiveOptions, AuthenticationProvider, Credentials, CredentialsFn, CredentialsOptions, LinkAccountFn, LinkAccountOptions, OAuth2Options, OAuth2Profile, OidcOptions, ServerAuthProvider, TokenResponse, Tokens, UserinfoResponse, WithLinkFn, WithLoginFn, alephaServerAuthRoutes, authenticationProviderSchema, tokenResponseSchema, tokensSchema, userinfoResponseSchema };
|
|
610
610
|
//# sourceMappingURL=index.d.ts.map
|