@absolutejs/auth 0.37.0 → 0.38.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/index.d.ts +71 -0
- package/dist/index.js +197 -10
- package/dist/index.js.map +8 -7
- package/dist/scim/config.d.ts +2 -0
- package/dist/scim/extensions.d.ts +30 -0
- package/dist/scim/routes.d.ts +71 -1
- package/dist/scim/serialize.d.ts +40 -2
- package/dist/scim/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/scim/config.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { OrganizationId } from '../tenancy';
|
|
2
2
|
import type { RouteString } from '../types';
|
|
3
|
+
import type { ScimAttributeMap } from './extensions';
|
|
3
4
|
import type { ScimFilter, ScimGroup, ScimGroupInput, ScimTokenStore, ScimUser, ScimUserInput } from './types';
|
|
4
5
|
export declare const DEFAULT_SCIM_ROUTE = "/scim/v2";
|
|
5
6
|
export type ScimConfig = {
|
|
7
|
+
customAttributes?: ScimAttributeMap;
|
|
6
8
|
getScimGroup?: (context: {
|
|
7
9
|
id: string;
|
|
8
10
|
organizationId: OrganizationId;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ScimGroupMember } from './types';
|
|
2
|
+
export type ScimAttributeDefinition = {
|
|
3
|
+
caseExact?: boolean;
|
|
4
|
+
description?: string;
|
|
5
|
+
multiValued?: boolean;
|
|
6
|
+
mutability?: 'immutable' | 'readOnly' | 'readWrite' | 'writeOnly';
|
|
7
|
+
name: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
returned?: 'always' | 'default' | 'never' | 'request';
|
|
10
|
+
subAttributes?: ScimAttributeDefinition[];
|
|
11
|
+
type: 'boolean' | 'complex' | 'dateTime' | 'decimal' | 'integer' | 'reference' | 'string';
|
|
12
|
+
uniqueness?: 'global' | 'none' | 'server';
|
|
13
|
+
};
|
|
14
|
+
export type ScimSchemaDefinition = {
|
|
15
|
+
attributes: ScimAttributeDefinition[];
|
|
16
|
+
description?: string;
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
export type ScimAttributeMap = {
|
|
21
|
+
fromScim: (body: Record<string, unknown>) => Record<string, unknown>;
|
|
22
|
+
schemas?: ScimSchemaDefinition[];
|
|
23
|
+
toScim: (custom: Record<string, unknown>) => Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
export declare const defineScimAttributeMap: (map: ScimAttributeMap) => ScimAttributeMap;
|
|
26
|
+
export type ScimGroupMembershipDelta = {
|
|
27
|
+
added: ScimGroupMember[];
|
|
28
|
+
removed: ScimGroupMember[];
|
|
29
|
+
};
|
|
30
|
+
export declare const diffScimGroupMembers: (current: ScimGroupMember[], next: ScimGroupMember[]) => ScimGroupMembershipDelta;
|
package/dist/scim/routes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { type ScimConfig } from './config';
|
|
3
|
-
export declare const scimRoutes: ({ getScimGroup, getScimUser, listScimGroups, listScimUsers, onScimGroupCreate, onScimGroupDelete, onScimGroupReplace, onScimUserCreate, onScimUserDeactivate, onScimUserReplace, scimRoute, scimTokenStore }: ScimConfig) => Elysia<"", {
|
|
3
|
+
export declare const scimRoutes: ({ customAttributes, getScimGroup, getScimUser, listScimGroups, listScimUsers, onScimGroupCreate, onScimGroupDelete, onScimGroupReplace, onScimUserCreate, onScimUserDeactivate, onScimUserReplace, scimRoute, scimTokenStore }: ScimConfig) => Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {};
|
|
6
6
|
derive: {};
|
|
@@ -281,6 +281,76 @@ export declare const scimRoutes: ({ getScimGroup, getScimUser, listScimGroups, l
|
|
|
281
281
|
};
|
|
282
282
|
};
|
|
283
283
|
};
|
|
284
|
+
} & {
|
|
285
|
+
[x: string]: {
|
|
286
|
+
get: {
|
|
287
|
+
body: unknown;
|
|
288
|
+
params: {};
|
|
289
|
+
query: unknown;
|
|
290
|
+
headers: unknown;
|
|
291
|
+
response: {
|
|
292
|
+
200: Response;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
} & {
|
|
297
|
+
[x: string]: {
|
|
298
|
+
get: {
|
|
299
|
+
body: unknown;
|
|
300
|
+
params: {
|
|
301
|
+
id: string;
|
|
302
|
+
};
|
|
303
|
+
query: unknown;
|
|
304
|
+
headers: unknown;
|
|
305
|
+
response: {
|
|
306
|
+
200: Response;
|
|
307
|
+
422: {
|
|
308
|
+
type: "validation";
|
|
309
|
+
on: string;
|
|
310
|
+
summary?: string;
|
|
311
|
+
message?: string;
|
|
312
|
+
found?: unknown;
|
|
313
|
+
property?: string;
|
|
314
|
+
expected?: string;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
} & {
|
|
320
|
+
[x: string]: {
|
|
321
|
+
get: {
|
|
322
|
+
body: unknown;
|
|
323
|
+
params: {};
|
|
324
|
+
query: unknown;
|
|
325
|
+
headers: unknown;
|
|
326
|
+
response: {
|
|
327
|
+
200: Response;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
} & {
|
|
332
|
+
[x: string]: {
|
|
333
|
+
get: {
|
|
334
|
+
body: unknown;
|
|
335
|
+
params: {
|
|
336
|
+
id: string;
|
|
337
|
+
};
|
|
338
|
+
query: unknown;
|
|
339
|
+
headers: unknown;
|
|
340
|
+
response: {
|
|
341
|
+
200: Response;
|
|
342
|
+
422: {
|
|
343
|
+
type: "validation";
|
|
344
|
+
on: string;
|
|
345
|
+
summary?: string;
|
|
346
|
+
message?: string;
|
|
347
|
+
found?: unknown;
|
|
348
|
+
property?: string;
|
|
349
|
+
expected?: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
};
|
|
284
354
|
}, {
|
|
285
355
|
derive: {};
|
|
286
356
|
resolve: {};
|
package/dist/scim/serialize.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { ScimAttributeMap, ScimSchemaDefinition } from './extensions';
|
|
1
2
|
import type { ScimFilter, ScimGroup, ScimGroupInput, ScimUser, ScimUserInput } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare const SCHEMA_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:Schema";
|
|
4
|
+
declare const RESOURCE_TYPE_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:ResourceType";
|
|
5
|
+
export declare const toUserResource: (user: ScimUser, location: string, map?: ScimAttributeMap) => Record<string, unknown>;
|
|
6
|
+
export declare const parseUserInput: (body: unknown, map?: ScimAttributeMap) => ScimUserInput | undefined;
|
|
4
7
|
export declare const applyPatch: (user: ScimUser, body: unknown) => ScimUserInput;
|
|
5
8
|
export declare const listResponse: (resources: Record<string, unknown>[]) => {
|
|
6
9
|
itemsPerPage: number;
|
|
@@ -13,6 +16,13 @@ export declare const parseFilter: (filter: string | undefined) => ScimFilter | u
|
|
|
13
16
|
export declare const scimError: (httpStatus: number, detail: string, scimType?: string) => Response;
|
|
14
17
|
export declare const scimJson: (resource: unknown, httpStatus: number) => Response;
|
|
15
18
|
export declare const serviceProviderConfig: (location: string) => {
|
|
19
|
+
authenticationSchemes: {
|
|
20
|
+
description: string;
|
|
21
|
+
name: string;
|
|
22
|
+
primary: boolean;
|
|
23
|
+
specUri: string;
|
|
24
|
+
type: string;
|
|
25
|
+
}[];
|
|
16
26
|
bulk: {
|
|
17
27
|
maxOperations: number;
|
|
18
28
|
maxPayloadSize: number;
|
|
@@ -40,6 +50,34 @@ export declare const serviceProviderConfig: (location: string) => {
|
|
|
40
50
|
supported: boolean;
|
|
41
51
|
};
|
|
42
52
|
};
|
|
53
|
+
export declare const schemaList: (location: string, extras?: ScimSchemaDefinition[]) => {
|
|
54
|
+
itemsPerPage: number;
|
|
55
|
+
Resources: Record<string, unknown>[];
|
|
56
|
+
schemas: string[];
|
|
57
|
+
startIndex: number;
|
|
58
|
+
totalResults: number;
|
|
59
|
+
};
|
|
60
|
+
export declare const schemaOne: (location: string, id: string, extras?: ScimSchemaDefinition[]) => Record<string, unknown> | undefined;
|
|
61
|
+
export declare const resourceTypeList: (location: string, usersEndpoint: string, groupsEndpoint: string, extras?: ScimSchemaDefinition[]) => {
|
|
62
|
+
itemsPerPage: number;
|
|
63
|
+
Resources: Record<string, unknown>[];
|
|
64
|
+
schemas: string[];
|
|
65
|
+
startIndex: number;
|
|
66
|
+
totalResults: number;
|
|
67
|
+
};
|
|
68
|
+
export declare const resourceTypeOne: (location: string, id: string, usersEndpoint: string, groupsEndpoint: string, extras?: ScimSchemaDefinition[]) => {
|
|
69
|
+
description: string;
|
|
70
|
+
endpoint: string;
|
|
71
|
+
id: string;
|
|
72
|
+
meta: {
|
|
73
|
+
location: string;
|
|
74
|
+
resourceType: string;
|
|
75
|
+
};
|
|
76
|
+
name: string;
|
|
77
|
+
schema: string;
|
|
78
|
+
schemas: string[];
|
|
79
|
+
} | undefined;
|
|
80
|
+
export { RESOURCE_TYPE_SCHEMA, SCHEMA_SCHEMA };
|
|
43
81
|
export declare const applyGroupPatch: (group: ScimGroup, body: unknown) => ScimGroupInput;
|
|
44
82
|
export declare const parseGroupInput: (body: unknown) => ScimGroupInput | undefined;
|
|
45
83
|
export declare const toGroupResource: (group: ScimGroup, location: string) => Record<string, unknown>;
|
package/dist/scim/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type ScimTokenStore = {
|
|
|
14
14
|
};
|
|
15
15
|
export type ScimUser = {
|
|
16
16
|
active: boolean;
|
|
17
|
+
custom?: Record<string, unknown>;
|
|
17
18
|
displayName?: string;
|
|
18
19
|
email?: string;
|
|
19
20
|
externalId?: string;
|
|
@@ -24,6 +25,7 @@ export type ScimUser = {
|
|
|
24
25
|
};
|
|
25
26
|
export type ScimUserInput = {
|
|
26
27
|
active: boolean;
|
|
28
|
+
custom?: Record<string, unknown>;
|
|
27
29
|
displayName?: string;
|
|
28
30
|
email?: string;
|
|
29
31
|
externalId?: string;
|
package/package.json
CHANGED