@owlmeans/iam 0.1.18-rc.8 → 0.1.18
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/README.md +185 -15
- package/agent-meta/manifest.json +92 -4
- package/agent-meta/skills/iam/SKILL.md +91 -177
- package/agent-meta/skills/iam/parts/clients.md +93 -0
- package/agent-meta/skills/iam/parts/permissions.md +106 -0
- package/agent-meta/skills/iam/parts/service.md +115 -0
- package/agent-meta/skills/iam/parts/tenancy.md +72 -0
- package/build/consts.d.ts +170 -1
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +221 -0
- package/build/consts.js.map +1 -1
- package/build/consts.local.d.ts +58 -0
- package/build/consts.local.d.ts.map +1 -0
- package/build/consts.local.js +21 -0
- package/build/consts.local.js.map +1 -0
- package/build/errors.d.ts +26 -0
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +38 -0
- package/build/errors.js.map +1 -1
- package/build/facet.d.ts +10 -0
- package/build/facet.d.ts.map +1 -0
- package/build/facet.js +16 -0
- package/build/facet.js.map +1 -0
- package/build/gate/consts.local.d.ts +2 -0
- package/build/gate/consts.local.d.ts.map +1 -0
- package/build/gate/consts.local.js +3 -0
- package/build/gate/consts.local.js.map +1 -0
- package/build/gate/index.d.ts +4 -0
- package/build/gate/index.d.ts.map +1 -0
- package/build/gate/index.js +4 -0
- package/build/gate/index.js.map +1 -0
- package/build/gate/param.d.ts +6 -0
- package/build/gate/param.d.ts.map +1 -0
- package/build/gate/param.js +83 -0
- package/build/gate/param.js.map +1 -0
- package/build/gate/resolve.d.ts +10 -0
- package/build/gate/resolve.d.ts.map +1 -0
- package/build/gate/resolve.js +93 -0
- package/build/gate/resolve.js.map +1 -0
- package/build/gate/types.d.ts +109 -0
- package/build/gate/types.d.ts.map +1 -0
- package/build/gate/types.js +2 -0
- package/build/gate/types.js.map +1 -0
- package/build/gate/types.local.d.ts +5 -0
- package/build/gate/types.local.d.ts.map +1 -0
- package/build/gate/types.local.js +2 -0
- package/build/gate/types.local.js.map +1 -0
- package/build/gate/validate.d.ts +4 -0
- package/build/gate/validate.d.ts.map +1 -0
- package/build/gate/validate.js +100 -0
- package/build/gate/validate.js.map +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +5 -0
- package/build/index.js.map +1 -1
- package/build/permission/types.d.ts +35 -0
- package/build/permission/types.d.ts.map +1 -0
- package/build/permission/types.js +2 -0
- package/build/permission/types.js.map +1 -0
- package/build/permission.d.ts +8 -0
- package/build/permission.d.ts.map +1 -0
- package/build/permission.js +34 -0
- package/build/permission.js.map +1 -0
- package/build/runtime/types.d.ts +90 -0
- package/build/runtime/types.d.ts.map +1 -0
- package/build/runtime/types.js +2 -0
- package/build/runtime/types.js.map +1 -0
- package/build/runtime.d.ts +75 -0
- package/build/runtime.d.ts.map +1 -0
- package/build/runtime.js +75 -0
- package/build/runtime.js.map +1 -0
- package/build/schemas.d.ts +13 -0
- package/build/schemas.d.ts.map +1 -0
- package/build/schemas.js +108 -0
- package/build/schemas.js.map +1 -0
- package/build/types.d.ts +429 -30
- package/build/types.d.ts.map +1 -1
- package/build/utils/types.d.ts +12 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/types.js +2 -0
- package/build/utils/types.js.map +1 -0
- package/build/utils.d.ts +7 -6
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +10 -1
- package/build/utils.js.map +1 -1
- package/package.json +12 -7
- package/src/consts.local.ts +26 -0
- package/src/consts.ts +241 -1
- package/src/errors.ts +44 -0
- package/src/facet.ts +17 -0
- package/src/gate/consts.local.ts +3 -0
- package/src/gate/index.ts +3 -0
- package/src/gate/param.ts +108 -0
- package/src/gate/resolve.ts +114 -0
- package/src/gate/types.local.ts +4 -0
- package/src/gate/types.ts +117 -0
- package/src/gate/validate.ts +123 -0
- package/src/index.ts +9 -0
- package/src/permission/types.ts +33 -0
- package/src/permission.ts +48 -0
- package/src/runtime/types.ts +107 -0
- package/src/runtime.ts +142 -0
- package/src/schemas.ts +122 -0
- package/src/types.ts +492 -31
- package/src/utils/types.ts +11 -0
- package/src/utils.ts +12 -7
- package/tests/gate-param.spec.ts +233 -0
- package/tests/runtime.spec.ts +101 -0
- package/tests/tsconfig.json +12 -0
- package/tests/utils.spec.ts +47 -1
package/src/schemas.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { EntitySlugValueSchema, GroupValueSchema } from '@owlmeans/auth'
|
|
2
|
+
import type { JSONSchemaType } from 'ajv'
|
|
3
|
+
import { IamDefaultClass, IamGrantMode, IamGrantOrigin } from './consts.js'
|
|
4
|
+
import { EmailSchema, PermissionNameSchema, ProfileIdSchema, ResourcesSchema, TitleSchema } from './consts.local.js'
|
|
5
|
+
import type { IamRuntimeGrant, IamRuntimeGrantList, IamRuntimeGrantRequest, IamRuntimeMember, IamRuntimeMemberList, IamRuntimeMemberUpdate, IamRuntimeOrganization, IamRuntimeOrganizationList, IamRuntimePermission, IamRuntimePermissionList } from './runtime/types.js'
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------------------------
|
|
8
|
+
// Wire shapes. Organizations travel by `entitySlug` only; a subject is the CALLING client's
|
|
9
|
+
// pairwise `profileId`. Neither an organization id nor an account id ever appears here.
|
|
10
|
+
// ---------------------------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------------------------
|
|
13
|
+
// Schemas — closed throughout: the server's AJV strips an undeclared key silently, so a field a
|
|
14
|
+
// caller sends and the schema omits would vanish without an error.
|
|
15
|
+
// ---------------------------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
const GroupsSchema = { type: 'array', items: { ...GroupValueSchema }, maxItems: 64 } as const
|
|
18
|
+
|
|
19
|
+
export const IamRuntimeOrganizationSchema: JSONSchemaType<IamRuntimeOrganization> = {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
entitySlug: { ...EntitySlugValueSchema },
|
|
23
|
+
title: { ...TitleSchema, nullable: true },
|
|
24
|
+
owner: { type: 'boolean' },
|
|
25
|
+
groups: { ...GroupsSchema, nullable: true },
|
|
26
|
+
home: { type: 'boolean', nullable: true },
|
|
27
|
+
},
|
|
28
|
+
required: ['entitySlug', 'owner'],
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const IamRuntimeOrganizationListSchema: JSONSchemaType<IamRuntimeOrganizationList> = {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: { items: { type: 'array', items: IamRuntimeOrganizationSchema } },
|
|
35
|
+
required: ['items'],
|
|
36
|
+
additionalProperties: false,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const IamRuntimeMemberSchema: JSONSchemaType<IamRuntimeMember> = {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
profileId: { ...ProfileIdSchema },
|
|
43
|
+
email: { ...EmailSchema, nullable: true },
|
|
44
|
+
name: { ...TitleSchema, nullable: true },
|
|
45
|
+
owner: { type: 'boolean' },
|
|
46
|
+
groups: { ...GroupsSchema },
|
|
47
|
+
managed: { type: 'boolean', nullable: true },
|
|
48
|
+
},
|
|
49
|
+
required: ['profileId', 'owner', 'groups'],
|
|
50
|
+
additionalProperties: false,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const IamRuntimeMemberListSchema: JSONSchemaType<IamRuntimeMemberList> = {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: { items: { type: 'array', items: IamRuntimeMemberSchema } },
|
|
56
|
+
required: ['items'],
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const IamRuntimeMemberUpdateSchema: JSONSchemaType<IamRuntimeMemberUpdate> = {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
owner: { type: 'boolean', nullable: true },
|
|
64
|
+
groups: { ...GroupsSchema, nullable: true },
|
|
65
|
+
},
|
|
66
|
+
required: [],
|
|
67
|
+
additionalProperties: false,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const IamRuntimePermissionSchema: JSONSchemaType<IamRuntimePermission> = {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
name: { ...PermissionNameSchema },
|
|
74
|
+
title: { ...TitleSchema, nullable: true },
|
|
75
|
+
area: { type: 'string', minLength: 1, maxLength: 64, nullable: true },
|
|
76
|
+
resourceScoped: { type: 'boolean', nullable: true },
|
|
77
|
+
managed: { type: 'boolean', nullable: true },
|
|
78
|
+
defaultClass: { type: 'string', enum: Object.values(IamDefaultClass), nullable: true },
|
|
79
|
+
},
|
|
80
|
+
required: ['name'],
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const IamRuntimePermissionListSchema: JSONSchemaType<IamRuntimePermissionList> = {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: { items: { type: 'array', items: IamRuntimePermissionSchema } },
|
|
87
|
+
required: ['items'],
|
|
88
|
+
additionalProperties: false,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const IamRuntimeGrantSchema: JSONSchemaType<IamRuntimeGrant> = {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
profileId: { ...ProfileIdSchema },
|
|
95
|
+
permission: { ...PermissionNameSchema },
|
|
96
|
+
resources: { ...ResourcesSchema },
|
|
97
|
+
mode: { type: 'string', enum: Object.values(IamGrantMode), nullable: true },
|
|
98
|
+
origin: { type: 'string', enum: Object.values(IamGrantOrigin), nullable: true },
|
|
99
|
+
through: { ...GroupValueSchema, nullable: true },
|
|
100
|
+
},
|
|
101
|
+
required: ['profileId', 'permission'],
|
|
102
|
+
additionalProperties: false,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const IamRuntimeGrantListSchema: JSONSchemaType<IamRuntimeGrantList> = {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: { items: { type: 'array', items: IamRuntimeGrantSchema } },
|
|
108
|
+
required: ['items'],
|
|
109
|
+
additionalProperties: false,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const IamRuntimeGrantRequestSchema: JSONSchemaType<IamRuntimeGrantRequest> = {
|
|
113
|
+
type: 'object',
|
|
114
|
+
properties: {
|
|
115
|
+
profileId: { ...ProfileIdSchema },
|
|
116
|
+
permission: { ...PermissionNameSchema },
|
|
117
|
+
resources: { ...ResourcesSchema },
|
|
118
|
+
mode: { type: 'string', enum: Object.values(IamGrantMode), nullable: true },
|
|
119
|
+
},
|
|
120
|
+
required: ['profileId', 'permission'],
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
}
|