@absolutejs/auth 0.65.5 → 0.66.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/dist/agents/context.d.ts +5 -18
- package/dist/agents/index.js +3 -3
- package/dist/agents/index.js.map +3 -3
- package/dist/agents/routes.d.ts +24 -56
- package/dist/apikeys/routes.d.ts +169 -78
- package/dist/authContext.d.ts +34 -79
- package/dist/authorization/protectPermission.d.ts +11 -23
- package/dist/cli/migrate.js +2 -2
- package/dist/cli/migrate.js.map +4 -4
- package/dist/compliance/routes.d.ts +179 -54
- package/dist/credentials/emailVerification.d.ts +173 -56
- package/dist/credentials/login.d.ts +192 -63
- package/dist/credentials/passwordReset.d.ts +171 -60
- package/dist/credentials/register.d.ts +182 -41
- package/dist/credentials/routes.d.ts +46 -36
- package/dist/htmx/configuredRoutes.d.ts +263 -114
- package/dist/htmx/routes.d.ts +261 -89
- package/dist/index.d.ts +663 -443
- package/dist/index.js +475 -448
- package/dist/index.js.map +48 -48
- package/dist/manifest.js +86 -4
- package/dist/manifest.js.map +3 -3
- package/dist/mfa/challenge.d.ts +189 -59
- package/dist/mfa/management.d.ts +179 -54
- package/dist/mfa/routes.d.ts +34 -40
- package/dist/mfa/sms.d.ts +187 -59
- package/dist/mfa/totp.d.ts +187 -57
- package/dist/oidc/routes.d.ts +73 -74
- package/dist/oidc/vciRoutes.d.ts +9 -45
- package/dist/organizations/routes.d.ts +215 -77
- package/dist/passwordless/routes.d.ts +22 -34
- package/dist/portal/routes.d.ts +162 -55
- package/dist/roles/routes.d.ts +198 -67
- package/dist/routes/authorize.d.ts +182 -90
- package/dist/routes/callback.d.ts +189 -38
- package/dist/routes/profile.d.ts +177 -51
- package/dist/routes/protectRoute.d.ts +11 -23
- package/dist/routes/refresh.d.ts +177 -51
- package/dist/routes/requireAuth.d.ts +9 -21
- package/dist/routes/revoke.d.ts +177 -51
- package/dist/routes/sessions.d.ts +187 -61
- package/dist/routes/signout.d.ts +174 -50
- package/dist/routes/stepUp.d.ts +11 -23
- package/dist/routes/userStatus.d.ts +174 -52
- package/dist/scim/routes.d.ts +208 -73
- package/dist/server.js +475 -448
- package/dist/server.js.map +48 -48
- package/dist/session/cleanup.d.ts +5 -18
- package/dist/session/state.d.ts +3 -23
- package/dist/sso/discoveryRoute.d.ts +158 -52
- package/dist/sso/oidcRoutes.d.ts +211 -59
- package/dist/sso/samlIdpRoutes.d.ts +175 -46
- package/dist/sso/samlRoutes.d.ts +217 -69
- package/dist/typebox.d.ts +4 -4
- package/dist/types.d.ts +3 -5
- package/dist/vault/index.js +3 -3
- package/dist/vault/index.js.map +3 -3
- package/dist/vc/statusListRoutes.d.ts +158 -52
- package/dist/vc/vpRoutes.d.ts +170 -66
- package/dist/webauthn/routes.d.ts +199 -66
- package/package.json +8 -120
package/dist/agents/routes.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type AgentAuthConfig } from './config';
|
|
|
3
3
|
import { agentAuthChallenge } from './context';
|
|
4
4
|
import { agentRegistrationDiscoveryMetadata } from './registration';
|
|
5
5
|
export { agentAuthChallenge, agentRegistrationDiscoveryMetadata };
|
|
6
|
-
export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
6
|
+
export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", "local", {
|
|
7
7
|
decorator: {};
|
|
8
8
|
store: {};
|
|
9
9
|
derive: {
|
|
@@ -12,22 +12,16 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
12
12
|
message: "Agent is not authenticated" | "Insufficient agent scopes";
|
|
13
13
|
}) => AuthFailReturn | Promise<AuthFailReturn>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn>>>;
|
|
14
14
|
};
|
|
15
|
-
resolve: {};
|
|
16
15
|
}, {
|
|
17
16
|
typebox: {};
|
|
18
|
-
error:
|
|
17
|
+
error: [];
|
|
19
18
|
}, {
|
|
20
19
|
schema: {};
|
|
21
|
-
|
|
20
|
+
schemas: {};
|
|
22
21
|
macro: {};
|
|
23
22
|
macroFn: {};
|
|
24
23
|
parser: {};
|
|
25
|
-
response:
|
|
26
|
-
readonly protectAgent: <AuthReturn, AuthFailReturn>(requiredScopes: string[], handleAuth: (principal: import("./types").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
|
|
27
|
-
code: "Forbidden" | "Unauthorized";
|
|
28
|
-
message: "Agent is not authenticated" | "Insufficient agent scopes";
|
|
29
|
-
}) => AuthFailReturn | Promise<AuthFailReturn>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn>>>;
|
|
30
|
-
}>;
|
|
24
|
+
response: {};
|
|
31
25
|
}, {} | ({
|
|
32
26
|
[x: string]: {
|
|
33
27
|
get: {
|
|
@@ -45,6 +39,7 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
45
39
|
bearer_methods_supported: string[];
|
|
46
40
|
};
|
|
47
41
|
};
|
|
42
|
+
error: never;
|
|
48
43
|
};
|
|
49
44
|
};
|
|
50
45
|
} & {
|
|
@@ -57,6 +52,7 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
57
52
|
response: {
|
|
58
53
|
200: Response;
|
|
59
54
|
};
|
|
55
|
+
error: never;
|
|
60
56
|
};
|
|
61
57
|
};
|
|
62
58
|
} & {
|
|
@@ -69,6 +65,7 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
69
65
|
response: {
|
|
70
66
|
200: Response;
|
|
71
67
|
};
|
|
68
|
+
error: never;
|
|
72
69
|
};
|
|
73
70
|
};
|
|
74
71
|
} & {
|
|
@@ -81,6 +78,7 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
81
78
|
response: {
|
|
82
79
|
200: Response;
|
|
83
80
|
};
|
|
81
|
+
error: never;
|
|
84
82
|
};
|
|
85
83
|
};
|
|
86
84
|
} & {
|
|
@@ -93,6 +91,7 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
93
91
|
response: {
|
|
94
92
|
200: Response;
|
|
95
93
|
};
|
|
94
|
+
error: never;
|
|
96
95
|
};
|
|
97
96
|
};
|
|
98
97
|
} & {
|
|
@@ -105,59 +104,34 @@ export declare const agentAuthPlugin: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
105
104
|
response: {
|
|
106
105
|
200: Response;
|
|
107
106
|
};
|
|
107
|
+
error: never;
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
}),
|
|
111
|
-
|
|
112
|
-
resolve: {};
|
|
113
|
-
schema: {};
|
|
114
|
-
standaloneSchema: {};
|
|
115
|
-
response: {};
|
|
116
|
-
}, {
|
|
117
|
-
derive: {};
|
|
118
|
-
resolve: {};
|
|
119
|
-
schema: {};
|
|
120
|
-
standaloneSchema: {};
|
|
121
|
-
response: {};
|
|
122
|
-
}>;
|
|
123
|
-
export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
110
|
+
}), import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral>;
|
|
111
|
+
export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", "local", {
|
|
124
112
|
decorator: {};
|
|
125
113
|
store: {};
|
|
126
114
|
derive: {};
|
|
127
|
-
resolve: {};
|
|
128
115
|
}, {
|
|
129
116
|
typebox: {};
|
|
130
|
-
error:
|
|
117
|
+
error: [];
|
|
131
118
|
}, {
|
|
132
119
|
schema: {};
|
|
133
|
-
|
|
120
|
+
schemas: {};
|
|
134
121
|
macro: {};
|
|
135
122
|
macroFn: {};
|
|
136
123
|
parser: {};
|
|
137
124
|
response: {};
|
|
138
|
-
}, {}, {
|
|
139
|
-
derive: {};
|
|
140
|
-
resolve: {};
|
|
141
|
-
schema: {};
|
|
142
|
-
standaloneSchema: {};
|
|
143
|
-
response: {};
|
|
144
|
-
}, {
|
|
145
|
-
derive: {};
|
|
146
|
-
resolve: {};
|
|
147
|
-
schema: {};
|
|
148
|
-
standaloneSchema: {};
|
|
149
|
-
response: {};
|
|
150
|
-
}> | Elysia<"", {
|
|
125
|
+
}, {}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral> | Elysia<"", "local", {
|
|
151
126
|
decorator: {};
|
|
152
127
|
store: {};
|
|
153
128
|
derive: {};
|
|
154
|
-
resolve: {};
|
|
155
129
|
}, {
|
|
156
130
|
typebox: {};
|
|
157
|
-
error:
|
|
131
|
+
error: [];
|
|
158
132
|
}, {
|
|
159
133
|
schema: {};
|
|
160
|
-
|
|
134
|
+
schemas: {};
|
|
161
135
|
macro: {};
|
|
162
136
|
macroFn: {};
|
|
163
137
|
parser: {};
|
|
@@ -179,6 +153,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
179
153
|
bearer_methods_supported: string[];
|
|
180
154
|
};
|
|
181
155
|
};
|
|
156
|
+
error: never;
|
|
182
157
|
};
|
|
183
158
|
};
|
|
184
159
|
} & {
|
|
@@ -191,6 +166,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
191
166
|
response: {
|
|
192
167
|
200: Response;
|
|
193
168
|
};
|
|
169
|
+
error: never;
|
|
194
170
|
};
|
|
195
171
|
};
|
|
196
172
|
} & {
|
|
@@ -203,6 +179,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
203
179
|
response: {
|
|
204
180
|
200: Response;
|
|
205
181
|
};
|
|
182
|
+
error: never;
|
|
206
183
|
};
|
|
207
184
|
};
|
|
208
185
|
} & {
|
|
@@ -215,6 +192,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
215
192
|
response: {
|
|
216
193
|
200: Response;
|
|
217
194
|
};
|
|
195
|
+
error: never;
|
|
218
196
|
};
|
|
219
197
|
};
|
|
220
198
|
} & {
|
|
@@ -227,6 +205,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
227
205
|
response: {
|
|
228
206
|
200: Response;
|
|
229
207
|
};
|
|
208
|
+
error: never;
|
|
230
209
|
};
|
|
231
210
|
};
|
|
232
211
|
} & {
|
|
@@ -239,18 +218,7 @@ export declare const agentAuthRoutes: (config?: AgentAuthConfig) => Elysia<"", {
|
|
|
239
218
|
response: {
|
|
240
219
|
200: Response;
|
|
241
220
|
};
|
|
221
|
+
error: never;
|
|
242
222
|
};
|
|
243
223
|
};
|
|
244
|
-
},
|
|
245
|
-
derive: {};
|
|
246
|
-
resolve: {};
|
|
247
|
-
schema: {};
|
|
248
|
-
standaloneSchema: {};
|
|
249
|
-
response: {};
|
|
250
|
-
}, {
|
|
251
|
-
derive: {};
|
|
252
|
-
resolve: {};
|
|
253
|
-
schema: {};
|
|
254
|
-
standaloneSchema: {};
|
|
255
|
-
response: {};
|
|
256
|
-
}>;
|
|
224
|
+
}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral>;
|
package/dist/apikeys/routes.d.ts
CHANGED
|
@@ -1,83 +1,174 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { type ApiKeysConfig } from './config';
|
|
3
|
-
export declare const apiKeysRoutes: ({ accessTokenStore, accessTokenTtlMs, apiClientStore, tokenRoute }: ApiKeysConfig) => Elysia<"", {
|
|
4
|
-
decorator: {};
|
|
5
|
-
store: {};
|
|
6
|
-
derive: {};
|
|
7
|
-
resolve: {};
|
|
8
|
-
}, {
|
|
3
|
+
export declare const apiKeysRoutes: ({ accessTokenStore, accessTokenTtlMs, apiClientStore, tokenRoute }: ApiKeysConfig) => Elysia<"", "local", import("elysia/types").DefaultSingleton, {
|
|
9
4
|
typebox: {};
|
|
10
|
-
error:
|
|
11
|
-
}, {
|
|
12
|
-
schema: {};
|
|
13
|
-
standaloneSchema: {};
|
|
14
|
-
macro: {};
|
|
15
|
-
macroFn: {};
|
|
16
|
-
parser: {};
|
|
17
|
-
response: {};
|
|
18
|
-
}, {}, {
|
|
19
|
-
derive: {};
|
|
20
|
-
resolve: {};
|
|
21
|
-
schema: {};
|
|
22
|
-
standaloneSchema: {};
|
|
23
|
-
response: {};
|
|
24
|
-
}, {
|
|
25
|
-
derive: {};
|
|
26
|
-
resolve: {};
|
|
27
|
-
schema: {};
|
|
28
|
-
standaloneSchema: {};
|
|
29
|
-
response: {};
|
|
30
|
-
}> | Elysia<"", {
|
|
31
|
-
decorator: {};
|
|
32
|
-
store: {};
|
|
33
|
-
derive: {};
|
|
34
|
-
resolve: {};
|
|
35
|
-
}, {
|
|
5
|
+
error: [];
|
|
6
|
+
}, import("elysia/types").DefaultMetadata, {}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral> | import("elysia/types").AddRoute<"", "local", import("elysia/types").DefaultSingleton, {
|
|
36
7
|
typebox: {};
|
|
37
|
-
error:
|
|
38
|
-
}, {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
grant_type?: string | undefined;
|
|
52
|
-
client_secret?: string | undefined;
|
|
53
|
-
};
|
|
54
|
-
params: {};
|
|
55
|
-
query: unknown;
|
|
56
|
-
headers: unknown;
|
|
57
|
-
response: {
|
|
58
|
-
200: Response;
|
|
59
|
-
422: {
|
|
60
|
-
type: "validation";
|
|
61
|
-
on: string;
|
|
62
|
-
summary?: string;
|
|
63
|
-
message?: string;
|
|
64
|
-
found?: unknown;
|
|
65
|
-
property?: string;
|
|
66
|
-
expected?: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
8
|
+
error: [];
|
|
9
|
+
}, import("elysia/types").DefaultMetadata, {}, import("elysia/types").DefaultEphemeral, import("elysia/types").DefaultEphemeral, "post", `/${string}`, import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
|
|
10
|
+
body: import("typebox").TObject<{
|
|
11
|
+
client_id: import("typebox").TOptional<import("typebox").TString>;
|
|
12
|
+
client_secret: import("typebox").TOptional<import("typebox").TString>;
|
|
13
|
+
grant_type: import("typebox").TOptional<import("typebox").TString>;
|
|
14
|
+
scope: import("typebox").TOptional<import("typebox").TString>;
|
|
15
|
+
}>;
|
|
16
|
+
}, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>, {}, ({ body, headers }: {
|
|
17
|
+
body: {
|
|
18
|
+
client_id?: string | undefined;
|
|
19
|
+
scope?: string | undefined;
|
|
20
|
+
grant_type?: string | undefined;
|
|
21
|
+
client_secret?: string | undefined;
|
|
70
22
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
23
|
+
query: Record<string, string | undefined>;
|
|
24
|
+
params: {};
|
|
25
|
+
headers: Record<string, string | undefined>;
|
|
26
|
+
cookie: Record<string, import("elysia").Cookie<unknown>>;
|
|
27
|
+
server: import("elysia").Server | null;
|
|
28
|
+
redirect: import("elysia").redirect;
|
|
29
|
+
set: {
|
|
30
|
+
headers: import("elysia").HTTPHeaders;
|
|
31
|
+
status?: number | keyof import("elysia").StatusMap;
|
|
32
|
+
cookie?: Record<string, import("elysia").BaseCookie>;
|
|
33
|
+
};
|
|
34
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 501 | 204 | 404 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
35
|
+
readonly 100: "Continue";
|
|
36
|
+
readonly 101: "Switching Protocols";
|
|
37
|
+
readonly 102: "Processing";
|
|
38
|
+
readonly 103: "Early Hints";
|
|
39
|
+
readonly 200: "OK";
|
|
40
|
+
readonly 201: "Created";
|
|
41
|
+
readonly 202: "Accepted";
|
|
42
|
+
readonly 203: "Non-Authoritative Information";
|
|
43
|
+
readonly 204: "No Content";
|
|
44
|
+
readonly 205: "Reset Content";
|
|
45
|
+
readonly 206: "Partial Content";
|
|
46
|
+
readonly 207: "Multi-Status";
|
|
47
|
+
readonly 208: "Already Reported";
|
|
48
|
+
readonly 300: "Multiple Choices";
|
|
49
|
+
readonly 301: "Moved Permanently";
|
|
50
|
+
readonly 302: "Found";
|
|
51
|
+
readonly 303: "See Other";
|
|
52
|
+
readonly 304: "Not Modified";
|
|
53
|
+
readonly 307: "Temporary Redirect";
|
|
54
|
+
readonly 308: "Permanent Redirect";
|
|
55
|
+
readonly 400: "Bad Request";
|
|
56
|
+
readonly 401: "Unauthorized";
|
|
57
|
+
readonly 402: "Payment Required";
|
|
58
|
+
readonly 403: "Forbidden";
|
|
59
|
+
readonly 404: "Not Found";
|
|
60
|
+
readonly 405: "Method Not Allowed";
|
|
61
|
+
readonly 406: "Not Acceptable";
|
|
62
|
+
readonly 407: "Proxy Authentication Required";
|
|
63
|
+
readonly 408: "Request Timeout";
|
|
64
|
+
readonly 409: "Conflict";
|
|
65
|
+
readonly 410: "Gone";
|
|
66
|
+
readonly 411: "Length Required";
|
|
67
|
+
readonly 412: "Precondition Failed";
|
|
68
|
+
readonly 413: "Payload Too Large";
|
|
69
|
+
readonly 414: "URI Too Long";
|
|
70
|
+
readonly 415: "Unsupported Media Type";
|
|
71
|
+
readonly 416: "Range Not Satisfiable";
|
|
72
|
+
readonly 417: "Expectation Failed";
|
|
73
|
+
readonly 418: "I'm a teapot";
|
|
74
|
+
readonly 420: "Enhance Your Calm";
|
|
75
|
+
readonly 421: "Misdirected Request";
|
|
76
|
+
readonly 422: "Unprocessable Content";
|
|
77
|
+
readonly 423: "Locked";
|
|
78
|
+
readonly 424: "Failed Dependency";
|
|
79
|
+
readonly 425: "Too Early";
|
|
80
|
+
readonly 426: "Upgrade Required";
|
|
81
|
+
readonly 428: "Precondition Required";
|
|
82
|
+
readonly 429: "Too Many Requests";
|
|
83
|
+
readonly 431: "Request Header Fields Too Large";
|
|
84
|
+
readonly 451: "Unavailable For Legal Reasons";
|
|
85
|
+
readonly 500: "Internal Server Error";
|
|
86
|
+
readonly 501: "Not Implemented";
|
|
87
|
+
readonly 502: "Bad Gateway";
|
|
88
|
+
readonly 503: "Service Unavailable";
|
|
89
|
+
readonly 504: "Gateway Timeout";
|
|
90
|
+
readonly 505: "HTTP Version Not Supported";
|
|
91
|
+
readonly 506: "Variant Also Negotiates";
|
|
92
|
+
readonly 507: "Insufficient Storage";
|
|
93
|
+
readonly 508: "Loop Detected";
|
|
94
|
+
readonly 510: "Not Extended";
|
|
95
|
+
readonly 511: "Network Authentication Required";
|
|
96
|
+
}[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaStatus<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
|
|
97
|
+
readonly Continue: 100;
|
|
98
|
+
readonly "Switching Protocols": 101;
|
|
99
|
+
readonly Processing: 102;
|
|
100
|
+
readonly "Early Hints": 103;
|
|
101
|
+
readonly OK: 200;
|
|
102
|
+
readonly Created: 201;
|
|
103
|
+
readonly Accepted: 202;
|
|
104
|
+
readonly "Non-Authoritative Information": 203;
|
|
105
|
+
readonly "No Content": 204;
|
|
106
|
+
readonly "Reset Content": 205;
|
|
107
|
+
readonly "Partial Content": 206;
|
|
108
|
+
readonly "Multi-Status": 207;
|
|
109
|
+
readonly "Already Reported": 208;
|
|
110
|
+
readonly "Multiple Choices": 300;
|
|
111
|
+
readonly "Moved Permanently": 301;
|
|
112
|
+
readonly Found: 302;
|
|
113
|
+
readonly "See Other": 303;
|
|
114
|
+
readonly "Not Modified": 304;
|
|
115
|
+
readonly "Temporary Redirect": 307;
|
|
116
|
+
readonly "Permanent Redirect": 308;
|
|
117
|
+
readonly "Bad Request": 400;
|
|
118
|
+
readonly Unauthorized: 401;
|
|
119
|
+
readonly "Payment Required": 402;
|
|
120
|
+
readonly Forbidden: 403;
|
|
121
|
+
readonly "Not Found": 404;
|
|
122
|
+
readonly "Method Not Allowed": 405;
|
|
123
|
+
readonly "Not Acceptable": 406;
|
|
124
|
+
readonly "Proxy Authentication Required": 407;
|
|
125
|
+
readonly "Request Timeout": 408;
|
|
126
|
+
readonly Conflict: 409;
|
|
127
|
+
readonly Gone: 410;
|
|
128
|
+
readonly "Length Required": 411;
|
|
129
|
+
readonly "Precondition Failed": 412;
|
|
130
|
+
readonly "Payload Too Large": 413;
|
|
131
|
+
readonly "URI Too Long": 414;
|
|
132
|
+
readonly "Unsupported Media Type": 415;
|
|
133
|
+
readonly "Range Not Satisfiable": 416;
|
|
134
|
+
readonly "Expectation Failed": 417;
|
|
135
|
+
readonly "I'm a teapot": 418;
|
|
136
|
+
readonly "Enhance Your Calm": 420;
|
|
137
|
+
readonly "Misdirected Request": 421;
|
|
138
|
+
readonly "Unprocessable Content": 422;
|
|
139
|
+
readonly Locked: 423;
|
|
140
|
+
readonly "Failed Dependency": 424;
|
|
141
|
+
readonly "Too Early": 425;
|
|
142
|
+
readonly "Upgrade Required": 426;
|
|
143
|
+
readonly "Precondition Required": 428;
|
|
144
|
+
readonly "Too Many Requests": 429;
|
|
145
|
+
readonly "Request Header Fields Too Large": 431;
|
|
146
|
+
readonly "Unavailable For Legal Reasons": 451;
|
|
147
|
+
readonly "Internal Server Error": 500;
|
|
148
|
+
readonly "Not Implemented": 501;
|
|
149
|
+
readonly "Bad Gateway": 502;
|
|
150
|
+
readonly "Service Unavailable": 503;
|
|
151
|
+
readonly "Gateway Timeout": 504;
|
|
152
|
+
readonly "HTTP Version Not Supported": 505;
|
|
153
|
+
readonly "Variant Also Negotiates": 506;
|
|
154
|
+
readonly "Insufficient Storage": 507;
|
|
155
|
+
readonly "Loop Detected": 508;
|
|
156
|
+
readonly "Not Extended": 510;
|
|
157
|
+
readonly "Network Authentication Required": 511;
|
|
158
|
+
}[Code] : Code>;
|
|
159
|
+
defer: (fn: import("elysia/types").AfterResponseHandler<NoInfer<import("elysia/types").IntersectIfObjectSchema<import("elysia").UnwrapRoute<{
|
|
160
|
+
body: import("typebox").TObject<{
|
|
161
|
+
client_id: import("typebox").TOptional<import("typebox").TString>;
|
|
162
|
+
client_secret: import("typebox").TOptional<import("typebox").TString>;
|
|
163
|
+
grant_type: import("typebox").TOptional<import("typebox").TString>;
|
|
164
|
+
scope: import("typebox").TOptional<import("typebox").TString>;
|
|
165
|
+
}>;
|
|
166
|
+
}, {}, `/${string}`>, import("elysia/types").MergeScopedSchemas<{}, {}, {}>>>, NoInfer<import("elysia/types").DefaultSingleton & {
|
|
167
|
+
derive: {};
|
|
168
|
+
}>>) => import("elysia/types").MaybePromise<void>;
|
|
169
|
+
readonly path: string;
|
|
170
|
+
route?: string | undefined;
|
|
171
|
+
rid?: string | undefined;
|
|
172
|
+
request: Request;
|
|
173
|
+
store: {};
|
|
174
|
+
}) => Promise<Response>>;
|
package/dist/authContext.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const createAuthContext: <UserType>({ agentAuth, authSessionStore
|
|
|
9
9
|
authorization?: AuthorizationConfig<UserType>;
|
|
10
10
|
emit?: AuditEmitter;
|
|
11
11
|
seedSource?: object;
|
|
12
|
-
}) => Elysia<"", {
|
|
12
|
+
}) => Elysia<"", "local", {
|
|
13
13
|
decorator: {};
|
|
14
14
|
store: {
|
|
15
15
|
session: import("./types").SessionRecord<UserType>;
|
|
@@ -22,12 +22,12 @@ export declare const createAuthContext: <UserType>({ agentAuth, authSessionStore
|
|
|
22
22
|
} | {
|
|
23
23
|
readonly code: "Unauthorized";
|
|
24
24
|
readonly message: "User is not authenticated";
|
|
25
|
-
}) => AuthFailReturn) | undefined) => Promise<import("elysia").
|
|
25
|
+
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
26
26
|
} & {
|
|
27
27
|
readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
28
28
|
readonly code: "Unauthorized";
|
|
29
29
|
readonly message: "Recent authentication required";
|
|
30
|
-
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").
|
|
30
|
+
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
|
|
31
31
|
} & {
|
|
32
32
|
readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
|
|
33
33
|
code: "Forbidden" | "Unauthorized";
|
|
@@ -40,12 +40,12 @@ export declare const createAuthContext: <UserType>({ agentAuth, authSessionStore
|
|
|
40
40
|
} | {
|
|
41
41
|
readonly code: "Unauthorized";
|
|
42
42
|
readonly message: "User is not authenticated";
|
|
43
|
-
}) => AuthFailReturn) | undefined) => Promise<import("elysia").
|
|
43
|
+
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
44
44
|
} & {
|
|
45
45
|
readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
46
46
|
readonly code: "Unauthorized";
|
|
47
47
|
readonly message: "Recent authentication required";
|
|
48
|
-
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").
|
|
48
|
+
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
|
|
49
49
|
} & {
|
|
50
50
|
readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
51
51
|
readonly code: "Bad Request";
|
|
@@ -56,80 +56,65 @@ export declare const createAuthContext: <UserType>({ agentAuth, authSessionStore
|
|
|
56
56
|
} | {
|
|
57
57
|
readonly code: "Unauthorized";
|
|
58
58
|
readonly message: "User is not authenticated";
|
|
59
|
-
}) => AuthFailReturn_3) | undefined) => Promise<import("elysia").
|
|
59
|
+
}) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
|
|
60
60
|
} & {
|
|
61
61
|
readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
|
|
62
62
|
code: "Forbidden" | "Unauthorized";
|
|
63
63
|
message: "Agent is not authenticated" | "Insufficient agent scopes";
|
|
64
64
|
}) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
|
|
65
65
|
});
|
|
66
|
-
resolve: {};
|
|
67
66
|
}, {
|
|
68
67
|
typebox: {};
|
|
69
|
-
error:
|
|
70
|
-
} & {
|
|
71
|
-
typebox: {};
|
|
72
|
-
error: {};
|
|
73
|
-
}, ({
|
|
68
|
+
error: [];
|
|
69
|
+
}, (import("elysia/types").DefaultMetadata & {
|
|
74
70
|
schema: {};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
parser: {};
|
|
79
|
-
response: {};
|
|
80
|
-
} & {
|
|
81
|
-
schema: import("elysia").UnwrapRoute<{
|
|
82
|
-
cookie: import("@sinclair/typebox").TObject<{
|
|
83
|
-
user_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"${string}-${string}-${string}-${string}-${string}">>;
|
|
71
|
+
schemas: import("elysia").UnwrapRoute<{
|
|
72
|
+
cookie: import("elysia").TCookieObject<{
|
|
73
|
+
user_session_id: import("typebox").TOptional<import("typebox").TTemplateLiteral<"^.*-.*-.*-.*-.*$">>;
|
|
84
74
|
}>;
|
|
75
|
+
schema: "merge";
|
|
85
76
|
}, {}, "">;
|
|
86
|
-
standaloneSchema: {};
|
|
87
77
|
macro: {};
|
|
88
78
|
macroFn: {};
|
|
89
79
|
parser: {};
|
|
90
|
-
response: import("elysia").ExtractErrorFromHandle<{
|
|
80
|
+
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
91
81
|
readonly protectRoute: <AuthReturn, AuthFailReturn = never>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
92
82
|
readonly code: "Bad Request";
|
|
93
83
|
readonly message: "Cookies are missing";
|
|
94
84
|
} | {
|
|
95
85
|
readonly code: "Unauthorized";
|
|
96
86
|
readonly message: "User is not authenticated";
|
|
97
|
-
}) => AuthFailReturn) | undefined) => Promise<import("elysia").
|
|
87
|
+
}) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
|
|
98
88
|
}>;
|
|
99
89
|
} & {
|
|
100
|
-
schema:
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
schema: {};
|
|
91
|
+
schemas: import("elysia").UnwrapRoute<{
|
|
92
|
+
cookie: import("elysia").TCookieObject<{
|
|
93
|
+
user_session_id: import("typebox").TOptional<import("typebox").TTemplateLiteral<"^.*-.*-.*-.*-.*$">>;
|
|
103
94
|
}>;
|
|
95
|
+
schema: "merge";
|
|
104
96
|
}, {}, "">;
|
|
105
|
-
standaloneSchema: {};
|
|
106
97
|
macro: {};
|
|
107
98
|
macroFn: {};
|
|
108
99
|
parser: {};
|
|
109
|
-
response: import("elysia").ExtractErrorFromHandle<{
|
|
100
|
+
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
110
101
|
readonly requireRecentAuth: <AuthReturn, AuthFailReturn_1>(maxAgeMs: number, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
111
102
|
readonly code: "Unauthorized";
|
|
112
103
|
readonly message: "Recent authentication required";
|
|
113
|
-
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").
|
|
104
|
+
}) => AuthFailReturn_1) | undefined) => Promise<import("elysia").ElysiaStatus<"Unauthorized", "Recent authentication required", 401> | AuthReturn | NonNullable<AuthFailReturn_1>>;
|
|
114
105
|
}>;
|
|
115
|
-
} & ({
|
|
106
|
+
} & (import("elysia/types").DefaultMetadata | {
|
|
116
107
|
schema: {};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
parser: {};
|
|
121
|
-
response: {};
|
|
122
|
-
} | {
|
|
123
|
-
schema: import("elysia").UnwrapRoute<{
|
|
124
|
-
cookie: import("@sinclair/typebox").TObject<{
|
|
125
|
-
user_session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TTemplateLiteralSyntax<"${string}-${string}-${string}-${string}-${string}">>;
|
|
108
|
+
schemas: import("elysia").UnwrapRoute<{
|
|
109
|
+
cookie: import("elysia").TCookieObject<{
|
|
110
|
+
user_session_id: import("typebox").TOptional<import("typebox").TTemplateLiteral<"^.*-.*-.*-.*-.*$">>;
|
|
126
111
|
}>;
|
|
112
|
+
schema: "merge";
|
|
127
113
|
}, {}, "">;
|
|
128
|
-
standaloneSchema: {};
|
|
129
114
|
macro: {};
|
|
130
115
|
macroFn: {};
|
|
131
116
|
parser: {};
|
|
132
|
-
response: import("elysia").ExtractErrorFromHandle<{
|
|
117
|
+
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
133
118
|
readonly protectPermission: <AuthReturn, AuthFailReturn_3>(check: import(".").PermissionCheck, handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: ((error: {
|
|
134
119
|
readonly code: "Bad Request";
|
|
135
120
|
readonly message: "Cookies are missing";
|
|
@@ -139,55 +124,25 @@ export declare const createAuthContext: <UserType>({ agentAuth, authSessionStore
|
|
|
139
124
|
} | {
|
|
140
125
|
readonly code: "Unauthorized";
|
|
141
126
|
readonly message: "User is not authenticated";
|
|
142
|
-
}) => AuthFailReturn_3) | undefined) => Promise<import("elysia").
|
|
127
|
+
}) => AuthFailReturn_3) | undefined) => Promise<import("elysia").ElysiaStatus<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaStatus<"Unauthorized", "User is not authenticated", 401> | import("elysia").ElysiaStatus<"Forbidden", "Insufficient permissions", 403> | AuthReturn | NonNullable<AuthFailReturn_3>>;
|
|
143
128
|
}>;
|
|
144
129
|
})) & {
|
|
145
130
|
schema: {};
|
|
146
|
-
|
|
131
|
+
schemas: {};
|
|
147
132
|
macro: {};
|
|
148
133
|
macroFn: {};
|
|
149
134
|
parser: {};
|
|
150
|
-
response: import("elysia").ExtractErrorFromHandle<{
|
|
135
|
+
response: import("elysia/types").ExtractErrorFromHandle<{
|
|
151
136
|
readonly protectAgent: <AuthReturn, AuthFailReturn_2>(requiredScopes: string[], handleAuth: (principal: import(".").AgentPrincipal) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: {
|
|
152
137
|
code: "Forbidden" | "Unauthorized";
|
|
153
138
|
message: "Agent is not authenticated" | "Insufficient agent scopes";
|
|
154
139
|
}) => AuthFailReturn_2 | Promise<AuthFailReturn_2>) => Promise<Response | AuthReturn | NonNullable<Awaited<AuthFailReturn_2>>>;
|
|
155
140
|
}>;
|
|
156
|
-
}, {}, {
|
|
157
|
-
derive: {};
|
|
158
|
-
resolve: {};
|
|
159
|
-
schema: {};
|
|
160
|
-
standaloneSchema: {};
|
|
161
|
-
response: {};
|
|
162
|
-
}, ({
|
|
163
|
-
derive: {};
|
|
164
|
-
resolve: {};
|
|
165
|
-
schema: {};
|
|
166
|
-
standaloneSchema: {};
|
|
167
|
-
response: {};
|
|
168
|
-
} & {
|
|
169
|
-
derive: {};
|
|
170
|
-
resolve: {};
|
|
171
|
-
schema: {};
|
|
172
|
-
standaloneSchema: {};
|
|
173
|
-
response: {};
|
|
174
|
-
}) | ({
|
|
175
|
-
derive: {};
|
|
176
|
-
resolve: {};
|
|
177
|
-
schema: {};
|
|
178
|
-
standaloneSchema: {};
|
|
179
|
-
response: {};
|
|
180
|
-
} & {
|
|
181
|
-
derive: {};
|
|
182
|
-
resolve: {};
|
|
183
|
-
schema: {};
|
|
184
|
-
standaloneSchema: {};
|
|
185
|
-
response: {};
|
|
186
|
-
} & {
|
|
141
|
+
}, {}, import("elysia/types").DefaultEphemeral, {
|
|
187
142
|
derive: {};
|
|
188
|
-
resolve: {};
|
|
189
143
|
schema: {};
|
|
190
|
-
|
|
144
|
+
schemas: {};
|
|
191
145
|
response: {};
|
|
192
|
-
|
|
146
|
+
error: [];
|
|
147
|
+
}>;
|
|
193
148
|
export type AuthInstance<UserType> = ReturnType<typeof createAuthContext<UserType>>;
|