@enterprisestandard/react 0.0.4 → 0.0.5-beta.20260114.1
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/group-store.d.ts +164 -0
- package/dist/group-store.d.ts.map +1 -0
- package/dist/iam.d.ts +205 -12
- package/dist/iam.d.ts.map +1 -1
- package/dist/index.d.ts +44 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3164 -572
- package/dist/index.js.map +29 -0
- package/dist/server.d.ts +6 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/session-store.d.ts +179 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/sso.d.ts +74 -16
- package/dist/sso.d.ts.map +1 -1
- package/dist/tenant-server.d.ts +8 -0
- package/dist/tenant-server.d.ts.map +1 -0
- package/dist/tenant.d.ts +280 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/types/base-user.d.ts +27 -0
- package/dist/types/base-user.d.ts.map +1 -0
- package/dist/types/enterprise-user.d.ts +158 -0
- package/dist/types/enterprise-user.d.ts.map +1 -0
- package/dist/{oidc-schema.d.ts → types/oidc-schema.d.ts} +42 -0
- package/dist/types/oidc-schema.d.ts.map +1 -0
- package/dist/types/scim-schema.d.ts +419 -0
- package/dist/types/scim-schema.d.ts.map +1 -0
- package/dist/types/standard-schema.d.ts.map +1 -0
- package/dist/types/user.d.ts +41 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/workload-schema.d.ts +106 -0
- package/dist/types/workload-schema.d.ts.map +1 -0
- package/dist/ui/sso-provider.d.ts +3 -3
- package/dist/ui/sso-provider.d.ts.map +1 -1
- package/dist/user-store.d.ts +161 -0
- package/dist/user-store.d.ts.map +1 -0
- package/dist/workload-server.d.ts +126 -0
- package/dist/workload-server.d.ts.map +1 -0
- package/dist/workload-token-store.d.ts +187 -0
- package/dist/workload-token-store.d.ts.map +1 -0
- package/dist/workload.d.ts +227 -0
- package/dist/workload.d.ts.map +1 -0
- package/package.json +2 -5
- package/dist/enterprise-user.d.ts +0 -125
- package/dist/enterprise-user.d.ts.map +0 -1
- package/dist/oidc-schema.d.ts.map +0 -1
- package/dist/standard-schema.d.ts.map +0 -1
- /package/dist/{standard-schema.d.ts → types/standard-schema.d.ts} +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group storage for persisting group data.
|
|
3
|
+
*
|
|
4
|
+
* Group stores are an optional extension for the IAM Groups functionality.
|
|
5
|
+
* They enable:
|
|
6
|
+
* - Caching group data locally for fast lookups
|
|
7
|
+
* - Receiving group provisioning from external IAM providers (SCIM server)
|
|
8
|
+
* - Storing groups close to your application (in-memory, Redis, database)
|
|
9
|
+
*
|
|
10
|
+
* ## Example Usage
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { InMemoryGroupStore } from '@enterprisestandard/react';
|
|
14
|
+
*
|
|
15
|
+
* const groupStore = new InMemoryGroupStore();
|
|
16
|
+
*
|
|
17
|
+
* // Store a group
|
|
18
|
+
* await groupStore.upsert({
|
|
19
|
+
* id: 'group-123',
|
|
20
|
+
* displayName: 'Administrators',
|
|
21
|
+
* createdAt: new Date(),
|
|
22
|
+
* updatedAt: new Date(),
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Look up groups
|
|
26
|
+
* const group = await groupStore.get('group-123');
|
|
27
|
+
* const allGroups = await groupStore.list();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import type { GroupMember } from './types/scim-schema';
|
|
31
|
+
/**
|
|
32
|
+
* Stored group data with required id and tracking metadata.
|
|
33
|
+
*
|
|
34
|
+
* @template TExtended - Type-safe custom data that consumers can add to groups
|
|
35
|
+
*/
|
|
36
|
+
export type StoredGroup<TExtended = {}> = {
|
|
37
|
+
/**
|
|
38
|
+
* Required unique identifier for the group.
|
|
39
|
+
* This is the primary key for group storage.
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* Required human-readable name for the group.
|
|
44
|
+
*/
|
|
45
|
+
displayName: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional external identifier from provisioning client.
|
|
48
|
+
*/
|
|
49
|
+
externalId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* List of members in the group.
|
|
52
|
+
*/
|
|
53
|
+
members?: GroupMember[];
|
|
54
|
+
/**
|
|
55
|
+
* Timestamp when the group was first stored.
|
|
56
|
+
*/
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
/**
|
|
59
|
+
* Timestamp when the group was last updated.
|
|
60
|
+
*/
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
} & TExtended;
|
|
63
|
+
/**
|
|
64
|
+
* Abstract interface for group storage backends.
|
|
65
|
+
*
|
|
66
|
+
* Consumers can implement this interface to use different storage backends:
|
|
67
|
+
* - In-memory (for development/testing)
|
|
68
|
+
* - Redis (for production with fast lookups)
|
|
69
|
+
* - Database (PostgreSQL, MySQL, etc.)
|
|
70
|
+
*
|
|
71
|
+
* @template TExtended - Type-safe custom data that consumers can add to groups
|
|
72
|
+
*/
|
|
73
|
+
export interface GroupStore<TExtended = {}> {
|
|
74
|
+
/**
|
|
75
|
+
* Retrieve a group by its unique identifier.
|
|
76
|
+
*
|
|
77
|
+
* @param id - The group's unique identifier
|
|
78
|
+
* @returns The group if found, null otherwise
|
|
79
|
+
*/
|
|
80
|
+
get(id: string): Promise<StoredGroup<TExtended> | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Retrieve a group by its external identifier.
|
|
83
|
+
*
|
|
84
|
+
* @param externalId - The external identifier from the provisioning client
|
|
85
|
+
* @returns The group if found, null otherwise
|
|
86
|
+
*/
|
|
87
|
+
getByExternalId(externalId: string): Promise<StoredGroup<TExtended> | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve a group by its display name.
|
|
90
|
+
*
|
|
91
|
+
* @param displayName - The group's display name
|
|
92
|
+
* @returns The group if found, null otherwise
|
|
93
|
+
*/
|
|
94
|
+
getByDisplayName(displayName: string): Promise<StoredGroup<TExtended> | null>;
|
|
95
|
+
/**
|
|
96
|
+
* List all groups in the store.
|
|
97
|
+
*
|
|
98
|
+
* @returns Array of all stored groups
|
|
99
|
+
*/
|
|
100
|
+
list(): Promise<StoredGroup<TExtended>[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Create or update a group in the store.
|
|
103
|
+
*
|
|
104
|
+
* If a group with the same `id` exists, it will be updated.
|
|
105
|
+
* Otherwise, a new group will be created.
|
|
106
|
+
*
|
|
107
|
+
* @param group - The group data to store
|
|
108
|
+
*/
|
|
109
|
+
upsert(group: StoredGroup<TExtended>): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Delete a group by its unique identifier.
|
|
112
|
+
*
|
|
113
|
+
* @param id - The group's unique identifier to delete
|
|
114
|
+
*/
|
|
115
|
+
delete(id: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Add a member to a group.
|
|
118
|
+
*
|
|
119
|
+
* @param groupId - The group's unique identifier
|
|
120
|
+
* @param member - The member to add
|
|
121
|
+
*/
|
|
122
|
+
addMember(groupId: string, member: GroupMember): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Remove a member from a group.
|
|
125
|
+
*
|
|
126
|
+
* @param groupId - The group's unique identifier
|
|
127
|
+
* @param memberId - The member's value/id to remove
|
|
128
|
+
*/
|
|
129
|
+
removeMember(groupId: string, memberId: string): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* In-memory group store implementation using Maps.
|
|
133
|
+
*
|
|
134
|
+
* Suitable for:
|
|
135
|
+
* - Development and testing
|
|
136
|
+
* - Single-server deployments
|
|
137
|
+
* - Applications without high availability requirements
|
|
138
|
+
*
|
|
139
|
+
* NOT suitable for:
|
|
140
|
+
* - Multi-server deployments (groups not shared)
|
|
141
|
+
* - High availability scenarios (groups lost on restart)
|
|
142
|
+
* - Production applications with distributed architecture
|
|
143
|
+
*
|
|
144
|
+
* For production, implement GroupStore with Redis or a database.
|
|
145
|
+
*
|
|
146
|
+
* @template TExtended - Type-safe custom data that consumers can add to groups
|
|
147
|
+
*/
|
|
148
|
+
export declare class InMemoryGroupStore<TExtended = {}> implements GroupStore<TExtended> {
|
|
149
|
+
/** Primary storage: id -> group */
|
|
150
|
+
private groups;
|
|
151
|
+
/** Secondary index: externalId -> id */
|
|
152
|
+
private externalIdIndex;
|
|
153
|
+
/** Secondary index: displayName (lowercase) -> id */
|
|
154
|
+
private displayNameIndex;
|
|
155
|
+
get(id: string): Promise<StoredGroup<TExtended> | null>;
|
|
156
|
+
getByExternalId(externalId: string): Promise<StoredGroup<TExtended> | null>;
|
|
157
|
+
getByDisplayName(displayName: string): Promise<StoredGroup<TExtended> | null>;
|
|
158
|
+
list(): Promise<StoredGroup<TExtended>[]>;
|
|
159
|
+
upsert(group: StoredGroup<TExtended>): Promise<void>;
|
|
160
|
+
delete(id: string): Promise<void>;
|
|
161
|
+
addMember(groupId: string, member: GroupMember): Promise<void>;
|
|
162
|
+
removeMember(groupId: string, memberId: string): Promise<void>;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=group-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-store.d.ts","sourceRoot":"","sources":["../src/group-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,SAAS,GAAG,EAAE,IAAI;IACxC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;I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,OAAO,CAAC,gBAAgB,CAA6B;IAE/C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAIvD,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAM3E,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAM7E,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;IAIzC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBpD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB9D,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrE"}
|
package/dist/iam.d.ts
CHANGED
|
@@ -1,13 +1,206 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { GroupStore } from './group-store';
|
|
2
|
+
import type { GroupMember, GroupResource, User } from './types/scim-schema';
|
|
3
|
+
import type { StandardSchemaV1 } from './types/standard-schema';
|
|
4
|
+
import type { UserStore } from './user-store';
|
|
5
|
+
import type { Workload } from './workload';
|
|
6
|
+
/**
|
|
7
|
+
* SCIM Error response structure
|
|
8
|
+
*/
|
|
9
|
+
export interface ScimError {
|
|
10
|
+
schemas: string[];
|
|
11
|
+
status: string;
|
|
12
|
+
scimType?: string;
|
|
13
|
+
detail?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* SCIM List Response for bulk operations
|
|
17
|
+
*/
|
|
18
|
+
export interface ScimListResponse<T> {
|
|
19
|
+
schemas: string[];
|
|
20
|
+
totalResults: number;
|
|
21
|
+
startIndex?: number;
|
|
22
|
+
itemsPerPage?: number;
|
|
23
|
+
Resources: T[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Result of a SCIM operation
|
|
27
|
+
*/
|
|
28
|
+
export interface ScimResult<T> {
|
|
29
|
+
success: boolean;
|
|
30
|
+
data?: T;
|
|
31
|
+
error?: ScimError;
|
|
32
|
+
status: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Handler configuration for IAM
|
|
36
|
+
*/
|
|
37
|
+
export interface IAMHandlerConfig {
|
|
38
|
+
/**
|
|
39
|
+
* Base path for the SCIM Users endpoints (e.g., '/api/iam/Users')
|
|
40
|
+
*/
|
|
41
|
+
usersUrl?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Base path for the SCIM Groups endpoints (e.g., '/api/iam/Groups')
|
|
44
|
+
*/
|
|
45
|
+
groupsUrl?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* IAM configuration
|
|
49
|
+
*
|
|
50
|
+
* - If `url` is provided, groups_outbound is enabled (app calls external IAM)
|
|
51
|
+
* - If `group_store` is provided, groups_inbound is enabled (external IAM calls app)
|
|
52
|
+
* - If `user_store` is provided, users_inbound is enabled (external IAM calls app)
|
|
53
|
+
*/
|
|
54
|
+
export type IAMConfig = {
|
|
55
|
+
/**
|
|
56
|
+
* Base URL of the external SCIM endpoint (e.g., https://sailpoint.example.com/scim/v2)
|
|
57
|
+
* If provided, enables outbound SCIM operations (app -> external IAM)
|
|
58
|
+
*/
|
|
59
|
+
url?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Store for inbound user provisioning from external IAM providers.
|
|
62
|
+
* When configured, the app can receive user CRUD operations via SCIM.
|
|
63
|
+
*/
|
|
64
|
+
user_store?: UserStore;
|
|
65
|
+
/**
|
|
66
|
+
* Store for inbound group provisioning from external IAM providers.
|
|
67
|
+
* When configured, enables groups_inbound (external IAM -> app).
|
|
68
|
+
*/
|
|
69
|
+
group_store?: GroupStore;
|
|
70
|
+
/**
|
|
71
|
+
* Optional handler defaults. These are merged with per-call overrides in
|
|
72
|
+
* `iam.handler`, with per-call values taking precedence.
|
|
73
|
+
*/
|
|
74
|
+
usersUrl?: string;
|
|
75
|
+
groupsUrl?: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Options for creating a group
|
|
79
|
+
*/
|
|
80
|
+
export interface CreateGroupOptions {
|
|
81
|
+
/**
|
|
82
|
+
* External identifier for the group
|
|
83
|
+
*/
|
|
84
|
+
externalId?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Initial members to add to the group
|
|
87
|
+
*/
|
|
88
|
+
members?: GroupMember[];
|
|
89
|
+
/**
|
|
90
|
+
* Custom validation schema for the response
|
|
91
|
+
*/
|
|
92
|
+
validation?: StandardSchemaV1<unknown, GroupResource>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Options for creating a user
|
|
96
|
+
*/
|
|
97
|
+
export interface CreateUserOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Custom validation schema for the response
|
|
100
|
+
*/
|
|
101
|
+
validation?: StandardSchemaV1<unknown, User>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Handler configuration for groups_inbound
|
|
105
|
+
*/
|
|
106
|
+
export interface GroupsInboundHandlerConfig {
|
|
107
|
+
/**
|
|
108
|
+
* Base path for the SCIM Groups endpoints (e.g., '/api/iam/Groups')
|
|
109
|
+
*/
|
|
110
|
+
basePath?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Handler configuration for users_inbound
|
|
114
|
+
*/
|
|
115
|
+
export interface UsersInboundHandlerConfig {
|
|
116
|
+
/**
|
|
117
|
+
* Base path for the SCIM Users endpoints (e.g., '/api/iam/Users')
|
|
118
|
+
*/
|
|
119
|
+
basePath?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Groups Outbound extension - for creating groups in external IAM providers.
|
|
123
|
+
* Enabled when `url` is configured in IAMConfig.
|
|
124
|
+
*/
|
|
125
|
+
export type IAMGroupsOutbound = {
|
|
126
|
+
/**
|
|
127
|
+
* Create a new group in the external IAM provider
|
|
128
|
+
* @param displayName - The display name for the group
|
|
129
|
+
* @param options - Optional configuration for the group creation
|
|
130
|
+
* @returns The created group resource from the provider
|
|
131
|
+
*/
|
|
132
|
+
createGroup: (displayName: string, options?: CreateGroupOptions) => Promise<ScimResult<GroupResource>>;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Groups Inbound extension - for receiving group provisioning from external IAM providers.
|
|
136
|
+
* Enabled when `group_store` is configured in IAMConfig.
|
|
137
|
+
*/
|
|
138
|
+
export type IAMGroupsInbound = {
|
|
139
|
+
/**
|
|
140
|
+
* Handle inbound SCIM requests for group management.
|
|
141
|
+
* Routes: GET/POST /Groups, GET/PUT/PATCH/DELETE /Groups/:id
|
|
142
|
+
*/
|
|
143
|
+
handler: (request: Request, config?: GroupsInboundHandlerConfig) => Promise<Response>;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Users Inbound extension - for receiving user provisioning from external IAM providers.
|
|
147
|
+
* Enabled when `user_store` is configured in IAMConfig.
|
|
148
|
+
*/
|
|
149
|
+
export type IAMUsersInbound = {
|
|
150
|
+
/**
|
|
151
|
+
* Handle inbound SCIM requests for user management.
|
|
152
|
+
* Routes: GET/POST /Users, GET/PUT/PATCH/DELETE /Users/:id
|
|
153
|
+
*/
|
|
154
|
+
handler: (request: Request, config?: UsersInboundHandlerConfig) => Promise<Response>;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Core IAM service interface.
|
|
158
|
+
*
|
|
159
|
+
* - Core functions are user-related (outbound to external IAM)
|
|
160
|
+
* - `groups_outbound` is available when `url` is configured
|
|
161
|
+
* - `groups_inbound` is available when `group_store` is configured
|
|
162
|
+
* - `users_inbound` is available when `user_store` is configured
|
|
163
|
+
*/
|
|
164
|
+
export type IAM = IAMConfig & {
|
|
165
|
+
/**
|
|
166
|
+
* Create a new user/account in the external IAM provider
|
|
167
|
+
* Only available when `url` is configured.
|
|
168
|
+
*/
|
|
169
|
+
createUser?: (user: User, options?: CreateUserOptions) => Promise<ScimResult<User>>;
|
|
170
|
+
/**
|
|
171
|
+
* Get the configured external SCIM base URL
|
|
172
|
+
*/
|
|
173
|
+
getBaseUrl: () => string | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Groups Outbound extension - create groups in external IAM provider.
|
|
176
|
+
* Available when `url` is configured in IAMConfig.
|
|
177
|
+
*/
|
|
178
|
+
groups_outbound?: IAMGroupsOutbound;
|
|
179
|
+
/**
|
|
180
|
+
* Groups Inbound extension - receive group provisioning from external IAM.
|
|
181
|
+
* Available when `group_store` is configured in IAMConfig.
|
|
182
|
+
*/
|
|
183
|
+
groups_inbound?: IAMGroupsInbound;
|
|
184
|
+
/**
|
|
185
|
+
* Users Inbound extension - receive user provisioning from external IAM.
|
|
186
|
+
* Available when `user_store` is configured in IAMConfig.
|
|
187
|
+
*/
|
|
188
|
+
users_inbound?: IAMUsersInbound;
|
|
189
|
+
/**
|
|
190
|
+
* Framework-agnostic request handler for IAM endpoints.
|
|
191
|
+
* Routes to users_inbound or groups_inbound handlers based on the request path.
|
|
192
|
+
*/
|
|
193
|
+
handler: (request: Request, config?: IAMHandlerConfig) => Promise<Response>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Creates an IAM service instance.
|
|
197
|
+
*
|
|
198
|
+
* - If `url` is configured, enables outbound SCIM operations to external IAM
|
|
199
|
+
* - If `group_store` is configured, enables inbound SCIM operations from external IAM
|
|
200
|
+
*
|
|
201
|
+
* @param config - IAM configuration
|
|
202
|
+
* @param workload - Workload instance for authentication
|
|
203
|
+
* @returns IAM service instance
|
|
204
|
+
*/
|
|
205
|
+
export declare function iam(config: IAMConfig, workload: Workload): IAM;
|
|
13
206
|
//# sourceMappingURL=iam.d.ts.map
|
package/dist/iam.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iam.d.ts","sourceRoot":"","sources":["../src/iam.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"iam.d.ts","sourceRoot":"","sources":["../src/iam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,CAAC,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC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AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvF,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CACtF,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,SAAS,GAAG;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAEpF;;OAEG;IACH,UAAU,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAErC;;;OAGG;IACH,eAAe,CAAC,EAAE,iBAAiB,CAAC;IAEpC;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAEhC;;;OAGG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7E,CAAC;AA4EF;;;;;;;;;GASG;AACH,wBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAuqB9D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,57 @@
|
|
|
1
|
-
import { type IAM } from './iam';
|
|
2
|
-
import { type SSO } from './sso';
|
|
1
|
+
import { type IAM, type IAMConfig } from './iam';
|
|
2
|
+
import { type SSO, type SSOConfig, type SSOHandlerConfig } from './sso';
|
|
3
3
|
import { type Vault } from './vault';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
appId: string;
|
|
4
|
+
import { type Workload, type WorkloadConfig } from './workload';
|
|
5
|
+
export type EnterpriseStandard = ESConfig & {
|
|
7
6
|
defaultInstance: boolean;
|
|
8
7
|
vault: Vault;
|
|
9
|
-
sso
|
|
10
|
-
iam
|
|
8
|
+
sso: SSO;
|
|
9
|
+
iam: IAM;
|
|
10
|
+
workload: Workload;
|
|
11
11
|
};
|
|
12
12
|
type ESConfig = {
|
|
13
|
-
ioniteUrl?: string;
|
|
14
13
|
defaultInstance?: boolean;
|
|
14
|
+
sso?: SSOConfig;
|
|
15
|
+
iam?: IAMConfig;
|
|
16
|
+
workload?: WorkloadConfig;
|
|
17
|
+
validation?: {
|
|
18
|
+
sso?: SSOHandlerConfig['validation'];
|
|
19
|
+
workload?: WorkloadConfig['validation'];
|
|
20
|
+
} | SSOHandlerConfig['validation'] | WorkloadConfig['validation'];
|
|
15
21
|
};
|
|
16
|
-
export declare function enterpriseStandard(appId
|
|
17
|
-
export type
|
|
18
|
-
export {
|
|
22
|
+
export declare function enterpriseStandard(appId?: string, initConfig?: ESConfig): Promise<EnterpriseStandard>;
|
|
23
|
+
export type { GroupStore, StoredGroup } from './group-store';
|
|
24
|
+
export { InMemoryGroupStore } from './group-store';
|
|
25
|
+
export type { CreateGroupOptions, CreateUserOptions, GroupsInboundHandlerConfig, IAM, IAMConfig, IAMGroupsInbound, IAMGroupsOutbound, IAMHandlerConfig, IAMUsersInbound, ScimError, ScimListResponse, ScimResult, UsersInboundHandlerConfig, } from './iam';
|
|
26
|
+
export { iam } from './iam';
|
|
19
27
|
export * from './server';
|
|
28
|
+
export type { SessionStore } from './session-store';
|
|
29
|
+
export { InMemorySessionStore } from './session-store';
|
|
30
|
+
export type { SSO, SSOConfig, SSOHandlerConfig } from './sso';
|
|
31
|
+
export { sso } from './sso';
|
|
32
|
+
export type { CreateTenantRequest, CreateTenantResponse, EnvironmentType, StoredTenant, TenantStatus, TenantStore, TenantWebhookPayload, } from './tenant';
|
|
33
|
+
export { InMemoryTenantStore, parseTenantRequest, sendTenantWebhook, serializeESConfig, TenantRequestError, } from './tenant';
|
|
34
|
+
export type { BaseUser } from './types/base-user';
|
|
35
|
+
export type { EnterpriseUser } from './types/enterprise-user';
|
|
36
|
+
export type { IdTokenClaims, OidcCallbackParams, TokenResponse } from './types/oidc-schema';
|
|
37
|
+
export { idTokenClaimsSchema, oidcCallbackSchema, tokenResponseSchema } from './types/oidc-schema';
|
|
38
|
+
export type { Address, Email, EnterpriseExtension, Group, GroupMember, GroupResource, Name, PhoneNumber, Role, User as ScimUser, X509Certificate, } from './types/scim-schema';
|
|
39
|
+
export { groupResourceSchema, userSchema } from './types/scim-schema';
|
|
40
|
+
export type { StandardSchemaV1 } from './types/standard-schema';
|
|
41
|
+
export type { User } from './types/user';
|
|
42
|
+
export type { JWTAssertionClaims, TokenValidationResult, WorkloadTokenResponse, } from './types/workload-schema';
|
|
43
|
+
export { jwtAssertionClaimsSchema, workloadTokenResponseSchema } from './types/workload-schema';
|
|
20
44
|
export { SignInLoading } from './ui/sign-in-loading';
|
|
21
45
|
export { SignedIn } from './ui/signed-in';
|
|
22
46
|
export { SignedOut } from './ui/signed-out';
|
|
23
47
|
export * from './ui/sso-provider';
|
|
48
|
+
export type { StoredUser, UserStore } from './user-store';
|
|
49
|
+
export { InMemoryUserStore } from './user-store';
|
|
50
|
+
export { getDefaultInstance, getES } from './utils';
|
|
51
|
+
export type { Vault } from './vault';
|
|
52
|
+
export { vault } from './vault';
|
|
53
|
+
export type { ClientCredentialsWorkloadConfig, JwtBearerWorkloadConfig, ServerOnlyWorkloadConfig, Workload, WorkloadConfig, WorkloadIdentity, } from './workload';
|
|
54
|
+
export { workload } from './workload';
|
|
55
|
+
export type { CachedWorkloadToken, WorkloadTokenStore } from './workload-token-store';
|
|
56
|
+
export { InMemoryWorkloadTokenStore } from './workload-token-store';
|
|
24
57
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAO,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAO,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAY,MAAM,YAAY,CAAC;AAE1E,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG;IAC1C,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,UAAU,CAAC,EACP;QACE,GAAG,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;KACzC,GACD,gBAAgB,CAAC,YAAY,CAAC,GAC9B,cAAc,CAAC,YAAY,CAAC,CAAC;CAClC,CAAC;AAuCF,wBAAsB,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAA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