@authhero/adapter-interfaces 3.11.0 → 4.0.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/adapter-interfaces.cjs +1 -1
- package/dist/adapter-interfaces.d.ts +83 -4
- package/dist/adapter-interfaces.mjs +454 -407
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/adapters/UserRoles.d.ts +19 -0
- package/dist/types/types/Client.d.ts +20 -2
- package/dist/types/types/JWKS.d.ts +2 -0
- package/dist/types/utils/base32.d.ts +16 -0
- package/dist/types/utils/base64.d.ts +13 -0
- package/dist/types/utils/hex.d.ts +8 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -7,8 +7,27 @@ export interface ListUserRolesResponse {
|
|
|
7
7
|
limit: number;
|
|
8
8
|
length: number;
|
|
9
9
|
}
|
|
10
|
+
export interface ListRoleUsersResponse {
|
|
11
|
+
/** Distinct user ids holding the role, ordered by user_id ascending. */
|
|
12
|
+
userIds: string[];
|
|
13
|
+
start: number;
|
|
14
|
+
limit: number;
|
|
15
|
+
/**
|
|
16
|
+
* Offset mode: total number of distinct users holding the role.
|
|
17
|
+
* Checkpoint mode: number of ids in this page (no total is computed).
|
|
18
|
+
*/
|
|
19
|
+
length: number;
|
|
20
|
+
/** Opaque checkpoint cursor for the next page; absent on the last page. */
|
|
21
|
+
next?: string;
|
|
22
|
+
}
|
|
10
23
|
export interface UserRolesAdapter {
|
|
11
24
|
list(tenantId: string, userId: string, params?: ListParams, organizationId?: string): Promise<Role[]>;
|
|
25
|
+
/**
|
|
26
|
+
* List the distinct users assigned to a role, across all organization
|
|
27
|
+
* scopes (a user holding the role in several organizations appears once).
|
|
28
|
+
* Supports offset (page/per_page) and checkpoint (from/take) pagination.
|
|
29
|
+
*/
|
|
30
|
+
listUsers(tenantId: string, roleId: string, params?: ListParams): Promise<ListRoleUsersResponse>;
|
|
12
31
|
create(tenantId: string, userId: string, roleId: string, organizationId?: string, options?: CreateOptions): Promise<boolean>;
|
|
13
32
|
remove(tenantId: string, userId: string, roleId: string, organizationId?: string): Promise<boolean>;
|
|
14
33
|
}
|
|
@@ -44,7 +44,16 @@ export declare const clientInsertSchema: z.ZodObject<{
|
|
|
44
44
|
connections: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
45
45
|
allowed_logout_urls: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
46
46
|
session_transfer: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
47
|
-
oidc_logout: z.ZodOptional<z.ZodDefault<z.
|
|
47
|
+
oidc_logout: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
48
|
+
backchannel_logout_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
|
+
backchannel_logout_initiators: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
custom: "custom";
|
|
52
|
+
all: "all";
|
|
53
|
+
}>>;
|
|
54
|
+
selected_initiators: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
55
|
+
}, z.core.$loose>>;
|
|
56
|
+
}, z.core.$loose>>>;
|
|
48
57
|
grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
49
58
|
jwt_configuration: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
50
59
|
signing_keys: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
|
|
@@ -168,7 +177,16 @@ export declare const clientSchema: z.ZodObject<{
|
|
|
168
177
|
connections: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
169
178
|
allowed_logout_urls: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
170
179
|
session_transfer: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
171
|
-
oidc_logout: z.ZodOptional<z.ZodDefault<z.
|
|
180
|
+
oidc_logout: z.ZodOptional<z.ZodDefault<z.ZodObject<{
|
|
181
|
+
backchannel_logout_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
|
+
backchannel_logout_initiators: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
custom: "custom";
|
|
185
|
+
all: "all";
|
|
186
|
+
}>>;
|
|
187
|
+
selected_initiators: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
188
|
+
}, z.core.$loose>>;
|
|
189
|
+
}, z.core.$loose>>>;
|
|
172
190
|
grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
173
191
|
jwt_configuration: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
174
192
|
signing_keys: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
|
|
@@ -87,4 +87,6 @@ export declare const openIDConfigurationSchema: z.ZodObject<{
|
|
|
87
87
|
request_object_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
88
|
token_endpoint_auth_signing_alg_values_supported: z.ZodArray<z.ZodString>;
|
|
89
89
|
client_id_metadata_document_supported: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
backchannel_logout_supported: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
backchannel_logout_session_supported: z.ZodOptional<z.ZodBoolean>;
|
|
90
92
|
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base32 (RFC 4648 §6, uppercase alphabet), the canonical implementation
|
|
3
|
+
* for the AuthHero packages. Replaces the `oslo/encoding` dependency we
|
|
4
|
+
* are migrating away from.
|
|
5
|
+
*
|
|
6
|
+
* The primary consumer is TOTP secret handling (RFC 6238 secrets are
|
|
7
|
+
* conventionally shared as unpadded base32). Encoding is padding-free;
|
|
8
|
+
* decoding is lenient and accepts input with or without padding.
|
|
9
|
+
*/
|
|
10
|
+
/** Encode raw bytes as a padding-free base32 string. */
|
|
11
|
+
export declare function encodeBase32(bytes: Uint8Array): string;
|
|
12
|
+
/** Decode a base32 string (with or without padding, case-insensitive)
|
|
13
|
+
* back to raw bytes. Throws on non-canonical input: characters outside
|
|
14
|
+
* the alphabet, impossible unpadded lengths, or non-zero trailing bits —
|
|
15
|
+
* so distinct malformed strings can never normalize to the same bytes. */
|
|
16
|
+
export declare function decodeBase32(input: string): Uint8Array;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard base64 (RFC 4648 §4), the canonical implementation for the
|
|
3
|
+
* AuthHero packages (see base64url.ts for the URL-safe variant). Replaces
|
|
4
|
+
* the `oslo/encoding` dependency we are migrating away from.
|
|
5
|
+
*
|
|
6
|
+
* Encoding emits padding ("=") to match the conventional wire format
|
|
7
|
+
* (PEM bodies, `openssl rand -base64` keys). Decoding is lenient and
|
|
8
|
+
* accepts input with or without padding.
|
|
9
|
+
*/
|
|
10
|
+
/** Encode raw bytes as a padded standard-base64 string. */
|
|
11
|
+
export declare function encodeBase64(bytes: Uint8Array): string;
|
|
12
|
+
/** Decode a standard-base64 string (with or without padding) to raw bytes. */
|
|
13
|
+
export declare function decodeBase64(input: string): Uint8Array;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lowercase hex encoding, the canonical implementation for the AuthHero
|
|
3
|
+
* packages. Replaces the `oslo/encoding` dependency we are migrating
|
|
4
|
+
* away from.
|
|
5
|
+
*/
|
|
6
|
+
/** Encode bytes as a lowercase hex string. Accepts an ArrayBuffer so
|
|
7
|
+
* Web Crypto digest/thumbprint results can be passed directly. */
|
|
8
|
+
export declare function encodeHex(data: Uint8Array | ArrayBuffer): string;
|
|
@@ -3,5 +3,8 @@ export * from "./passthrough";
|
|
|
3
3
|
export * from "./connection-attributes";
|
|
4
4
|
export * from "./guards";
|
|
5
5
|
export * from "./base64url";
|
|
6
|
+
export * from "./base64";
|
|
7
|
+
export * from "./base32";
|
|
8
|
+
export * from "./hex";
|
|
6
9
|
export * from "./cursor";
|
|
7
10
|
export * from "./lucene";
|