@absolutejs/auth 0.29.0-beta.0 → 0.29.0-beta.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.
@@ -0,0 +1,8 @@
1
+ import type { ClientAssertionJtiStore, OAuthClient } from './types';
2
+ export declare const CLIENT_ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer";
3
+ export declare const verifyClientAssertion: ({ assertion, expectedAudience, jtiStore, resolveClient }: {
4
+ assertion: string;
5
+ expectedAudience: string;
6
+ jtiStore?: ClientAssertionJtiStore;
7
+ resolveClient: (clientId: string) => Promise<OAuthClient | undefined>;
8
+ }) => Promise<OAuthClient | undefined>;
@@ -1,10 +1,11 @@
1
1
  import type { RouteString } from '../types';
2
2
  import { type SigningKey } from './keys';
3
- import type { AuthorizationCodeStore, DeviceAuthorizationStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
3
+ import type { AuthorizationCodeStore, ClientAssertionJtiStore, DeviceAuthorizationStore, LogoutDeliveryStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
4
4
  export declare const DEFAULT_OIDC_ROUTE: RouteString;
5
5
  export type OidcProviderConfig<UserType> = {
6
6
  accessTokenTtlMs?: number;
7
7
  authorizationCodeStore: AuthorizationCodeStore;
8
+ clientAssertionJtiStore?: ClientAssertionJtiStore;
8
9
  clientStore: OAuthClientStore;
9
10
  deviceAuthorizationStore?: DeviceAuthorizationStore;
10
11
  deviceCodeTtlMs?: number;
@@ -28,6 +29,7 @@ export type OidcProviderConfig<UserType> = {
28
29
  idTokenTtlMs?: number;
29
30
  issuer: string;
30
31
  loginUrl?: string;
32
+ logoutDeliveryStore?: LogoutDeliveryStore;
31
33
  oidcRoute?: RouteString;
32
34
  refreshTokenStore: OidcRefreshTokenStore;
33
35
  refreshTokenTtlMs?: number;
@@ -1,5 +1,7 @@
1
- import type { AuthorizationCodeStore, DeviceAuthorizationStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore } from './types';
1
+ import type { AuthorizationCodeStore, ClientAssertionJtiStore, DeviceAuthorizationStore, LogoutDeliveryStore, OAuthClient, OAuthClientStore, OidcRefreshTokenStore } from './types';
2
2
  export declare const createInMemoryAuthorizationCodeStore: () => AuthorizationCodeStore;
3
+ export declare const createInMemoryClientAssertionJtiStore: () => ClientAssertionJtiStore;
3
4
  export declare const createInMemoryDeviceAuthorizationStore: () => DeviceAuthorizationStore;
5
+ export declare const createInMemoryLogoutDeliveryStore: () => LogoutDeliveryStore;
4
6
  export declare const createInMemoryOAuthClientStore: (clients: OAuthClient[]) => OAuthClientStore;
5
7
  export declare const createInMemoryOidcRefreshTokenStore: () => OidcRefreshTokenStore;
@@ -0,0 +1,38 @@
1
+ import type { OidcProviderConfig } from './config';
2
+ import type { LogoutDelivery, OAuthClient } from './types';
3
+ export declare const resolvePostLogoutRedirect: ({ client, requestedUri }: {
4
+ client: OAuthClient;
5
+ requestedUri: string | undefined;
6
+ }) => string | undefined;
7
+ export declare const verifyIdTokenHint: <UserType>({ config, idTokenHint }: {
8
+ config: OidcProviderConfig<UserType>;
9
+ idTokenHint: string;
10
+ }) => Promise<{
11
+ audClientId: any;
12
+ sub: any;
13
+ } | undefined>;
14
+ type DeliveryFetch = (url: string, init: {
15
+ body: string;
16
+ headers: Record<string, string>;
17
+ method: string;
18
+ signal: AbortSignal;
19
+ }) => Promise<{
20
+ ok: boolean;
21
+ status: number;
22
+ }>;
23
+ export declare const mintLogoutToken: <UserType>({ clientId, config, now, sub }: {
24
+ clientId: string;
25
+ config: OidcProviderConfig<UserType>;
26
+ now?: number;
27
+ sub: string;
28
+ }) => Promise<string>;
29
+ export declare const fanOutBackchannelLogout: <UserType>({ config, fetchImpl, now, onError, skipClientId, timeoutMs, userId }: {
30
+ config: OidcProviderConfig<UserType>;
31
+ fetchImpl?: DeliveryFetch;
32
+ now?: number;
33
+ onError?: (delivery: LogoutDelivery) => void | Promise<void>;
34
+ skipClientId?: string;
35
+ timeoutMs?: number;
36
+ userId: string;
37
+ }) => Promise<string[]>;
38
+ export {};
@@ -1,9 +1,109 @@
1
1
  import { type AnyPgDatabase } from '../stores/postgres';
2
- import type { AuthorizationCodeStore, DeviceAuthorizationStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
2
+ import type { AuthorizationCodeStore, ClientAssertionJtiStore, DeviceAuthorizationStore, LogoutDeliveryStore, OAuthClientStore, OidcRefreshTokenStore } from './types';
3
+ export declare const oauthClientAssertionJtisTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
4
+ name: "auth_oauth_client_assertion_jtis";
5
+ schema: undefined;
6
+ columns: {
7
+ client_id: import("drizzle-orm/pg-core").PgColumn<{
8
+ name: "client_id";
9
+ tableName: "auth_oauth_client_assertion_jtis";
10
+ dataType: "string";
11
+ columnType: "PgVarchar";
12
+ data: string;
13
+ driverParam: string;
14
+ notNull: true;
15
+ hasDefault: false;
16
+ isPrimaryKey: false;
17
+ isAutoincrement: false;
18
+ hasRuntimeDefault: false;
19
+ enumValues: [string, ...string[]];
20
+ baseColumn: never;
21
+ identity: undefined;
22
+ generated: undefined;
23
+ }, {}, {
24
+ length: 255;
25
+ }>;
26
+ composite_key: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "composite_key";
28
+ tableName: "auth_oauth_client_assertion_jtis";
29
+ dataType: "string";
30
+ columnType: "PgVarchar";
31
+ data: string;
32
+ driverParam: string;
33
+ notNull: true;
34
+ hasDefault: false;
35
+ isPrimaryKey: true;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: [string, ...string[]];
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {
43
+ length: 255;
44
+ }>;
45
+ expires_at_ms: import("drizzle-orm/pg-core").PgColumn<{
46
+ name: "expires_at_ms";
47
+ tableName: "auth_oauth_client_assertion_jtis";
48
+ dataType: "number";
49
+ columnType: "PgBigInt53";
50
+ data: number;
51
+ driverParam: string | number;
52
+ notNull: true;
53
+ hasDefault: false;
54
+ isPrimaryKey: false;
55
+ isAutoincrement: false;
56
+ hasRuntimeDefault: false;
57
+ enumValues: undefined;
58
+ baseColumn: never;
59
+ identity: undefined;
60
+ generated: undefined;
61
+ }, {}, {}>;
62
+ jti: import("drizzle-orm/pg-core").PgColumn<{
63
+ name: "jti";
64
+ tableName: "auth_oauth_client_assertion_jtis";
65
+ dataType: "string";
66
+ columnType: "PgVarchar";
67
+ data: string;
68
+ driverParam: string;
69
+ notNull: true;
70
+ hasDefault: false;
71
+ isPrimaryKey: false;
72
+ isAutoincrement: false;
73
+ hasRuntimeDefault: false;
74
+ enumValues: [string, ...string[]];
75
+ baseColumn: never;
76
+ identity: undefined;
77
+ generated: undefined;
78
+ }, {}, {
79
+ length: 255;
80
+ }>;
81
+ };
82
+ dialect: "pg";
83
+ }>;
3
84
  export declare const oauthClientsTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
4
85
  name: "auth_oauth_clients";
5
86
  schema: undefined;
6
87
  columns: {
88
+ backchannel_logout_uri: import("drizzle-orm/pg-core").PgColumn<{
89
+ name: "backchannel_logout_uri";
90
+ tableName: "auth_oauth_clients";
91
+ dataType: "string";
92
+ columnType: "PgVarchar";
93
+ data: string;
94
+ driverParam: string;
95
+ notNull: false;
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: 2048;
106
+ }>;
7
107
  client_id: import("drizzle-orm/pg-core").PgColumn<{
8
108
  name: "client_id";
9
109
  tableName: "auth_oauth_clients";
@@ -42,6 +142,44 @@ export declare const oauthClientsTable: import("drizzle-orm/pg-core").PgTableWit
42
142
  }, {}, {
43
143
  length: 255;
44
144
  }>;
145
+ jwks_json: import("drizzle-orm/pg-core").PgColumn<{
146
+ name: "jwks_json";
147
+ tableName: "auth_oauth_clients";
148
+ dataType: "json";
149
+ columnType: "PgJsonb";
150
+ data: JsonWebKey[];
151
+ driverParam: unknown;
152
+ notNull: false;
153
+ hasDefault: false;
154
+ isPrimaryKey: false;
155
+ isAutoincrement: false;
156
+ hasRuntimeDefault: false;
157
+ enumValues: undefined;
158
+ baseColumn: never;
159
+ identity: undefined;
160
+ generated: undefined;
161
+ }, {}, {
162
+ $type: JsonWebKey[];
163
+ }>;
164
+ jwks_uri: import("drizzle-orm/pg-core").PgColumn<{
165
+ name: "jwks_uri";
166
+ tableName: "auth_oauth_clients";
167
+ dataType: "string";
168
+ columnType: "PgVarchar";
169
+ data: string;
170
+ driverParam: string;
171
+ notNull: false;
172
+ hasDefault: false;
173
+ isPrimaryKey: false;
174
+ isAutoincrement: false;
175
+ hasRuntimeDefault: false;
176
+ enumValues: [string, ...string[]];
177
+ baseColumn: never;
178
+ identity: undefined;
179
+ generated: undefined;
180
+ }, {}, {
181
+ length: 2048;
182
+ }>;
45
183
  name: import("drizzle-orm/pg-core").PgColumn<{
46
184
  name: "name";
47
185
  tableName: "auth_oauth_clients";
@@ -61,6 +199,49 @@ export declare const oauthClientsTable: import("drizzle-orm/pg-core").PgTableWit
61
199
  }, {}, {
62
200
  length: 255;
63
201
  }>;
202
+ post_logout_redirect_uris: import("drizzle-orm/pg-core").PgColumn<{
203
+ name: "post_logout_redirect_uris";
204
+ tableName: "auth_oauth_clients";
205
+ dataType: "array";
206
+ columnType: "PgArray";
207
+ data: string[];
208
+ driverParam: string | string[];
209
+ notNull: false;
210
+ hasDefault: false;
211
+ isPrimaryKey: false;
212
+ isAutoincrement: false;
213
+ hasRuntimeDefault: false;
214
+ enumValues: [string, ...string[]];
215
+ baseColumn: import("drizzle-orm").Column<{
216
+ name: "post_logout_redirect_uris";
217
+ tableName: "auth_oauth_clients";
218
+ dataType: "string";
219
+ columnType: "PgText";
220
+ data: string;
221
+ driverParam: string;
222
+ notNull: false;
223
+ hasDefault: false;
224
+ isPrimaryKey: false;
225
+ isAutoincrement: false;
226
+ hasRuntimeDefault: false;
227
+ enumValues: [string, ...string[]];
228
+ baseColumn: never;
229
+ identity: undefined;
230
+ generated: undefined;
231
+ }, {}, {}>;
232
+ identity: undefined;
233
+ generated: undefined;
234
+ }, {}, {
235
+ baseBuilder: import("drizzle-orm/pg-core").PgColumnBuilder<{
236
+ name: "post_logout_redirect_uris";
237
+ dataType: "string";
238
+ columnType: "PgText";
239
+ data: string;
240
+ enumValues: [string, ...string[]];
241
+ driverParam: string;
242
+ }, {}, {}, import("drizzle-orm").ColumnBuilderExtraConfig>;
243
+ size: undefined;
244
+ }>;
64
245
  redirect_uris: import("drizzle-orm/pg-core").PgColumn<{
65
246
  name: "redirect_uris";
66
247
  tableName: "auth_oauth_clients";
@@ -582,6 +763,174 @@ export declare const oauthDeviceAuthorizationsTable: import("drizzle-orm/pg-core
582
763
  };
583
764
  dialect: "pg";
584
765
  }>;
766
+ export declare const oauthLogoutDeliveriesTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
767
+ name: "auth_oauth_logout_deliveries";
768
+ schema: undefined;
769
+ columns: {
770
+ attempts: import("drizzle-orm/pg-core").PgColumn<{
771
+ name: "attempts";
772
+ tableName: "auth_oauth_logout_deliveries";
773
+ dataType: "number";
774
+ columnType: "PgBigInt53";
775
+ data: number;
776
+ driverParam: string | number;
777
+ notNull: true;
778
+ hasDefault: false;
779
+ isPrimaryKey: false;
780
+ isAutoincrement: false;
781
+ hasRuntimeDefault: false;
782
+ enumValues: undefined;
783
+ baseColumn: never;
784
+ identity: undefined;
785
+ generated: undefined;
786
+ }, {}, {}>;
787
+ client_id: import("drizzle-orm/pg-core").PgColumn<{
788
+ name: "client_id";
789
+ tableName: "auth_oauth_logout_deliveries";
790
+ dataType: "string";
791
+ columnType: "PgVarchar";
792
+ data: string;
793
+ driverParam: string;
794
+ notNull: true;
795
+ hasDefault: false;
796
+ isPrimaryKey: false;
797
+ isAutoincrement: false;
798
+ hasRuntimeDefault: false;
799
+ enumValues: [string, ...string[]];
800
+ baseColumn: never;
801
+ identity: undefined;
802
+ generated: undefined;
803
+ }, {}, {
804
+ length: 255;
805
+ }>;
806
+ created_at_ms: import("drizzle-orm/pg-core").PgColumn<{
807
+ name: "created_at_ms";
808
+ tableName: "auth_oauth_logout_deliveries";
809
+ dataType: "number";
810
+ columnType: "PgBigInt53";
811
+ data: number;
812
+ driverParam: string | number;
813
+ notNull: true;
814
+ hasDefault: false;
815
+ isPrimaryKey: false;
816
+ isAutoincrement: false;
817
+ hasRuntimeDefault: false;
818
+ enumValues: undefined;
819
+ baseColumn: never;
820
+ identity: undefined;
821
+ generated: undefined;
822
+ }, {}, {}>;
823
+ endpoint_url: import("drizzle-orm/pg-core").PgColumn<{
824
+ name: "endpoint_url";
825
+ tableName: "auth_oauth_logout_deliveries";
826
+ dataType: "string";
827
+ columnType: "PgVarchar";
828
+ data: string;
829
+ driverParam: string;
830
+ notNull: true;
831
+ hasDefault: false;
832
+ isPrimaryKey: false;
833
+ isAutoincrement: false;
834
+ hasRuntimeDefault: false;
835
+ enumValues: [string, ...string[]];
836
+ baseColumn: never;
837
+ identity: undefined;
838
+ generated: undefined;
839
+ }, {}, {
840
+ length: 2048;
841
+ }>;
842
+ id: import("drizzle-orm/pg-core").PgColumn<{
843
+ name: "id";
844
+ tableName: "auth_oauth_logout_deliveries";
845
+ dataType: "string";
846
+ columnType: "PgVarchar";
847
+ data: string;
848
+ driverParam: string;
849
+ notNull: true;
850
+ hasDefault: false;
851
+ isPrimaryKey: true;
852
+ isAutoincrement: false;
853
+ hasRuntimeDefault: false;
854
+ enumValues: [string, ...string[]];
855
+ baseColumn: never;
856
+ identity: undefined;
857
+ generated: undefined;
858
+ }, {}, {
859
+ length: 255;
860
+ }>;
861
+ last_error: import("drizzle-orm/pg-core").PgColumn<{
862
+ name: "last_error";
863
+ tableName: "auth_oauth_logout_deliveries";
864
+ dataType: "string";
865
+ columnType: "PgText";
866
+ data: string;
867
+ driverParam: string;
868
+ notNull: false;
869
+ hasDefault: false;
870
+ isPrimaryKey: false;
871
+ isAutoincrement: false;
872
+ hasRuntimeDefault: false;
873
+ enumValues: [string, ...string[]];
874
+ baseColumn: never;
875
+ identity: undefined;
876
+ generated: undefined;
877
+ }, {}, {}>;
878
+ last_status: import("drizzle-orm/pg-core").PgColumn<{
879
+ name: "last_status";
880
+ tableName: "auth_oauth_logout_deliveries";
881
+ dataType: "number";
882
+ columnType: "PgBigInt53";
883
+ data: number;
884
+ driverParam: string | number;
885
+ notNull: false;
886
+ hasDefault: false;
887
+ isPrimaryKey: false;
888
+ isAutoincrement: false;
889
+ hasRuntimeDefault: false;
890
+ enumValues: undefined;
891
+ baseColumn: never;
892
+ identity: undefined;
893
+ generated: undefined;
894
+ }, {}, {}>;
895
+ logout_token: import("drizzle-orm/pg-core").PgColumn<{
896
+ name: "logout_token";
897
+ tableName: "auth_oauth_logout_deliveries";
898
+ dataType: "string";
899
+ columnType: "PgText";
900
+ data: string;
901
+ driverParam: string;
902
+ notNull: true;
903
+ hasDefault: false;
904
+ isPrimaryKey: false;
905
+ isAutoincrement: false;
906
+ hasRuntimeDefault: false;
907
+ enumValues: [string, ...string[]];
908
+ baseColumn: never;
909
+ identity: undefined;
910
+ generated: undefined;
911
+ }, {}, {}>;
912
+ user_id: import("drizzle-orm/pg-core").PgColumn<{
913
+ name: "user_id";
914
+ tableName: "auth_oauth_logout_deliveries";
915
+ dataType: "string";
916
+ columnType: "PgVarchar";
917
+ data: string;
918
+ driverParam: string;
919
+ notNull: true;
920
+ hasDefault: false;
921
+ isPrimaryKey: false;
922
+ isAutoincrement: false;
923
+ hasRuntimeDefault: false;
924
+ enumValues: [string, ...string[]];
925
+ baseColumn: never;
926
+ identity: undefined;
927
+ generated: undefined;
928
+ }, {}, {
929
+ length: 255;
930
+ }>;
931
+ };
932
+ dialect: "pg";
933
+ }>;
585
934
  export declare const oauthRefreshTokensTable: import("drizzle-orm/pg-core").PgTableWithColumns<{
586
935
  name: "auth_oauth_refresh_tokens";
587
936
  schema: undefined;
@@ -762,10 +1111,14 @@ export declare const oauthRefreshTokensTable: import("drizzle-orm/pg-core").PgTa
762
1111
  dialect: "pg";
763
1112
  }>;
764
1113
  export declare const createNeonAuthorizationCodeStore: (databaseUrl: string) => AuthorizationCodeStore;
1114
+ export declare const createNeonClientAssertionJtiStore: (databaseUrl: string) => ClientAssertionJtiStore;
765
1115
  export declare const createNeonDeviceAuthorizationStore: (databaseUrl: string) => DeviceAuthorizationStore;
1116
+ export declare const createNeonLogoutDeliveryStore: (databaseUrl: string) => LogoutDeliveryStore;
766
1117
  export declare const createNeonOAuthClientStore: (databaseUrl: string) => OAuthClientStore;
767
1118
  export declare const createNeonOidcRefreshTokenStore: (databaseUrl: string) => OidcRefreshTokenStore;
768
1119
  export declare const createPostgresAuthorizationCodeStore: (db: AnyPgDatabase) => AuthorizationCodeStore;
1120
+ export declare const createPostgresClientAssertionJtiStore: (db: AnyPgDatabase) => ClientAssertionJtiStore;
769
1121
  export declare const createPostgresDeviceAuthorizationStore: (db: AnyPgDatabase) => DeviceAuthorizationStore;
1122
+ export declare const createPostgresLogoutDeliveryStore: (db: AnyPgDatabase) => LogoutDeliveryStore;
770
1123
  export declare const createPostgresOAuthClientStore: (db: AnyPgDatabase) => OAuthClientStore;
771
1124
  export declare const createPostgresOidcRefreshTokenStore: (db: AnyPgDatabase) => OidcRefreshTokenStore;
@@ -65,6 +65,8 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
65
65
  grant_type?: string | undefined;
66
66
  code?: string | undefined;
67
67
  redirect_uri?: string | undefined;
68
+ client_assertion?: string | undefined;
69
+ client_assertion_type?: string | undefined;
68
70
  code_verifier?: string | undefined;
69
71
  subject_token?: string | undefined;
70
72
  subject_token_type?: string | undefined;
@@ -193,6 +195,58 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
193
195
  };
194
196
  };
195
197
  };
198
+ } & {
199
+ [x: string]: {
200
+ get: {
201
+ body: unknown;
202
+ params: {};
203
+ query: {
204
+ client_id?: string | undefined;
205
+ state?: string | undefined;
206
+ id_token_hint?: string | undefined;
207
+ post_logout_redirect_uri?: string | undefined;
208
+ };
209
+ headers: unknown;
210
+ response: {
211
+ 200: Response;
212
+ 422: {
213
+ type: "validation";
214
+ on: string;
215
+ summary?: string;
216
+ message?: string;
217
+ found?: unknown;
218
+ property?: string;
219
+ expected?: string;
220
+ };
221
+ };
222
+ };
223
+ };
224
+ } & {
225
+ [x: string]: {
226
+ post: {
227
+ body: {
228
+ client_id?: string | undefined;
229
+ state?: string | undefined;
230
+ id_token_hint?: string | undefined;
231
+ post_logout_redirect_uri?: string | undefined;
232
+ };
233
+ params: {};
234
+ query: unknown;
235
+ headers: unknown;
236
+ response: {
237
+ 200: Response;
238
+ 422: {
239
+ type: "validation";
240
+ on: string;
241
+ summary?: string;
242
+ message?: string;
243
+ found?: unknown;
244
+ property?: string;
245
+ expected?: string;
246
+ };
247
+ };
248
+ };
249
+ };
196
250
  } & {
197
251
  [x: string]: {
198
252
  get: {
@@ -224,7 +278,7 @@ export declare const oidcProviderRoutes: <UserType>(config: OidcProviderConfig<U
224
278
  query: unknown;
225
279
  headers: unknown;
226
280
  response: {
227
- 200: Record<string, string | string[]>;
281
+ 200: Record<string, string | boolean | string[]>;
228
282
  };
229
283
  };
230
284
  };
@@ -1,10 +1,17 @@
1
1
  export type OAuthClient = {
2
+ backchannelLogoutUri?: string;
2
3
  clientId: string;
3
4
  hashedSecret?: string;
5
+ jwks?: JsonWebKey[];
6
+ jwksUri?: string;
4
7
  name: string;
8
+ postLogoutRedirectUris?: string[];
5
9
  redirectUris: string[];
6
10
  scopes: string[];
7
11
  };
12
+ export type ClientAssertionJtiStore = {
13
+ recordIfFresh: (clientId: string, jti: string, expiresAt: number) => Promise<boolean>;
14
+ };
8
15
  export type OAuthClientStore = {
9
16
  findClient: (clientId: string) => Promise<OAuthClient | undefined>;
10
17
  };
@@ -39,6 +46,7 @@ export type OidcRefreshTokenStore = {
39
46
  consumeToken: (tokenHash: string) => Promise<OidcRefreshToken | undefined>;
40
47
  deleteForUser: (userId: string) => Promise<void>;
41
48
  getToken: (tokenHash: string) => Promise<OidcRefreshToken | undefined>;
49
+ listClientIdsForUser: (userId: string) => Promise<string[]>;
42
50
  saveToken: (token: OidcRefreshToken) => Promise<void>;
43
51
  };
44
52
  export type DeviceAuthorizationStatus = 'approved' | 'denied' | 'pending';
@@ -53,6 +61,22 @@ export type DeviceAuthorization = {
53
61
  userCode: string;
54
62
  userSub?: string;
55
63
  };
64
+ export type LogoutDelivery = {
65
+ attempts: number;
66
+ clientId: string;
67
+ createdAt: number;
68
+ endpointUrl: string;
69
+ id: string;
70
+ lastError?: string;
71
+ lastStatus?: number;
72
+ logoutToken: string;
73
+ userId: string;
74
+ };
75
+ export type LogoutDeliveryStore = {
76
+ listFailed: (limit?: number) => Promise<LogoutDelivery[]>;
77
+ recordFailure: (delivery: LogoutDelivery) => Promise<void>;
78
+ removeFailure: (deliveryId: string) => Promise<void>;
79
+ };
56
80
  export type DeviceAuthorizationStore = {
57
81
  deleteByDeviceCodeHash: (deviceCodeHash: string) => Promise<void>;
58
82
  findByDeviceCodeHash: (deviceCodeHash: string) => Promise<DeviceAuthorization | undefined>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.29.0-beta.0",
2
+ "version": "0.29.0-beta.2",
3
3
  "name": "@absolutejs/auth",
4
4
  "description": "An authorization library for absolutejs",
5
5
  "repository": {