@absolutejs/auth 0.29.0-beta.2 → 0.29.0-beta.3
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/compliance/routes.d.ts +2 -2
- package/dist/credentials/emailVerification.d.ts +1 -1
- package/dist/credentials/login.d.ts +4 -4
- package/dist/credentials/passwordReset.d.ts +3 -3
- package/dist/credentials/routes.d.ts +8 -8
- package/dist/htmx/routes.d.ts +12 -12
- package/dist/index.d.ts +208 -87
- package/dist/index.js +416 -3
- package/dist/index.js.map +9 -8
- package/dist/mfa/challenge.d.ts +1 -1
- package/dist/mfa/routes.d.ts +4 -4
- package/dist/mfa/totp.d.ts +3 -3
- package/dist/oidc/config.d.ts +5 -1
- package/dist/oidc/inMemoryStores.d.ts +3 -1
- package/dist/oidc/postgresStores.d.ts +93 -1
- package/dist/oidc/registration.d.ts +131 -0
- package/dist/oidc/routes.d.ts +120 -0
- package/dist/oidc/types.d.ts +16 -0
- package/dist/organizations/routes.d.ts +16 -16
- package/dist/passwordless/routes.d.ts +4 -4
- package/dist/portal/routes.d.ts +10 -10
- package/dist/providers/clients.d.ts +2 -2
- package/dist/roles/routes.d.ts +5 -5
- package/dist/routes/authorize.d.ts +2 -2
- package/dist/routes/profile.d.ts +1 -1
- package/dist/routes/refresh.d.ts +2 -2
- package/dist/routes/revoke.d.ts +2 -2
- package/dist/routes/sessions.d.ts +6 -6
- package/dist/routes/signout.d.ts +1 -1
- package/dist/routes/userStatus.d.ts +1 -1
- package/dist/sso/discoveryRoute.d.ts +1 -1
- package/dist/sso/oidcRoutes.d.ts +2 -2
- package/dist/sso/samlRoutes.d.ts +5 -5
- package/dist/webauthn/routes.d.ts +5 -5
- package/package.json +1 -1
package/dist/mfa/challenge.d.ts
CHANGED
|
@@ -28,10 +28,10 @@ export declare const mfaChallenge: <UserType>({ authSessionStore, challengeRoute
|
|
|
28
28
|
query: unknown;
|
|
29
29
|
headers: unknown;
|
|
30
30
|
response: {
|
|
31
|
+
401: "No MFA challenge in progress" | "Invalid MFA code";
|
|
31
32
|
200: {
|
|
32
33
|
readonly status: "authenticated";
|
|
33
34
|
};
|
|
34
|
-
401: "No MFA challenge in progress" | "Invalid MFA code";
|
|
35
35
|
422: {
|
|
36
36
|
type: "validation";
|
|
37
37
|
on: string;
|
package/dist/mfa/routes.d.ts
CHANGED
|
@@ -26,11 +26,11 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
26
26
|
query: unknown;
|
|
27
27
|
headers: unknown;
|
|
28
28
|
response: {
|
|
29
|
+
401: "Authentication required";
|
|
29
30
|
200: {
|
|
30
31
|
readonly secret: string;
|
|
31
32
|
readonly uri: string;
|
|
32
33
|
};
|
|
33
|
-
401: "Authentication required";
|
|
34
34
|
422: {
|
|
35
35
|
type: "validation";
|
|
36
36
|
on: string;
|
|
@@ -53,11 +53,11 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
53
53
|
query: unknown;
|
|
54
54
|
headers: unknown;
|
|
55
55
|
response: {
|
|
56
|
+
400: "No TOTP enrollment in progress" | "Invalid TOTP code";
|
|
57
|
+
401: "Authentication required";
|
|
56
58
|
200: {
|
|
57
59
|
readonly backupCodes: string[];
|
|
58
60
|
};
|
|
59
|
-
400: "No TOTP enrollment in progress" | "Invalid TOTP code";
|
|
60
|
-
401: "Authentication required";
|
|
61
61
|
422: {
|
|
62
62
|
type: "validation";
|
|
63
63
|
on: string;
|
|
@@ -80,10 +80,10 @@ export declare const mfaRoutes: <UserType>(config: MfaRouteProps<UserType>) => E
|
|
|
80
80
|
query: unknown;
|
|
81
81
|
headers: unknown;
|
|
82
82
|
response: {
|
|
83
|
+
401: "No MFA challenge in progress" | "Invalid MFA code";
|
|
83
84
|
200: {
|
|
84
85
|
readonly status: "authenticated";
|
|
85
86
|
};
|
|
86
|
-
401: "No MFA challenge in progress" | "Invalid MFA code";
|
|
87
87
|
422: {
|
|
88
88
|
type: "validation";
|
|
89
89
|
on: string;
|
package/dist/mfa/totp.d.ts
CHANGED
|
@@ -26,11 +26,11 @@ export declare const mfaTotpRoutes: <UserType>({ authSessionStore, backupCodeCou
|
|
|
26
26
|
query: unknown;
|
|
27
27
|
headers: unknown;
|
|
28
28
|
response: {
|
|
29
|
+
401: "Authentication required";
|
|
29
30
|
200: {
|
|
30
31
|
readonly secret: string;
|
|
31
32
|
readonly uri: string;
|
|
32
33
|
};
|
|
33
|
-
401: "Authentication required";
|
|
34
34
|
422: {
|
|
35
35
|
type: "validation";
|
|
36
36
|
on: string;
|
|
@@ -53,11 +53,11 @@ export declare const mfaTotpRoutes: <UserType>({ authSessionStore, backupCodeCou
|
|
|
53
53
|
query: unknown;
|
|
54
54
|
headers: unknown;
|
|
55
55
|
response: {
|
|
56
|
+
400: "No TOTP enrollment in progress" | "Invalid TOTP code";
|
|
57
|
+
401: "Authentication required";
|
|
56
58
|
200: {
|
|
57
59
|
readonly backupCodes: string[];
|
|
58
60
|
};
|
|
59
|
-
400: "No TOTP enrollment in progress" | "Invalid TOTP code";
|
|
60
|
-
401: "Authentication required";
|
|
61
61
|
422: {
|
|
62
62
|
type: "validation";
|
|
63
63
|
on: string;
|
package/dist/oidc/config.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { RouteString } from '../types';
|
|
2
2
|
import { type SigningKey } from './keys';
|
|
3
|
-
import type {
|
|
3
|
+
import type { OnClientRegistration } from './registration';
|
|
4
|
+
import type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
|
|
4
5
|
export declare const DEFAULT_OIDC_ROUTE: RouteString;
|
|
5
6
|
export type OidcProviderConfig<UserType> = {
|
|
6
7
|
accessTokenTtlMs?: number;
|
|
7
8
|
authorizationCodeStore: AuthorizationCodeStore;
|
|
8
9
|
clientAssertionJtiStore?: ClientAssertionJtiStore;
|
|
10
|
+
clientRegistrationTokenStore?: ClientRegistrationTokenStore;
|
|
9
11
|
clientStore: OAuthClientStore;
|
|
10
12
|
deviceAuthorizationStore?: DeviceAuthorizationStore;
|
|
11
13
|
deviceCodeTtlMs?: number;
|
|
@@ -28,9 +30,11 @@ export type OidcProviderConfig<UserType> = {
|
|
|
28
30
|
getUserId: (user: UserType) => string;
|
|
29
31
|
idTokenTtlMs?: number;
|
|
30
32
|
issuer: string;
|
|
33
|
+
initialAccessTokenStore?: InitialAccessTokenStore;
|
|
31
34
|
loginUrl?: string;
|
|
32
35
|
logoutDeliveryStore?: LogoutDeliveryStore;
|
|
33
36
|
oidcRoute?: RouteString;
|
|
37
|
+
onClientRegistration?: OnClientRegistration;
|
|
34
38
|
refreshTokenStore: OidcRefreshTokenStore;
|
|
35
39
|
refreshTokenTtlMs?: number;
|
|
36
40
|
signingKey: SigningKey;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { AuthorizationCodeStore, ClientAssertionJtiStore, DeviceAuthorizationStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore } from './types';
|
|
1
|
+
import type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore } from './types';
|
|
2
2
|
export declare const createInMemoryAuthorizationCodeStore: () => AuthorizationCodeStore;
|
|
3
3
|
export declare const createInMemoryClientAssertionJtiStore: () => ClientAssertionJtiStore;
|
|
4
4
|
export declare const createInMemoryDeviceAuthorizationStore: () => DeviceAuthorizationStore;
|
|
5
5
|
export declare const createInMemoryLogoutDeliveryStore: () => LogoutDeliveryStore;
|
|
6
|
+
export declare const createInMemoryClientRegistrationTokenStore: () => ClientRegistrationTokenStore;
|
|
7
|
+
export declare const createInMemoryInitialAccessTokenStore: (initialHashes?: string[]) => InitialAccessTokenStore;
|
|
6
8
|
export declare const createInMemoryOAuthClientStore: (clients: OAuthClient[]) => OAuthClientStore;
|
|
7
9
|
export declare const createInMemoryOidcRefreshTokenStore: () => OidcRefreshTokenStore;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AnyPgDatabase } from '../stores/postgres';
|
|
2
|
-
import type { AuthorizationCodeStore, ClientAssertionJtiStore, DeviceAuthorizationStore, LogoutDeliveryStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
|
|
2
|
+
import type { AuthorizationCodeStore, ClientAssertionJtiStore, ClientRegistrationTokenStore, DeviceAuthorizationStore, InitialAccessTokenStore, LogoutDeliveryStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
|
|
3
3
|
export declare const oauthClientAssertionJtisTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
4
4
|
name: "auth_oauth_client_assertion_jtis";
|
|
5
5
|
schema: undefined;
|
|
@@ -81,6 +81,68 @@ export declare const oauthClientAssertionJtisTable: import("drizzle-orm/pg-core"
|
|
|
81
81
|
};
|
|
82
82
|
dialect: "pg";
|
|
83
83
|
}>;
|
|
84
|
+
export declare const oauthClientRegistrationTokensTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
85
|
+
name: "auth_oauth_client_registration_tokens";
|
|
86
|
+
schema: undefined;
|
|
87
|
+
columns: {
|
|
88
|
+
client_id: import("drizzle-orm/pg-core").PgColumn<{
|
|
89
|
+
name: "client_id";
|
|
90
|
+
tableName: "auth_oauth_client_registration_tokens";
|
|
91
|
+
dataType: "string";
|
|
92
|
+
columnType: "PgVarchar";
|
|
93
|
+
data: string;
|
|
94
|
+
driverParam: string;
|
|
95
|
+
notNull: true;
|
|
96
|
+
hasDefault: false;
|
|
97
|
+
isPrimaryKey: false;
|
|
98
|
+
isAutoincrement: false;
|
|
99
|
+
hasRuntimeDefault: false;
|
|
100
|
+
enumValues: [string, ...string[]];
|
|
101
|
+
baseColumn: never;
|
|
102
|
+
identity: undefined;
|
|
103
|
+
generated: undefined;
|
|
104
|
+
}, {}, {
|
|
105
|
+
length: 255;
|
|
106
|
+
}>;
|
|
107
|
+
created_at_ms: import("drizzle-orm/pg-core").PgColumn<{
|
|
108
|
+
name: "created_at_ms";
|
|
109
|
+
tableName: "auth_oauth_client_registration_tokens";
|
|
110
|
+
dataType: "number";
|
|
111
|
+
columnType: "PgBigInt53";
|
|
112
|
+
data: number;
|
|
113
|
+
driverParam: string | number;
|
|
114
|
+
notNull: true;
|
|
115
|
+
hasDefault: false;
|
|
116
|
+
isPrimaryKey: false;
|
|
117
|
+
isAutoincrement: false;
|
|
118
|
+
hasRuntimeDefault: false;
|
|
119
|
+
enumValues: undefined;
|
|
120
|
+
baseColumn: never;
|
|
121
|
+
identity: undefined;
|
|
122
|
+
generated: undefined;
|
|
123
|
+
}, {}, {}>;
|
|
124
|
+
token_hash: import("drizzle-orm/pg-core").PgColumn<{
|
|
125
|
+
name: "token_hash";
|
|
126
|
+
tableName: "auth_oauth_client_registration_tokens";
|
|
127
|
+
dataType: "string";
|
|
128
|
+
columnType: "PgVarchar";
|
|
129
|
+
data: string;
|
|
130
|
+
driverParam: string;
|
|
131
|
+
notNull: true;
|
|
132
|
+
hasDefault: false;
|
|
133
|
+
isPrimaryKey: true;
|
|
134
|
+
isAutoincrement: false;
|
|
135
|
+
hasRuntimeDefault: false;
|
|
136
|
+
enumValues: [string, ...string[]];
|
|
137
|
+
baseColumn: never;
|
|
138
|
+
identity: undefined;
|
|
139
|
+
generated: undefined;
|
|
140
|
+
}, {}, {
|
|
141
|
+
length: 255;
|
|
142
|
+
}>;
|
|
143
|
+
};
|
|
144
|
+
dialect: "pg";
|
|
145
|
+
}>;
|
|
84
146
|
export declare const oauthClientsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
85
147
|
name: "auth_oauth_clients";
|
|
86
148
|
schema: undefined;
|
|
@@ -763,6 +825,32 @@ export declare const oauthDeviceAuthorizationsTable: import("drizzle-orm/pg-core
|
|
|
763
825
|
};
|
|
764
826
|
dialect: "pg";
|
|
765
827
|
}>;
|
|
828
|
+
export declare const oauthInitialAccessTokensTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
829
|
+
name: "auth_oauth_initial_access_tokens";
|
|
830
|
+
schema: undefined;
|
|
831
|
+
columns: {
|
|
832
|
+
token_hash: import("drizzle-orm/pg-core").PgColumn<{
|
|
833
|
+
name: "token_hash";
|
|
834
|
+
tableName: "auth_oauth_initial_access_tokens";
|
|
835
|
+
dataType: "string";
|
|
836
|
+
columnType: "PgVarchar";
|
|
837
|
+
data: string;
|
|
838
|
+
driverParam: string;
|
|
839
|
+
notNull: true;
|
|
840
|
+
hasDefault: false;
|
|
841
|
+
isPrimaryKey: true;
|
|
842
|
+
isAutoincrement: false;
|
|
843
|
+
hasRuntimeDefault: false;
|
|
844
|
+
enumValues: [string, ...string[]];
|
|
845
|
+
baseColumn: never;
|
|
846
|
+
identity: undefined;
|
|
847
|
+
generated: undefined;
|
|
848
|
+
}, {}, {
|
|
849
|
+
length: 255;
|
|
850
|
+
}>;
|
|
851
|
+
};
|
|
852
|
+
dialect: "pg";
|
|
853
|
+
}>;
|
|
766
854
|
export declare const oauthLogoutDeliveriesTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
767
855
|
name: "auth_oauth_logout_deliveries";
|
|
768
856
|
schema: undefined;
|
|
@@ -1112,13 +1200,17 @@ export declare const oauthRefreshTokensTable: import("drizzle-orm/pg-core").PgTa
|
|
|
1112
1200
|
}>;
|
|
1113
1201
|
export declare const createNeonAuthorizationCodeStore: (databaseUrl: string) => AuthorizationCodeStore;
|
|
1114
1202
|
export declare const createNeonClientAssertionJtiStore: (databaseUrl: string) => ClientAssertionJtiStore;
|
|
1203
|
+
export declare const createNeonClientRegistrationTokenStore: (databaseUrl: string) => ClientRegistrationTokenStore;
|
|
1115
1204
|
export declare const createNeonDeviceAuthorizationStore: (databaseUrl: string) => DeviceAuthorizationStore;
|
|
1205
|
+
export declare const createNeonInitialAccessTokenStore: (databaseUrl: string) => InitialAccessTokenStore;
|
|
1116
1206
|
export declare const createNeonLogoutDeliveryStore: (databaseUrl: string) => LogoutDeliveryStore;
|
|
1117
1207
|
export declare const createNeonOAuthClientStore: (databaseUrl: string) => OAuthClientStore;
|
|
1118
1208
|
export declare const createNeonOidcRefreshTokenStore: (databaseUrl: string) => OidcRefreshTokenStore;
|
|
1119
1209
|
export declare const createPostgresAuthorizationCodeStore: (db: AnyPgDatabase) => AuthorizationCodeStore;
|
|
1120
1210
|
export declare const createPostgresClientAssertionJtiStore: (db: AnyPgDatabase) => ClientAssertionJtiStore;
|
|
1211
|
+
export declare const createPostgresClientRegistrationTokenStore: (db: AnyPgDatabase) => ClientRegistrationTokenStore;
|
|
1121
1212
|
export declare const createPostgresDeviceAuthorizationStore: (db: AnyPgDatabase) => DeviceAuthorizationStore;
|
|
1213
|
+
export declare const createPostgresInitialAccessTokenStore: (db: AnyPgDatabase) => InitialAccessTokenStore;
|
|
1122
1214
|
export declare const createPostgresLogoutDeliveryStore: (db: AnyPgDatabase) => LogoutDeliveryStore;
|
|
1123
1215
|
export declare const createPostgresOAuthClientStore: (db: AnyPgDatabase) => OAuthClientStore;
|
|
1124
1216
|
export declare const createPostgresOidcRefreshTokenStore: (db: AnyPgDatabase) => OidcRefreshTokenStore;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { ClientRegistrationTokenStore, InitialAccessTokenStore, OAuthClient, OAuthClientStore } from './types';
|
|
2
|
+
export type ClientRegistrationMetadata = {
|
|
3
|
+
backchannel_logout_uri?: string;
|
|
4
|
+
client_name?: string;
|
|
5
|
+
jwks?: JsonWebKey[];
|
|
6
|
+
jwks_uri?: string;
|
|
7
|
+
post_logout_redirect_uris?: string[];
|
|
8
|
+
redirect_uris?: string[];
|
|
9
|
+
scope?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ClientRegistrationDecision = {
|
|
12
|
+
allow: false;
|
|
13
|
+
denyReason: string;
|
|
14
|
+
} | {
|
|
15
|
+
allow: true;
|
|
16
|
+
transform?: Partial<OAuthClient>;
|
|
17
|
+
};
|
|
18
|
+
export type OnClientRegistration = (context: {
|
|
19
|
+
metadata: ClientRegistrationMetadata;
|
|
20
|
+
}) => ClientRegistrationDecision | Promise<ClientRegistrationDecision>;
|
|
21
|
+
export type RegisterClientResult = {
|
|
22
|
+
body: {
|
|
23
|
+
error: string;
|
|
24
|
+
error_description?: string;
|
|
25
|
+
};
|
|
26
|
+
ok: false;
|
|
27
|
+
status: 400 | 401 | 403 | 501;
|
|
28
|
+
} | {
|
|
29
|
+
body: ClientRegistrationMetadata & {
|
|
30
|
+
client_id: string;
|
|
31
|
+
registration_access_token: string;
|
|
32
|
+
registration_client_uri: string;
|
|
33
|
+
};
|
|
34
|
+
ok: true;
|
|
35
|
+
};
|
|
36
|
+
export declare const deleteRegisteredClient: ({ authorization, clientId, clientStore, registrationTokenStore }: {
|
|
37
|
+
authorization: string | undefined;
|
|
38
|
+
clientId: string;
|
|
39
|
+
clientStore: OAuthClientStore;
|
|
40
|
+
registrationTokenStore: ClientRegistrationTokenStore;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
readonly body: {
|
|
43
|
+
readonly error: "unsupported_response_type";
|
|
44
|
+
};
|
|
45
|
+
readonly status: 501;
|
|
46
|
+
} | {
|
|
47
|
+
readonly body: {
|
|
48
|
+
readonly error: "invalid_token";
|
|
49
|
+
};
|
|
50
|
+
readonly status: 401;
|
|
51
|
+
} | {
|
|
52
|
+
readonly status: 204;
|
|
53
|
+
readonly body?: undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const getRegisteredClient: ({ authorization, clientId, clientStore, registrationTokenStore }: {
|
|
56
|
+
authorization: string | undefined;
|
|
57
|
+
clientId: string;
|
|
58
|
+
clientStore: OAuthClientStore;
|
|
59
|
+
registrationTokenStore: ClientRegistrationTokenStore;
|
|
60
|
+
}) => Promise<{
|
|
61
|
+
readonly body: {
|
|
62
|
+
readonly error: "invalid_token";
|
|
63
|
+
};
|
|
64
|
+
readonly status: 401;
|
|
65
|
+
} | {
|
|
66
|
+
readonly body: {
|
|
67
|
+
readonly error: "invalid_client";
|
|
68
|
+
};
|
|
69
|
+
readonly status: 404;
|
|
70
|
+
} | {
|
|
71
|
+
readonly body: ClientRegistrationMetadata & {
|
|
72
|
+
client_id: string;
|
|
73
|
+
};
|
|
74
|
+
readonly status: 200;
|
|
75
|
+
}>;
|
|
76
|
+
export declare const registerClient: ({ clientStore, initialAccessTokenStore, metadata, onClientRegistration, presentedInitialAccessToken, registrationBaseUrl, registrationTokenStore }: {
|
|
77
|
+
clientStore: OAuthClientStore;
|
|
78
|
+
initialAccessTokenStore?: InitialAccessTokenStore;
|
|
79
|
+
metadata: ClientRegistrationMetadata;
|
|
80
|
+
onClientRegistration?: OnClientRegistration;
|
|
81
|
+
presentedInitialAccessToken?: string;
|
|
82
|
+
registrationBaseUrl: string;
|
|
83
|
+
registrationTokenStore: ClientRegistrationTokenStore;
|
|
84
|
+
}) => Promise<RegisterClientResult>;
|
|
85
|
+
export declare const updateRegisteredClient: ({ authorization, clientId, clientStore, metadata, onClientRegistration, registrationTokenStore }: {
|
|
86
|
+
authorization: string | undefined;
|
|
87
|
+
clientId: string;
|
|
88
|
+
clientStore: OAuthClientStore;
|
|
89
|
+
metadata: ClientRegistrationMetadata;
|
|
90
|
+
onClientRegistration?: OnClientRegistration;
|
|
91
|
+
registrationTokenStore: ClientRegistrationTokenStore;
|
|
92
|
+
}) => Promise<{
|
|
93
|
+
readonly body: {
|
|
94
|
+
readonly error: "unsupported_response_type";
|
|
95
|
+
readonly error_description?: undefined;
|
|
96
|
+
};
|
|
97
|
+
readonly status: 501;
|
|
98
|
+
} | {
|
|
99
|
+
readonly body: {
|
|
100
|
+
readonly error: "invalid_token";
|
|
101
|
+
readonly error_description?: undefined;
|
|
102
|
+
};
|
|
103
|
+
readonly status: 401;
|
|
104
|
+
} | {
|
|
105
|
+
readonly body: {
|
|
106
|
+
readonly error: "invalid_client_metadata";
|
|
107
|
+
readonly error_description: string;
|
|
108
|
+
};
|
|
109
|
+
readonly status: 403;
|
|
110
|
+
} | {
|
|
111
|
+
readonly body: {
|
|
112
|
+
readonly error: "invalid_redirect_uri";
|
|
113
|
+
readonly error_description?: undefined;
|
|
114
|
+
};
|
|
115
|
+
readonly status: 400;
|
|
116
|
+
} | {
|
|
117
|
+
readonly body: {
|
|
118
|
+
readonly registration_access_token: string;
|
|
119
|
+
readonly backchannel_logout_uri?: string;
|
|
120
|
+
readonly client_name?: string;
|
|
121
|
+
readonly jwks?: JsonWebKey[];
|
|
122
|
+
readonly jwks_uri?: string;
|
|
123
|
+
readonly post_logout_redirect_uris?: string[];
|
|
124
|
+
readonly redirect_uris?: string[];
|
|
125
|
+
readonly scope?: string;
|
|
126
|
+
readonly client_id: string;
|
|
127
|
+
readonly error?: undefined;
|
|
128
|
+
readonly error_description?: undefined;
|
|
129
|
+
};
|
|
130
|
+
readonly status: 200;
|
|
131
|
+
}>;
|
package/dist/oidc/routes.d.ts
CHANGED
|
@@ -247,6 +247,126 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
|
|
|
247
247
|
};
|
|
248
248
|
};
|
|
249
249
|
};
|
|
250
|
+
} & {
|
|
251
|
+
[x: string]: {
|
|
252
|
+
post: {
|
|
253
|
+
body: {
|
|
254
|
+
jwks?: any;
|
|
255
|
+
scope?: string | undefined;
|
|
256
|
+
backchannel_logout_uri?: string | undefined;
|
|
257
|
+
client_name?: string | undefined;
|
|
258
|
+
jwks_uri?: string | undefined;
|
|
259
|
+
post_logout_redirect_uris?: string[] | undefined;
|
|
260
|
+
redirect_uris?: string[] | undefined;
|
|
261
|
+
};
|
|
262
|
+
params: {};
|
|
263
|
+
query: unknown;
|
|
264
|
+
headers: {
|
|
265
|
+
authorization?: string | undefined;
|
|
266
|
+
};
|
|
267
|
+
response: {
|
|
268
|
+
200: Response;
|
|
269
|
+
422: {
|
|
270
|
+
type: "validation";
|
|
271
|
+
on: string;
|
|
272
|
+
summary?: string;
|
|
273
|
+
message?: string;
|
|
274
|
+
found?: unknown;
|
|
275
|
+
property?: string;
|
|
276
|
+
expected?: string;
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
} & {
|
|
282
|
+
[x: string]: {
|
|
283
|
+
":clientId": {
|
|
284
|
+
get: {
|
|
285
|
+
body: unknown;
|
|
286
|
+
params: {
|
|
287
|
+
clientId: string;
|
|
288
|
+
};
|
|
289
|
+
query: unknown;
|
|
290
|
+
headers: {
|
|
291
|
+
authorization?: string | undefined;
|
|
292
|
+
};
|
|
293
|
+
response: {
|
|
294
|
+
200: Response;
|
|
295
|
+
422: {
|
|
296
|
+
type: "validation";
|
|
297
|
+
on: string;
|
|
298
|
+
summary?: string;
|
|
299
|
+
message?: string;
|
|
300
|
+
found?: unknown;
|
|
301
|
+
property?: string;
|
|
302
|
+
expected?: string;
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
} & {
|
|
309
|
+
[x: string]: {
|
|
310
|
+
":clientId": {
|
|
311
|
+
put: {
|
|
312
|
+
body: {
|
|
313
|
+
jwks?: any;
|
|
314
|
+
scope?: string | undefined;
|
|
315
|
+
backchannel_logout_uri?: string | undefined;
|
|
316
|
+
client_name?: string | undefined;
|
|
317
|
+
jwks_uri?: string | undefined;
|
|
318
|
+
post_logout_redirect_uris?: string[] | undefined;
|
|
319
|
+
redirect_uris?: string[] | undefined;
|
|
320
|
+
};
|
|
321
|
+
params: {
|
|
322
|
+
clientId: string;
|
|
323
|
+
};
|
|
324
|
+
query: unknown;
|
|
325
|
+
headers: {
|
|
326
|
+
authorization?: string | undefined;
|
|
327
|
+
};
|
|
328
|
+
response: {
|
|
329
|
+
200: Response;
|
|
330
|
+
422: {
|
|
331
|
+
type: "validation";
|
|
332
|
+
on: string;
|
|
333
|
+
summary?: string;
|
|
334
|
+
message?: string;
|
|
335
|
+
found?: unknown;
|
|
336
|
+
property?: string;
|
|
337
|
+
expected?: string;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
} & {
|
|
344
|
+
[x: string]: {
|
|
345
|
+
":clientId": {
|
|
346
|
+
delete: {
|
|
347
|
+
body: unknown;
|
|
348
|
+
params: {
|
|
349
|
+
clientId: string;
|
|
350
|
+
};
|
|
351
|
+
query: unknown;
|
|
352
|
+
headers: {
|
|
353
|
+
authorization?: string | undefined;
|
|
354
|
+
};
|
|
355
|
+
response: {
|
|
356
|
+
200: Response;
|
|
357
|
+
422: {
|
|
358
|
+
type: "validation";
|
|
359
|
+
on: string;
|
|
360
|
+
summary?: string;
|
|
361
|
+
message?: string;
|
|
362
|
+
found?: unknown;
|
|
363
|
+
property?: string;
|
|
364
|
+
expected?: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
250
370
|
} & {
|
|
251
371
|
[x: string]: {
|
|
252
372
|
get: {
|
package/dist/oidc/types.d.ts
CHANGED
|
@@ -13,7 +13,23 @@ export type ClientAssertionJtiStore = {
|
|
|
13
13
|
recordIfFresh: (clientId: string, jti: string, expiresAt: number) => Promise<boolean>;
|
|
14
14
|
};
|
|
15
15
|
export type OAuthClientStore = {
|
|
16
|
+
deleteClient?: (clientId: string) => Promise<void>;
|
|
16
17
|
findClient: (clientId: string) => Promise<OAuthClient | undefined>;
|
|
18
|
+
saveClient?: (client: OAuthClient) => Promise<void>;
|
|
19
|
+
updateClient?: (clientId: string, client: OAuthClient) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export type ClientRegistrationToken = {
|
|
22
|
+
clientId: string;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
tokenHash: string;
|
|
25
|
+
};
|
|
26
|
+
export type ClientRegistrationTokenStore = {
|
|
27
|
+
deleteByClientId: (clientId: string) => Promise<void>;
|
|
28
|
+
findByTokenHash: (tokenHash: string) => Promise<ClientRegistrationToken | undefined>;
|
|
29
|
+
saveToken: (token: ClientRegistrationToken) => Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
export type InitialAccessTokenStore = {
|
|
32
|
+
consumeToken: (tokenHash: string) => Promise<boolean>;
|
|
17
33
|
};
|
|
18
34
|
export type AuthorizationCode = {
|
|
19
35
|
claims?: Record<string, unknown>;
|
|
@@ -27,13 +27,13 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
27
27
|
query: unknown;
|
|
28
28
|
headers: unknown;
|
|
29
29
|
response: {
|
|
30
|
+
401: "Authentication required";
|
|
30
31
|
200: {
|
|
31
32
|
readonly organizations: {
|
|
32
33
|
membership: import("./types").OrganizationMembership;
|
|
33
34
|
organization: import("./types").Organization | undefined;
|
|
34
35
|
}[];
|
|
35
36
|
};
|
|
36
|
-
401: "Authentication required";
|
|
37
37
|
422: {
|
|
38
38
|
type: "validation";
|
|
39
39
|
on: string;
|
|
@@ -57,11 +57,11 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
57
57
|
query: unknown;
|
|
58
58
|
headers: unknown;
|
|
59
59
|
response: {
|
|
60
|
+
401: "Authentication required";
|
|
61
|
+
403: "Cannot create organizations";
|
|
60
62
|
200: {
|
|
61
63
|
readonly organization: import("./types").Organization;
|
|
62
64
|
};
|
|
63
|
-
401: "Authentication required";
|
|
64
|
-
403: "Cannot create organizations";
|
|
65
65
|
422: {
|
|
66
66
|
type: "validation";
|
|
67
67
|
on: string;
|
|
@@ -89,12 +89,12 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
89
89
|
query: unknown;
|
|
90
90
|
headers: unknown;
|
|
91
91
|
response: {
|
|
92
|
+
401: "Authentication required";
|
|
93
|
+
403: "Cannot manage members";
|
|
92
94
|
200: {
|
|
93
95
|
readonly invitationId: string;
|
|
94
96
|
readonly token: string;
|
|
95
97
|
};
|
|
96
|
-
401: "Authentication required";
|
|
97
|
-
403: "Cannot manage members";
|
|
98
98
|
422: {
|
|
99
99
|
type: "validation";
|
|
100
100
|
on: string;
|
|
@@ -121,6 +121,8 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
121
121
|
query: unknown;
|
|
122
122
|
headers: unknown;
|
|
123
123
|
response: {
|
|
124
|
+
401: "Authentication required";
|
|
125
|
+
403: "Cannot manage members";
|
|
124
126
|
200: {
|
|
125
127
|
readonly invitations: {
|
|
126
128
|
email: string;
|
|
@@ -130,8 +132,6 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
130
132
|
state: import("./types").InvitationState;
|
|
131
133
|
}[];
|
|
132
134
|
};
|
|
133
|
-
401: "Authentication required";
|
|
134
|
-
403: "Cannot manage members";
|
|
135
135
|
422: {
|
|
136
136
|
type: "validation";
|
|
137
137
|
on: string;
|
|
@@ -160,12 +160,12 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
160
160
|
query: unknown;
|
|
161
161
|
headers: unknown;
|
|
162
162
|
response: {
|
|
163
|
-
200: {
|
|
164
|
-
readonly revoked: string;
|
|
165
|
-
};
|
|
166
163
|
401: "Authentication required";
|
|
167
164
|
403: "Cannot manage members";
|
|
168
165
|
404: "Invitation not found";
|
|
166
|
+
200: {
|
|
167
|
+
readonly revoked: string;
|
|
168
|
+
};
|
|
169
169
|
422: {
|
|
170
170
|
type: "validation";
|
|
171
171
|
on: string;
|
|
@@ -193,12 +193,12 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
193
193
|
query: unknown;
|
|
194
194
|
headers: unknown;
|
|
195
195
|
response: {
|
|
196
|
+
400: "Invalid or expired invitation";
|
|
197
|
+
401: "Authentication required";
|
|
196
198
|
200: {
|
|
197
199
|
readonly organizationId: string;
|
|
198
200
|
readonly roles: string[];
|
|
199
201
|
};
|
|
200
|
-
400: "Invalid or expired invitation";
|
|
201
|
-
401: "Authentication required";
|
|
202
202
|
422: {
|
|
203
203
|
type: "validation";
|
|
204
204
|
on: string;
|
|
@@ -225,11 +225,11 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
225
225
|
query: unknown;
|
|
226
226
|
headers: unknown;
|
|
227
227
|
response: {
|
|
228
|
+
401: "Authentication required";
|
|
229
|
+
403: "Not a member";
|
|
228
230
|
200: {
|
|
229
231
|
readonly members: import("./types").OrganizationMembership[];
|
|
230
232
|
};
|
|
231
|
-
401: "Authentication required";
|
|
232
|
-
403: "Not a member";
|
|
233
233
|
422: {
|
|
234
234
|
type: "validation";
|
|
235
235
|
on: string;
|
|
@@ -258,11 +258,11 @@ export declare const organizationRoutes: <UserType>({ authSessionStore, canCreat
|
|
|
258
258
|
query: unknown;
|
|
259
259
|
headers: unknown;
|
|
260
260
|
response: {
|
|
261
|
+
401: "Authentication required";
|
|
262
|
+
403: "Cannot manage members";
|
|
261
263
|
200: {
|
|
262
264
|
readonly removed: string;
|
|
263
265
|
};
|
|
264
|
-
401: "Authentication required";
|
|
265
|
-
403: "Cannot manage members";
|
|
266
266
|
422: {
|
|
267
267
|
type: "validation";
|
|
268
268
|
on: string;
|
|
@@ -64,11 +64,11 @@ export declare const passwordlessRoutes: <UserType>({ authSessionStore, emit, ge
|
|
|
64
64
|
query: unknown;
|
|
65
65
|
headers: unknown;
|
|
66
66
|
response: {
|
|
67
|
+
400: "Invalid or expired link";
|
|
68
|
+
401: "No account for this email";
|
|
67
69
|
200: {
|
|
68
70
|
readonly status: "authenticated";
|
|
69
71
|
};
|
|
70
|
-
400: "Invalid or expired link";
|
|
71
|
-
401: "No account for this email";
|
|
72
72
|
422: {
|
|
73
73
|
type: "validation";
|
|
74
74
|
on: string;
|
|
@@ -123,11 +123,11 @@ export declare const passwordlessRoutes: <UserType>({ authSessionStore, emit, ge
|
|
|
123
123
|
query: unknown;
|
|
124
124
|
headers: unknown;
|
|
125
125
|
response: {
|
|
126
|
+
400: "Invalid or expired code";
|
|
127
|
+
401: "No account for this email";
|
|
126
128
|
200: {
|
|
127
129
|
readonly status: "authenticated";
|
|
128
130
|
};
|
|
129
|
-
400: "Invalid or expired code";
|
|
130
|
-
401: "No account for this email";
|
|
131
131
|
422: {
|
|
132
132
|
type: "validation";
|
|
133
133
|
on: string;
|