@absolutejs/auth 0.55.0 → 0.55.2
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 +7 -0
- package/dist/agents/context.d.ts +46 -0
- package/dist/agents/index.d.ts +2 -1
- package/dist/agents/index.js +47 -37
- package/dist/agents/index.js.map +5 -4
- package/dist/agents/routes.d.ts +29 -22
- package/dist/apikeys/routes.d.ts +2 -2
- package/dist/authInstance.d.ts +12 -0
- package/dist/authorization/protectPermission.d.ts +2 -2
- package/dist/credentials/login.d.ts +4 -4
- package/dist/credentials/routes.d.ts +4 -4
- package/dist/index.d.ts +3 -303
- package/dist/index.js +196 -182
- package/dist/index.js.map +7 -6
- package/dist/mfa/routes.d.ts +2 -2
- package/dist/mfa/sms.d.ts +2 -2
- package/dist/oidc/routes.d.ts +13 -13
- package/dist/organizations/routes.d.ts +1 -1
- package/dist/portal/routes.d.ts +3 -3
- package/dist/roles/routes.d.ts +1 -1
- package/dist/routes/protectRoute.d.ts +2 -2
- package/dist/routes/refresh.d.ts +1 -1
- package/dist/routes/revoke.d.ts +1 -1
- package/dist/routes/sessions.d.ts +3 -3
- package/dist/server.d.ts +18 -0
- package/dist/server.js +29365 -0
- package/dist/server.js.map +288 -0
- package/dist/sso/discoveryRoute.d.ts +1 -1
- package/dist/sso/oidcRoutes.d.ts +2 -2
- package/dist/sso/samlRoutes.d.ts +4 -4
- package/dist/utils.d.ts +1 -1
- package/package.json +9 -4
package/dist/mfa/routes.d.ts
CHANGED
|
@@ -138,10 +138,10 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
138
138
|
response: {
|
|
139
139
|
400: "Phone must be in E.164 format";
|
|
140
140
|
401: "Authentication required";
|
|
141
|
+
501: "SMS MFA is not configured";
|
|
141
142
|
200: {
|
|
142
143
|
readonly phone: string;
|
|
143
144
|
};
|
|
144
|
-
501: "SMS MFA is not configured";
|
|
145
145
|
422: {
|
|
146
146
|
type: "validation";
|
|
147
147
|
on: string;
|
|
@@ -169,7 +169,6 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
169
169
|
200: {
|
|
170
170
|
readonly status: "enrolled";
|
|
171
171
|
};
|
|
172
|
-
429: "Too many attempts";
|
|
173
172
|
422: {
|
|
174
173
|
type: "validation";
|
|
175
174
|
on: string;
|
|
@@ -179,6 +178,7 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
179
178
|
property?: string;
|
|
180
179
|
expected?: string;
|
|
181
180
|
};
|
|
181
|
+
429: "Too many attempts";
|
|
182
182
|
};
|
|
183
183
|
};
|
|
184
184
|
};
|
package/dist/mfa/sms.d.ts
CHANGED
|
@@ -40,10 +40,10 @@ export declare const mfaSmsRoutes: <UserType>({ authSessionStore, getUserId, mfa
|
|
|
40
40
|
response: {
|
|
41
41
|
400: "Phone must be in E.164 format";
|
|
42
42
|
401: "Authentication required";
|
|
43
|
+
501: "SMS MFA is not configured";
|
|
43
44
|
200: {
|
|
44
45
|
readonly phone: string;
|
|
45
46
|
};
|
|
46
|
-
501: "SMS MFA is not configured";
|
|
47
47
|
422: {
|
|
48
48
|
type: "validation";
|
|
49
49
|
on: string;
|
|
@@ -71,7 +71,6 @@ export declare const mfaSmsRoutes: <UserType>({ authSessionStore, getUserId, mfa
|
|
|
71
71
|
200: {
|
|
72
72
|
readonly status: "enrolled";
|
|
73
73
|
};
|
|
74
|
-
429: "Too many attempts";
|
|
75
74
|
422: {
|
|
76
75
|
type: "validation";
|
|
77
76
|
on: string;
|
|
@@ -81,6 +80,7 @@ export declare const mfaSmsRoutes: <UserType>({ authSessionStore, getUserId, mfa
|
|
|
81
80
|
property?: string;
|
|
82
81
|
expected?: string;
|
|
83
82
|
};
|
|
83
|
+
429: "Too many attempts";
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
};
|
package/dist/oidc/routes.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
27
27
|
body: unknown;
|
|
28
28
|
params: {};
|
|
29
29
|
query: {
|
|
30
|
-
scope?: string | undefined;
|
|
31
30
|
client_id?: string | undefined;
|
|
31
|
+
scope?: string | undefined;
|
|
32
32
|
nonce?: string | undefined;
|
|
33
33
|
claims?: string | undefined;
|
|
34
34
|
request?: string | undefined;
|
|
@@ -63,18 +63,18 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
63
63
|
[x: string]: {
|
|
64
64
|
post: {
|
|
65
65
|
body: {
|
|
66
|
-
grant_type?: string | undefined;
|
|
67
|
-
claim_token?: string | undefined;
|
|
68
|
-
scope?: string | undefined;
|
|
69
|
-
assertion?: string | undefined;
|
|
70
|
-
resource?: string | undefined;
|
|
71
66
|
client_id?: string | undefined;
|
|
67
|
+
scope?: string | undefined;
|
|
72
68
|
audience?: string | undefined;
|
|
69
|
+
resource?: string | undefined;
|
|
73
70
|
refresh_token?: string | undefined;
|
|
74
71
|
device_code?: string | undefined;
|
|
75
72
|
auth_req_id?: string | undefined;
|
|
76
|
-
|
|
73
|
+
grant_type?: string | undefined;
|
|
74
|
+
claim_token?: string | undefined;
|
|
75
|
+
assertion?: string | undefined;
|
|
77
76
|
code?: string | undefined;
|
|
77
|
+
client_secret?: string | undefined;
|
|
78
78
|
redirect_uri?: string | undefined;
|
|
79
79
|
client_assertion?: string | undefined;
|
|
80
80
|
client_assertion_type?: string | undefined;
|
|
@@ -104,12 +104,12 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
104
104
|
[x: string]: {
|
|
105
105
|
post: {
|
|
106
106
|
body: {
|
|
107
|
-
scope?: string | undefined;
|
|
108
|
-
resource?: string | undefined;
|
|
109
107
|
client_id?: string | undefined;
|
|
108
|
+
scope?: string | undefined;
|
|
110
109
|
nonce?: string | undefined;
|
|
111
110
|
audience?: string | undefined;
|
|
112
111
|
claims?: string | undefined;
|
|
112
|
+
resource?: string | undefined;
|
|
113
113
|
client_secret?: string | undefined;
|
|
114
114
|
redirect_uri?: string | undefined;
|
|
115
115
|
acr_values?: string | undefined;
|
|
@@ -199,8 +199,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
199
199
|
[x: string]: {
|
|
200
200
|
post: {
|
|
201
201
|
body: {
|
|
202
|
-
scope?: string | undefined;
|
|
203
202
|
client_id?: string | undefined;
|
|
203
|
+
scope?: string | undefined;
|
|
204
204
|
client_secret?: string | undefined;
|
|
205
205
|
login_hint?: string | undefined;
|
|
206
206
|
binding_message?: string | undefined;
|
|
@@ -228,8 +228,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
228
228
|
[x: string]: {
|
|
229
229
|
post: {
|
|
230
230
|
body: {
|
|
231
|
-
scope?: string | undefined;
|
|
232
231
|
client_id?: string | undefined;
|
|
232
|
+
scope?: string | undefined;
|
|
233
233
|
client_secret?: string | undefined;
|
|
234
234
|
};
|
|
235
235
|
params: {};
|
|
@@ -331,8 +331,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
331
331
|
[x: string]: {
|
|
332
332
|
post: {
|
|
333
333
|
body: {
|
|
334
|
-
scope?: string | undefined;
|
|
335
334
|
jwks?: any;
|
|
335
|
+
scope?: string | undefined;
|
|
336
336
|
backchannel_logout_uri?: string | undefined;
|
|
337
337
|
client_name?: string | undefined;
|
|
338
338
|
grant_types?: string[] | undefined;
|
|
@@ -391,8 +391,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
391
391
|
":clientId": {
|
|
392
392
|
put: {
|
|
393
393
|
body: {
|
|
394
|
-
scope?: string | undefined;
|
|
395
394
|
jwks?: any;
|
|
395
|
+
scope?: string | undefined;
|
|
396
396
|
backchannel_logout_uri?: string | undefined;
|
|
397
397
|
client_name?: string | undefined;
|
|
398
398
|
grant_types?: string[] | undefined;
|
|
@@ -162,10 +162,10 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
162
162
|
response: {
|
|
163
163
|
401: "Authentication required";
|
|
164
164
|
403: "Cannot manage members";
|
|
165
|
+
404: "Invitation not found";
|
|
165
166
|
200: {
|
|
166
167
|
readonly revoked: string;
|
|
167
168
|
};
|
|
168
|
-
404: "Invitation not found";
|
|
169
169
|
422: {
|
|
170
170
|
type: "validation";
|
|
171
171
|
on: string;
|
package/dist/portal/routes.d.ts
CHANGED
|
@@ -66,11 +66,11 @@ export declare const portalRoutes: ({ emit, onScimTokenCreated, onSsoConnectionC
|
|
|
66
66
|
response: {
|
|
67
67
|
401: "Invalid or expired setup link";
|
|
68
68
|
403: "This setup link cannot configure SAML";
|
|
69
|
+
501: "SSO is not configured";
|
|
69
70
|
200: {
|
|
70
71
|
readonly configured: true;
|
|
71
72
|
readonly type: "saml";
|
|
72
73
|
};
|
|
73
|
-
501: "SSO is not configured";
|
|
74
74
|
422: {
|
|
75
75
|
type: "validation";
|
|
76
76
|
on: string;
|
|
@@ -103,11 +103,11 @@ export declare const portalRoutes: ({ emit, onScimTokenCreated, onSsoConnectionC
|
|
|
103
103
|
response: {
|
|
104
104
|
401: "Invalid or expired setup link";
|
|
105
105
|
403: "This setup link cannot configure OIDC";
|
|
106
|
+
501: "SSO is not configured";
|
|
106
107
|
200: {
|
|
107
108
|
readonly configured: true;
|
|
108
109
|
readonly type: "oidc";
|
|
109
110
|
};
|
|
110
|
-
501: "SSO is not configured";
|
|
111
111
|
422: {
|
|
112
112
|
type: "validation";
|
|
113
113
|
on: string;
|
|
@@ -134,12 +134,12 @@ export declare const portalRoutes: ({ emit, onScimTokenCreated, onSsoConnectionC
|
|
|
134
134
|
response: {
|
|
135
135
|
401: "Invalid or expired setup link";
|
|
136
136
|
403: "This setup link cannot configure SCIM";
|
|
137
|
+
501: "SCIM is not configured";
|
|
137
138
|
200: {
|
|
138
139
|
readonly baseUrl: `${string}/${string}`;
|
|
139
140
|
readonly token: string;
|
|
140
141
|
readonly tokenId: string;
|
|
141
142
|
};
|
|
142
|
-
501: "SCIM is not configured";
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
145
|
};
|
package/dist/roles/routes.d.ts
CHANGED
|
@@ -66,10 +66,10 @@ export declare const roleRoutes: <UserType>({ authSessionStore, canManageRoles,
|
|
|
66
66
|
response: {
|
|
67
67
|
401: "Authentication required";
|
|
68
68
|
403: "Cannot manage roles";
|
|
69
|
+
404: "Membership not found";
|
|
69
70
|
200: {
|
|
70
71
|
readonly roles: string[];
|
|
71
72
|
};
|
|
72
|
-
404: "Membership not found";
|
|
73
73
|
422: {
|
|
74
74
|
type: "validation";
|
|
75
75
|
on: string;
|
|
@@ -16,7 +16,7 @@ export declare const protectRoutePlugin: <UserType>({ authSessionStore }?: {
|
|
|
16
16
|
unregisteredSession: import("..").UnregisteredSessionRecord;
|
|
17
17
|
};
|
|
18
18
|
derive: {
|
|
19
|
-
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401
|
|
19
|
+
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<AuthReturn | import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | NonNullable<AuthFailReturn> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401>>;
|
|
20
20
|
};
|
|
21
21
|
resolve: {};
|
|
22
22
|
}, {
|
|
@@ -33,7 +33,7 @@ export declare const protectRoutePlugin: <UserType>({ authSessionStore }?: {
|
|
|
33
33
|
macroFn: {};
|
|
34
34
|
parser: {};
|
|
35
35
|
response: import("elysia").ExtractErrorFromHandle<{
|
|
36
|
-
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401
|
|
36
|
+
readonly protectRoute: <AuthReturn, AuthFailReturn>(handleAuth: (user: UserType) => AuthReturn | Promise<AuthReturn>, handleAuthFail?: (error: AuthFailError) => AuthFailReturn) => Promise<AuthReturn | import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | NonNullable<AuthFailReturn> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401>>;
|
|
37
37
|
}>;
|
|
38
38
|
}, {}, {
|
|
39
39
|
derive: {};
|
package/dist/routes/refresh.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export declare const refresh: <UserType>({ authSessionStore, clientProviders, re
|
|
|
37
37
|
response: {
|
|
38
38
|
400: "Cookies are missing" | "Invalid provider" | "No refresh token found";
|
|
39
39
|
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
|
|
40
|
-
200: Response;
|
|
41
40
|
501: "Provider is not refreshable";
|
|
41
|
+
200: Response;
|
|
42
42
|
422: {
|
|
43
43
|
type: "validation";
|
|
44
44
|
on: string;
|
package/dist/routes/revoke.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ export declare const revoke: <UserType>({ authSessionStore, clientProviders, rev
|
|
|
36
36
|
response: {
|
|
37
37
|
400: "Cookies are missing" | "Invalid provider" | "Session has no access token to revoke";
|
|
38
38
|
401: "Provider is required" | "Client provider not found" | "Client variant is required" | "Client variant not found" | "No auth provider found" | "No user session found";
|
|
39
|
-
200: Response;
|
|
40
39
|
501: "Provider does not support revocation";
|
|
40
|
+
200: Response;
|
|
41
41
|
422: {
|
|
42
42
|
type: "validation";
|
|
43
43
|
on: string;
|
|
@@ -34,10 +34,10 @@ export declare const sessionRoutes: <UserType>({ authSessionStore, getUserId, se
|
|
|
34
34
|
headers: unknown;
|
|
35
35
|
response: {
|
|
36
36
|
401: "Authentication required";
|
|
37
|
+
501: "Session management requires an authSessionStore";
|
|
37
38
|
200: {
|
|
38
39
|
readonly sessions: SessionSummary[];
|
|
39
40
|
};
|
|
40
|
-
501: "Session management requires an authSessionStore";
|
|
41
41
|
422: {
|
|
42
42
|
type: "validation";
|
|
43
43
|
on: string;
|
|
@@ -63,11 +63,11 @@ export declare const sessionRoutes: <UserType>({ authSessionStore, getUserId, se
|
|
|
63
63
|
response: {
|
|
64
64
|
400: "Invalid session id";
|
|
65
65
|
401: "Authentication required";
|
|
66
|
+
501: "Session management requires an authSessionStore";
|
|
67
|
+
404: "Session not found";
|
|
66
68
|
200: {
|
|
67
69
|
readonly revoked: `${string}-${string}-${string}-${string}-${string}`;
|
|
68
70
|
};
|
|
69
|
-
501: "Session management requires an authSessionStore";
|
|
70
|
-
404: "Session not found";
|
|
71
71
|
422: {
|
|
72
72
|
type: "validation";
|
|
73
73
|
on: string;
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AuthInstance } from './authInstance';
|
|
2
|
+
import type { AuthConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Create the complete AbsoluteJS auth application through a declaration-stable
|
|
5
|
+
* server entry point. Import this subpath in server applications so TypeScript
|
|
6
|
+
* does not need to load declarations for every optional Auth feature.
|
|
7
|
+
*/
|
|
8
|
+
export declare const auth: <UserType>(config: AuthConfig<UserType>) => Promise<AuthInstance<UserType>>;
|
|
9
|
+
export type { AuthInstance } from './authInstance';
|
|
10
|
+
export type { AuditSink } from './audit/types';
|
|
11
|
+
export { protectRoutePlugin } from './routes/protectRoute';
|
|
12
|
+
export type { AuthSessionStore } from './session/types';
|
|
13
|
+
export { isUserSessionId } from './typeGuards';
|
|
14
|
+
export { userSessionIdTypebox } from './typebox';
|
|
15
|
+
export type { AuthConfig, OAuth2ConfigurationOptions, SessionData, UnregisteredSessionData, UserSessionId } from './types';
|
|
16
|
+
export { instantiateUserSession } from './utils';
|
|
17
|
+
export type { OAuth2TokenResponse, ProviderOption } from 'citra';
|
|
18
|
+
export { extractPropFromIdentity, isValidProviderOption, providers } from 'citra';
|