@astrale-domains/shell 0.1.5 → 0.1.7
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 +73 -173
- package/dist/domain.d.ts +477 -31
- package/dist/domain.js +87 -78
- package/dist/functions/application/index.js +2 -1
- package/dist/functions/application/legacy/index.js +1 -0
- package/dist/functions/application/legacy/list-entrypoints.js +8 -0
- package/dist/functions/authority/capabilities.js +1 -0
- package/dist/functions/authority/composition.js +47 -0
- package/dist/functions/authority/index.js +2 -0
- package/dist/functions/authority/roles.js +98 -0
- package/dist/functions/directory/disconnect-directory.js +35 -0
- package/dist/functions/directory/index.js +1 -0
- package/dist/functions/group/change-group-membership.js +43 -9
- package/dist/functions/group/create-group.js +23 -0
- package/dist/functions/group/delete-group.js +33 -0
- package/dist/functions/group/deprovision-group.js +27 -0
- package/dist/functions/group/group-errors.js +43 -0
- package/dist/functions/group/group-membership-errors.js +2 -0
- package/dist/functions/group/group.js +51 -0
- package/dist/functions/group/index.js +8 -2
- package/dist/functions/group/legacy/index.js +1 -0
- package/dist/functions/group/legacy/membership.js +60 -0
- package/dist/functions/group/membership-laws.js +40 -0
- package/dist/functions/group/provision-group.js +33 -0
- package/dist/functions/group/update-group.js +55 -0
- package/dist/functions/invitation/index.js +2 -0
- package/dist/functions/invitation/invitation-errors.js +13 -0
- package/dist/functions/invitation/invitation-methods.js +41 -0
- package/dist/functions/invitation/send-invitation.js +81 -0
- package/dist/functions/user/account.js +35 -0
- package/dist/functions/user/create-user.js +45 -0
- package/dist/functions/user/deactivate-user.js +19 -0
- package/dist/functions/user/delete-user.js +34 -0
- package/dist/functions/user/deprovision-user.js +21 -0
- package/dist/functions/user/index.js +15 -1
- package/dist/functions/user/invite-errors.js +18 -0
- package/dist/functions/user/invite-user.js +42 -34
- package/dist/functions/user/legacy/claimed-account.js +11 -0
- package/dist/functions/user/legacy/index.js +4 -0
- package/dist/functions/user/legacy/invite.js +20 -0
- package/dist/functions/user/legacy/migrate-accounts.js +98 -0
- package/dist/functions/user/legacy/record-profile.js +19 -0
- package/dist/functions/user/protect-administrators.js +16 -0
- package/dist/functions/user/provision-user.js +70 -0
- package/dist/functions/user/reactivate-user.js +19 -0
- package/dist/functions/user/read-account.js +12 -0
- package/dist/functions/user/request-invitation.js +17 -0
- package/dist/functions/user/update-profile.js +22 -0
- package/dist/functions/user/update-user.js +68 -0
- package/dist/functions/user/user-errors.js +69 -0
- package/dist/functions/user/write-account.js +57 -0
- package/dist/functions/view-access/index.js +2 -1
- package/dist/functions/view-access/{assign-views.js → legacy/assign-views.js} +11 -7
- package/dist/functions/view-access/legacy/index.js +1 -0
- package/dist/functions/view-access/{view-access-errors.js → legacy/view-access-errors.js} +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/integrations/user-invitation/invite-user-request.d.ts +6 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/release.js +33 -0
- package/dist/mutations/composition/grant-role.js +13 -0
- package/dist/mutations/composition/index.js +1 -0
- package/dist/mutations/group/legacy/index.js +1 -0
- package/dist/mutations/group/legacy/membership-class.js +7 -0
- package/dist/mutations/group/set-group-membership.js +23 -14
- package/dist/mutations/identity/create-profile.js +37 -0
- package/dist/mutations/identity/delete-identity.js +28 -0
- package/dist/mutations/identity/index.js +4 -0
- package/dist/mutations/identity/write-account.js +109 -0
- package/dist/mutations/identity/write-group.js +72 -0
- package/dist/mutations/invitation/index.js +1 -0
- package/dist/mutations/invitation/write-invitation.js +62 -0
- package/dist/mutations/user/legacy/index.js +1 -0
- package/dist/mutations/user/{record-user-profile.js → legacy/record-user-profile.js} +5 -2
- package/dist/providers/admin-enrollment/create-admin-enrollment-provider.js +6 -3
- package/dist/providers/admin-enrollment/legacy/index.js +1 -0
- package/dist/providers/admin-enrollment/legacy/send-without-profile.js +16 -0
- package/dist/queries/application/legacy/index.js +1 -0
- package/dist/queries/application/legacy/read-installed-entrypoints.js +47 -0
- package/dist/queries/composition/index.js +2 -0
- package/dist/queries/composition/read-extensions.js +34 -0
- package/dist/queries/composition/read-role-nodes.js +41 -0
- package/dist/queries/group/index.js +1 -1
- package/dist/queries/group/legacy/index.js +2 -0
- package/dist/queries/group/legacy/read-core-groups.js +46 -0
- package/dist/queries/group/legacy/read-member-of-group.js +24 -0
- package/dist/queries/group/read-group-membership-endpoints.js +11 -0
- package/dist/queries/group/read-group-membership.js +6 -21
- package/dist/queries/identity/index.js +1 -0
- package/dist/queries/identity/read-identities.js +29 -0
- package/dist/queries/invitation/index.js +1 -0
- package/dist/queries/invitation/read-invitation.js +25 -0
- package/dist/queries/profile/index.js +1 -0
- package/dist/queries/profile/read-profile.js +15 -0
- package/dist/queries/role/index.js +1 -0
- package/dist/queries/role/read-role-node.js +13 -0
- package/dist/queries/user/legacy/index.js +1 -0
- package/dist/queries/user/legacy/read-user-profile.js +27 -0
- package/dist/runtime.d.ts +18203 -630
- package/dist/runtime.js +32 -7
- package/dist/schema/index.d.ts +7 -4
- package/dist/schema/index.js +8 -4
- package/dist/schema/legacy/index.js +1 -0
- package/dist/schema/legacy/schema.js +32 -0
- package/dist/schema/modules/application/legacy/entrypoint-entry.js +11 -0
- package/dist/schema/modules/application/legacy/functions/index.js +1 -0
- package/dist/schema/modules/application/legacy/functions/list-entrypoints.js +21 -0
- package/dist/schema/modules/application/legacy/index.js +2 -0
- package/dist/schema/modules/directory/functions/disconnect-directory.d.ts +13 -0
- package/dist/schema/modules/directory/functions/disconnect-directory.js +15 -0
- package/dist/schema/modules/directory/functions/index.d.ts +1 -0
- package/dist/schema/modules/directory/functions/index.js +1 -0
- package/dist/schema/modules/directory/index.d.ts +1 -0
- package/dist/schema/modules/directory/index.js +1 -0
- package/dist/schema/modules/group/classes/group-profile-link.d.ts +34 -0
- package/dist/schema/modules/group/classes/group-profile-link.js +21 -0
- package/dist/schema/modules/group/classes/group-profile.d.ts +15 -0
- package/dist/schema/modules/group/classes/group-profile.js +20 -0
- package/dist/schema/modules/group/classes/group.d.ts +73 -1
- package/dist/schema/modules/group/classes/group.js +28 -7
- package/dist/schema/modules/group/classes/index.d.ts +2 -1
- package/dist/schema/modules/group/classes/index.js +3 -1
- package/dist/schema/modules/group/functions/assign-member.js +17 -0
- package/dist/schema/modules/group/functions/create-group.js +20 -0
- package/dist/schema/modules/group/functions/delete-group.js +12 -0
- package/dist/schema/modules/group/functions/deprovision-group.js +14 -0
- package/dist/schema/modules/group/functions/index.js +7 -2
- package/dist/schema/modules/group/functions/provision-group.js +14 -0
- package/dist/schema/modules/group/functions/unassign-member.js +17 -0
- package/dist/schema/modules/group/functions/update-group.js +20 -0
- package/dist/schema/modules/group/index.d.ts +3 -3
- package/dist/schema/modules/group/index.js +4 -3
- package/dist/schema/modules/group/legacy/admission.d.ts +9 -0
- package/dist/schema/modules/group/legacy/admission.js +9 -0
- package/dist/schema/modules/group/legacy/classes/index.d.ts +1 -0
- package/dist/schema/modules/group/legacy/classes/index.js +1 -0
- package/dist/schema/modules/group/{classes → legacy/classes}/member-of-group.d.ts +10 -1
- package/dist/schema/modules/group/legacy/classes/member-of-group.js +32 -0
- package/dist/schema/modules/group/legacy/core-groups.d.ts +22 -0
- package/dist/schema/modules/group/legacy/core-groups.js +28 -0
- package/dist/schema/modules/group/legacy/index.d.ts +5 -0
- package/dist/schema/modules/group/legacy/index.js +6 -0
- package/dist/schema/modules/group/legacy/policies/belongs-to-group.d.ts +5 -0
- package/dist/schema/modules/group/legacy/policies/belongs-to-group.js +9 -0
- package/dist/schema/modules/group/legacy/policies/index.d.ts +2 -0
- package/dist/schema/modules/group/legacy/policies/index.js +2 -0
- package/dist/schema/modules/group/legacy/policies/owns-membership-group.d.ts +6 -0
- package/dist/schema/modules/group/legacy/policies/owns-membership-group.js +12 -0
- package/dist/schema/modules/group/legacy/relaxations.d.ts +21 -0
- package/dist/schema/modules/group/legacy/relaxations.js +27 -0
- package/dist/schema/modules/group/policies/describes-group-of-subject.d.ts +2 -0
- package/dist/schema/modules/group/policies/describes-group-of-subject.js +7 -0
- package/dist/schema/modules/group/policies/index.d.ts +2 -1
- package/dist/schema/modules/group/policies/index.js +2 -1
- package/dist/schema/modules/group/policies/is-group-profile-source.d.ts +2 -0
- package/dist/schema/modules/group/policies/is-group-profile-source.js +6 -0
- package/dist/schema/modules/group/types/group.js +10 -0
- package/dist/schema/modules/group/types/index.js +1 -0
- package/dist/schema/modules/invitation/classes/index.js +2 -0
- package/dist/schema/modules/invitation/classes/invitation-user.js +17 -0
- package/dist/schema/modules/invitation/classes/invitation.js +30 -0
- package/dist/schema/modules/invitation/functions/accept.js +16 -0
- package/dist/schema/modules/invitation/functions/cancel.js +12 -0
- package/dist/schema/modules/invitation/functions/index.js +4 -0
- package/dist/schema/modules/invitation/functions/resend.js +12 -0
- package/dist/schema/modules/invitation/functions/send.js +20 -0
- package/dist/schema/modules/invitation/index.js +2 -0
- package/dist/schema/modules/invitation/types/index.js +1 -0
- package/dist/schema/modules/invitation/types/invitation-status.js +5 -0
- package/dist/schema/modules/namespace/classes/alias.d.ts +2 -1
- package/dist/schema/modules/namespace/classes/alias.js +11 -2
- package/dist/schema/modules/namespace/functions/link.js +3 -2
- package/dist/schema/modules/namespace/functions/rename.js +3 -2
- package/dist/schema/modules/namespace/functions/unlink.js +3 -2
- package/dist/schema/modules/role/classes/index.d.ts +1 -0
- package/dist/schema/modules/role/classes/index.js +1 -0
- package/dist/schema/modules/role/classes/role.d.ts +16 -0
- package/dist/schema/modules/role/classes/role.js +19 -0
- package/dist/schema/modules/role/core/index.d.ts +1 -0
- package/dist/schema/modules/role/core/index.js +1 -0
- package/dist/schema/modules/role/core/roles.d.ts +37 -0
- package/dist/schema/modules/role/core/roles.js +30 -0
- package/dist/schema/modules/role/index.d.ts +2 -0
- package/dist/schema/modules/role/index.js +2 -0
- package/dist/schema/modules/user/classes/index.d.ts +2 -0
- package/dist/schema/modules/user/classes/index.js +3 -0
- package/dist/schema/modules/user/classes/user-profile-link.d.ts +35 -0
- package/dist/schema/modules/user/classes/user-profile-link.js +22 -0
- package/dist/schema/modules/user/classes/user-profile.d.ts +41 -0
- package/dist/schema/modules/user/classes/user-profile.js +30 -0
- package/dist/schema/modules/user/classes/user.d.ts +133 -8
- package/dist/schema/modules/user/classes/user.js +46 -15
- package/dist/schema/modules/user/functions/create-user.js +21 -0
- package/dist/schema/modules/user/functions/deactivate-user.js +12 -0
- package/dist/schema/modules/user/functions/delete-user.js +12 -0
- package/dist/schema/modules/user/functions/deprovision-user.js +14 -0
- package/dist/schema/modules/user/functions/index.js +8 -1
- package/dist/schema/modules/user/functions/invite-user.js +23 -4
- package/dist/schema/modules/user/functions/provision-user.js +25 -0
- package/dist/schema/modules/user/functions/reactivate-user.js +12 -0
- package/dist/schema/modules/user/functions/update-profile.js +16 -0
- package/dist/schema/modules/user/functions/update-user.js +22 -0
- package/dist/schema/modules/user/index.d.ts +2 -1
- package/dist/schema/modules/user/index.js +2 -1
- package/dist/schema/modules/user/legacy/account-properties.js +24 -0
- package/dist/schema/modules/user/legacy/functions/index.js +2 -0
- package/dist/schema/modules/user/legacy/functions/migrate-accounts.js +23 -0
- package/dist/schema/modules/user/legacy/functions/record-profile.js +18 -0
- package/dist/schema/modules/user/legacy/index.js +5 -0
- package/dist/schema/modules/user/legacy/invite.js +15 -0
- package/dist/schema/modules/user/legacy/relaxations.js +37 -0
- package/dist/schema/modules/user/policies/describes-subject.d.ts +2 -0
- package/dist/schema/modules/user/policies/describes-subject.js +7 -0
- package/dist/schema/modules/user/policies/index.d.ts +2 -0
- package/dist/schema/modules/user/policies/index.js +2 -0
- package/dist/schema/modules/user/policies/is-profile-source.d.ts +2 -0
- package/dist/schema/modules/user/policies/is-profile-source.js +6 -0
- package/dist/schema/modules/user/types/account.d.ts +12 -0
- package/dist/schema/modules/user/types/account.js +12 -0
- package/dist/schema/modules/user/types/index.d.ts +1 -1
- package/dist/schema/modules/user/types/index.js +1 -1
- package/dist/schema/modules/view-access/classes/view-access.d.ts +7 -11
- package/dist/schema/modules/view-access/classes/view-access.js +17 -12
- package/dist/schema/modules/view-access/index.d.ts +1 -2
- package/dist/schema/modules/view-access/index.js +1 -2
- package/dist/schema/modules/view-access/legacy/functions/assign-views.js +22 -0
- package/dist/schema/modules/view-access/legacy/functions/index.js +1 -0
- package/dist/schema/modules/view-access/legacy/index.js +2 -0
- package/dist/schema/modules/view-access/legacy/view-assignment.js +24 -0
- package/dist/schema/modules/view-access/policies/holds-view-access.d.ts +2 -0
- package/dist/schema/modules/view-access/policies/holds-view-access.js +5 -0
- package/dist/schema/modules/view-access/policies/index.d.ts +1 -0
- package/dist/schema/modules/view-access/policies/index.js +1 -0
- package/dist/schema/policies/has-role.d.ts +6 -0
- package/dist/schema/policies/has-role.js +9 -0
- package/dist/schema/policies/index.d.ts +1 -0
- package/dist/schema/policies/index.js +1 -4
- package/dist/schema/policies/legacy/administers-shell-class.js +21 -0
- package/dist/schema/policies/legacy/index.js +4 -0
- package/dist/schema/policies/legacy/is-self.js +9 -0
- package/dist/schema/policies/legacy/owns-class.js +12 -0
- package/dist/schema/policies/legacy/uses-function.js +9 -0
- package/dist/schema/schema.d.ts +1849 -118
- package/dist/schema/schema.js +35 -15
- package/dist/schema/types/attributes.js +15 -0
- package/dist/schema/types/index.js +1 -0
- package/dist/utils/attributes/attributes.js +12 -0
- package/dist/utils/attributes/index.js +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/same-json/index.js +1 -0
- package/dist/utils/same-json/same-json.js +9 -0
- package/package.json +4 -4
- package/dist/functions/application/list-entrypoints.js +0 -6
- package/dist/functions/user/record-profile.js +0 -18
- package/dist/mutations/user/index.js +0 -1
- package/dist/queries/application/index.js +0 -1
- package/dist/queries/application/read-installed-entrypoints.js +0 -28
- package/dist/queries/user/index.js +0 -1
- package/dist/queries/user/read-user-profile.js +0 -9
- package/dist/schema/modules/application/functions/index.d.ts +0 -1
- package/dist/schema/modules/application/functions/index.js +0 -1
- package/dist/schema/modules/application/functions/list-entrypoints.d.ts +0 -15
- package/dist/schema/modules/application/functions/list-entrypoints.js +0 -16
- package/dist/schema/modules/application/index.d.ts +0 -2
- package/dist/schema/modules/application/index.js +0 -2
- package/dist/schema/modules/application/types/entrypoint-entry.d.ts +0 -8
- package/dist/schema/modules/application/types/entrypoint-entry.js +0 -7
- package/dist/schema/modules/application/types/index.d.ts +0 -1
- package/dist/schema/modules/application/types/index.js +0 -1
- package/dist/schema/modules/group/classes/member-of-group.js +0 -12
- package/dist/schema/modules/group/core/administrators-group.d.ts +0 -1
- package/dist/schema/modules/group/core/administrators-group.js +0 -6
- package/dist/schema/modules/group/core/applications-group.d.ts +0 -1
- package/dist/schema/modules/group/core/applications-group.js +0 -6
- package/dist/schema/modules/group/core/index.d.ts +0 -3
- package/dist/schema/modules/group/core/index.js +0 -3
- package/dist/schema/modules/group/core/members-group.d.ts +0 -1
- package/dist/schema/modules/group/core/members-group.js +0 -6
- package/dist/schema/modules/group/functions/assign-member-to-group.js +0 -11
- package/dist/schema/modules/group/functions/unassign-member-from-group.js +0 -11
- package/dist/schema/modules/group/policies/belongs-to-group.d.ts +0 -1
- package/dist/schema/modules/group/policies/belongs-to-group.js +0 -5
- package/dist/schema/modules/user/functions/record-profile.js +0 -14
- package/dist/schema/modules/user/types/user-profile.d.ts +0 -7
- package/dist/schema/modules/user/types/user-profile.js +0 -7
- package/dist/schema/modules/view-access/core/index.d.ts +0 -1
- package/dist/schema/modules/view-access/core/index.js +0 -1
- package/dist/schema/modules/view-access/core/view-only-group.d.ts +0 -5
- package/dist/schema/modules/view-access/core/view-only-group.js +0 -10
- package/dist/schema/modules/view-access/functions/assign-views.d.ts +0 -16
- package/dist/schema/modules/view-access/functions/assign-views.js +0 -17
- package/dist/schema/modules/view-access/functions/index.d.ts +0 -1
- package/dist/schema/modules/view-access/functions/index.js +0 -1
- package/dist/schema/modules/view-access/types/index.js +0 -1
- package/dist/schema/modules/view-access/types/view-assignment.js +0 -16
- package/dist/schema/policies/administers-shell-class.js +0 -11
- package/dist/schema/policies/is-self.js +0 -5
- package/dist/schema/policies/owns-class.js +0 -7
- package/dist/schema/policies/uses-function.js +0 -5
- /package/dist/functions/group/{assign-member-to-group.js → assign-member.js} +0 -0
- /package/dist/functions/group/{unassign-member-from-group.js → unassign-member.js} +0 -0
package/README.md
CHANGED
|
@@ -1,77 +1,80 @@
|
|
|
1
1
|
# Shell Domain
|
|
2
2
|
|
|
3
|
-
Shell owns
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
Shell owns the account of each person (`User`), their groups (`Group`), its Roles (`Role`: the
|
|
4
|
+
profiles `workspace.member` ⊂ `workspace.admin` and the atomic `user.reader`, `user.writer`,
|
|
5
|
+
`group.reader`, `group.writer`, `directory.provisioner`), the Views an account without a profile
|
|
6
|
+
lands on (`view_access`), the instance Namespaces and their aliases, and one application View, its
|
|
7
|
+
entrypoint. All authority comes from Kernel Roles, held directly or through groups by Kernel
|
|
8
|
+
`extends_with`; a directory may provide accounts and groups. The design, its laws and its
|
|
9
|
+
amendments are in [`docs/design/accounts-and-roles.md`](../docs/design/accounts-and-roles.md);
|
|
10
|
+
each law's enforcement and test are in [`docs/accounts/laws.tsv`](../docs/accounts/laws.tsv), each
|
|
11
|
+
scenario's evidence in [`docs/accounts/scenarios.tsv`](../docs/accounts/scenarios.tsv).
|
|
12
|
+
|
|
13
|
+
The model before Roles is kept for its callers under `legacy/` folders, listed in
|
|
14
|
+
[`legacy/LEDGER.md`](./legacy/LEDGER.md) by the method of [`docs/legacy.md`](../docs/legacy.md); it
|
|
15
|
+
is described in [`docs/legacy/shell-domain-before-roles.md`](../docs/legacy/shell-domain-before-roles.md).
|
|
7
16
|
|
|
8
17
|
## Contracts
|
|
9
18
|
|
|
10
|
-
|
|
|
11
|
-
| --- | --- | --- |
|
|
12
|
-
| User.
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
| User
|
|
17
|
-
|
|
|
18
|
-
| User.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
| Method | Called on | Admitted | Input | Output |
|
|
20
|
+
| --- | --- | --- | --- | --- |
|
|
21
|
+
| `User.create` | static | `user.writer` | `{ email, name, givenName?, familyName?, attributes? }` | `{ user, created }` |
|
|
22
|
+
| `User.invite` | static | `user.writer` | `{ user, profile?: 'member' \| 'admin' }` | `{ invitationId, user, state }` |
|
|
23
|
+
| `User.update` | the account | `user.writer` | `{ name?, email?, givenName?, familyName?, icon?, attributes? }` | `{}` |
|
|
24
|
+
| `User.updateProfile` | the account | its holder | `{ name?, icon? }` | `{}` |
|
|
25
|
+
| `User.deactivate`, `User.reactivate`, `User.delete` | the account | `user.writer` | `{}` | `{}` |
|
|
26
|
+
| `User.provision` | static | `directory.provisioner` | `{ directory, externalId, email, name, givenName?, familyName?, active }` | `{ user, created, adopted }` |
|
|
27
|
+
| `User.deprovision` | static | `directory.provisioner` | `{ directory, externalId }` | `{}` |
|
|
28
|
+
| `Group.create` | static | `group.writer` | `{ name, description?, icon?, attributes? }` | `{ group }` |
|
|
29
|
+
| `Group.update`, `Group.delete` | the group | `group.writer` | `{ name?, description?, icon?, attributes? }`, `{}` | `{}` |
|
|
30
|
+
| `Group.assignMember`, `Group.unassignMember` | static | `group.writer`, `directory.provisioner` | `{ member, group }` (`@NodeId` paths) | `{}` |
|
|
31
|
+
| `Group.provision` | static | `directory.provisioner` | `{ directory, externalId, name }` | `{ group, created }` |
|
|
32
|
+
| `Group.deprovision` | static | `directory.provisioner` | `{ directory, externalId }` | `{}` |
|
|
33
|
+
| `disconnectDirectory` | function | `directory.provisioner` | `{ directory }` | `{ users, groups }` |
|
|
34
|
+
|
|
35
|
+
Refusals (`reason.code`, family): `USER_EMAIL_INVALID` (VALIDATION_ERROR); `USER_NOT_FOUND`,
|
|
36
|
+
`GROUP_NOT_FOUND` (NOT_FOUND); `USER_EMAIL_TAKEN`, `USER_DIRECTORY_MANAGED`,
|
|
37
|
+
`USER_ADMINISTRATOR_PROTECTED`, `USER_LAST_ADMINISTRATOR`, `USER_ACTIVE`, `USER_SUSPENDED`,
|
|
38
|
+
`PROFILE_NOT_HELD`, `GROUP_DIRECTORY_MANAGED`, `GROUP_NOT_DIRECTORY_MANAGED`,
|
|
39
|
+
`GROUP_ROLE_PROTECTED` (details `{ role }`), `GROUP_MEMBERSHIP_CYCLE`, `DIRECTORY_CONFLICT`
|
|
40
|
+
(details `{ user }`), `ACCOUNT_CHANGED`, `GROUP_CHANGED` (CONFLICT); the membership
|
|
41
|
+
methods keep `INVALID_GROUP_MEMBERSHIP_REFERENCE`, `GROUP_MEMBERSHIP_ENDPOINTS_UNAVAILABLE`,
|
|
42
|
+
`GROUP_MEMBERSHIP_CONFLICT`, `GROUP_MEMBERSHIP_UNCONFIRMED`, and invite `INVITATION_CONFLICT`,
|
|
43
|
+
`INVITATION_REJECTED`. The SDK has no FORBIDDEN business family: a law that forbids a change for
|
|
44
|
+
the state of an account, a group or its caller answers CONFLICT.
|
|
45
|
+
|
|
46
|
+
User and Group declare no write rule: only their methods write them, with Shell's authority, after
|
|
47
|
+
the laws the Kernel cannot state (U1–U6, G2–G4). A Domain that needs accounts asks `user.writer`
|
|
48
|
+
(and `user.reader`) in its release for itself, `requirements({ roles: [{ role: S.core.nodes['user.writer'], members: [requirements.domain] }] })`,
|
|
49
|
+
links its record to the account by an Edge of its own, and tests its own Roles with its own
|
|
50
|
+
`hasRole` Policy. Every write keeps `frozen` = `suspended` or `directoryActive === false` (U2): the
|
|
51
|
+
Kernel refuses to authenticate a frozen account.
|
|
52
|
+
|
|
53
|
+
## Invitation
|
|
54
|
+
|
|
55
|
+
`User.invite` grants the profile (`extends_with` to `profile.<name>`), then asks Admin to send the
|
|
56
|
+
invitation through Shell's enrollment Integration, which carries `{ user, email, profile, requestId,
|
|
57
|
+
requestedBy }`: the email is the account's own. Its Provider mints an invocation-bound Shell proof
|
|
58
|
+
for its configured HTTPS ingress audience. A returned pending invitation does not prove email
|
|
59
|
+
delivery or completed registration. Admin binds the first sign-in of the verified email to the
|
|
60
|
+
account (U8).
|
|
61
|
+
|
|
62
|
+
## Release
|
|
63
|
+
|
|
64
|
+
`domain.ts` declares Roles and scopes. `workspace.admin` grants every Shell Role and the grantable
|
|
65
|
+
Kernel Roles (R2); the bundle member ⊂ admin and the atomic Roles are release members (AM1);
|
|
66
|
+
member holds Kernel `writer`, admin Kernel `admin`; no profile holds Kernel `reader`, which admin
|
|
67
|
+
grants to whoever only opens its Views (AM10); Shell itself holds
|
|
68
|
+
Kernel `authority.reader`, `graph.reader` and `graph.writer`. Installing it requires an installer
|
|
69
|
+
that grants every Role it binds: Root.
|
|
44
70
|
|
|
45
|
-
|
|
46
|
-
the workspace holds it. Administrators and members hold both listEntrypoints and View.resolve
|
|
47
|
-
directly (a Core Edge cannot author Kernel `extends_with`): an invited person, whom Admin assigns
|
|
48
|
-
to Core member, can open the workspace. The Core `applications` Group carries the same two
|
|
49
|
-
capabilities for Identities outside Members, and `query`: the `/v/<name>` page reads its Path with
|
|
50
|
-
a Query under the visitor's own rights, so read rules still decide what it sees. Share them
|
|
51
|
-
dynamically with
|
|
52
|
-
`Group.assignMember({ member: identity, group: applications })`, which composes the profile through
|
|
53
|
-
`extends_with`; `unassignMember` withdraws it.
|
|
54
|
-
|
|
55
|
-
User extends Kernel.Identity and owns only optional creationKey correlation.
|
|
56
|
-
Concrete business classes may declare their own displayName/email; Shell never reads or writes them.
|
|
57
|
-
Group extends Kernel.Identity, Named and Descriptable. Authentication remains the
|
|
58
|
-
Kernel-owned, write-once iss/sub binding. Invitation email is explicit input, not a User property.
|
|
59
|
-
|
|
60
|
-
| Operation | Schema Policy alternatives, in addition to Kernel admission |
|
|
61
|
-
| --- | --- |
|
|
62
|
-
| invite | Core admin membership AND Shell-owned concrete User class; or ownership of the User's concrete class |
|
|
63
|
-
| assignMember / unassignMember | Core admin membership AND Shell-owned concrete Group class; or ownership of the Group's concrete class |
|
|
71
|
+
## View access
|
|
64
72
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
it does not treat inheritance from Shell as ownership. These are callable restrictions, not an
|
|
71
|
-
isolation boundary against Root/Manager or the existing broad administrator Kernel profile.
|
|
72
|
-
With Kernel Host beta94 or newer, an external caller needs callable authority through its own
|
|
73
|
-
identity composition AND a passing callable Policy. Declare exact foreign methods in the calling
|
|
74
|
-
Domain's requirements; can_use no longer bypasses the Policy. Root and exact owner exceptions remain.
|
|
73
|
+
**A View given to an Identity decides where it lands, never what it reads.** `view_access` runs
|
|
74
|
+
from any Identity — an account, a group, a Role — to one Kernel View; each end detaches with its
|
|
75
|
+
Node. An admin writes it by a Mutation; an admin, or the Edge's audience and its members, read it.
|
|
76
|
+
A visitor's landing is its own Query (`@astrale-os/shell`): `workspace.member` opens the workspace; anyone else, reading
|
|
77
|
+
with Kernel `reader`, the Views it holds.
|
|
75
78
|
|
|
76
79
|
## Namespaces and aliases
|
|
77
80
|
|
|
@@ -111,99 +114,8 @@ sealed refusals:
|
|
|
111
114
|
| `MUTATION_PRECONDITION_FAILED` (the alias Edge exists, is gone, or carries another name) | `TARGET_ALREADY_ALIASED` | `NAME_NOT_FOUND` | `NAME_NOT_FOUND` |
|
|
112
115
|
| `MUTATION_LOCATOR_INVALID` (the target Path reaches no Node, or the target was deleted) | `TARGET_NOT_FOUND` | `NAME_NOT_FOUND` | `NAME_NOT_FOUND` |
|
|
113
116
|
|
|
114
|
-
Every other failure propagates.
|
|
115
|
-
|
|
116
|
-
Namespace, as for Groups.
|
|
117
|
-
|
|
118
|
-
## View access
|
|
119
|
-
|
|
120
|
-
**A View given to an account decides where it lands, never what it reads.** `view_access` runs from
|
|
121
|
-
a User or a Group to one Kernel View. The Core group `view-only` limits its members to the Views
|
|
122
|
-
they hold, directly or through a group they are a direct member of; membership in `view-only` and
|
|
123
|
-
in Core `admin` counts the same way. Everyone else, and every administrator, opens the workspace as
|
|
124
|
-
before. Nothing else changes: the View's own Domain still
|
|
125
|
-
guards every Node it shows, and `View.resolve` and `listEntrypoints` answer as before.
|
|
126
|
-
|
|
127
|
-
| Fact | Who writes it | How |
|
|
128
|
-
| --- | --- | --- |
|
|
129
|
-
| `view_access(holder → View)` | Core admin | `assignViews`, or a Mutation that creates or deletes the Edge. It carries no property. |
|
|
130
|
-
| `member_of_group(user → view-only)` | Core admin | `Group.assignMember` / `Group.unassignMember`. |
|
|
131
|
-
|
|
132
|
-
`view_access` declares `read: true` and `traverse: true`, as `alias` does. Its target is a
|
|
133
|
-
Class Shell does not own, so it detaches when its View is deleted, by a Mutation or by a release
|
|
134
|
-
that removes the View. Clients read a visitor's access with its own Queries
|
|
135
|
-
(`shell.views.access()`): never a read function. A Shell release without `view-only` limits no one.
|
|
136
|
-
|
|
137
|
-
`assignViews` takes, for each identity (a User or a Group, by `@NodeId`), the Views to give
|
|
138
|
-
(`set`) and to withdraw (`unset`), by `@NodeId`. It reads the identities' `view_access` Edges and
|
|
139
|
-
writes only what differs, in one Mutation guarded by that read, with Shell's own authority: a View
|
|
140
|
-
already given or already withdrawn costs nothing, and a concurrent change refuses the whole write
|
|
141
|
-
(`VIEW_ACCESS_CONFLICT`). An identity listed twice gets both lists; one View both given and
|
|
142
|
-
withdrawn is refused. One call changes at most 40 identities and 20 Views per list. Core admin
|
|
143
|
-
holds it, and may share `can_use` on it. It never changes `view-only`: whether an identity opens the workspace stays its
|
|
144
|
-
membership, which `Group.assignMember` changes.
|
|
145
|
-
|
|
146
|
-
To limit an invited person to one View: invite them, assign them to `view-only`, give them the
|
|
147
|
-
View with `assignViews`, and give the View an alias in `views` so `/v/<name>` opens it.
|
|
148
|
-
|
|
149
|
-
## Flows
|
|
150
|
-
|
|
151
|
-
```text
|
|
152
|
-
Domain creates Employee extending User → unregistered, no group
|
|
153
|
-
Direct credential-evidenced Register → same node authenticates, still no group
|
|
154
|
-
User.invite → provider authentication → Admin ingress → WorkOS/login
|
|
155
|
-
→ Admin Register on that same node → member assignment → completed
|
|
156
|
-
Group.assignMember → member_of_group + Kernel.extends_with in one atomic mutation
|
|
157
|
-
Group.unassignMember → remove both edges in one atomic mutation
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
The invitation flow is coordinated by Admin, not by an Employee callback. Shell's Integration
|
|
161
|
-
carries only user/email/requestId/requestedBy. Its Provider mints an invocation-bound Shell
|
|
162
|
-
proof for its configured HTTPS ingress audience; target/sourceProof are not business inputs.
|
|
163
|
-
A returned pending invitation does not prove email delivery or completed registration.
|
|
164
|
-
|
|
165
|
-
`assignMember({ member: A, group: B })` adds A to B. A and its current and future members inherit
|
|
166
|
-
B's authority. Groups can have several parents; Kernel rejects self-membership and cycles in the
|
|
167
|
-
same transaction as both membership edges. The target Group's manager authorizes this delegation;
|
|
168
|
-
the child Group's managers can subsequently change the population that inherits it.
|
|
169
|
-
|
|
170
|
-
`unassignMember` removes only that direct pair. Another membership path can preserve effective
|
|
171
|
-
access. Queries of `member_of_group` continue to return direct facts; Policy evaluation expands
|
|
172
|
-
the caller's identity composition. Shell must be able to traverse both concrete endpoint Classes,
|
|
173
|
-
including a foreign Group used as the member.
|
|
174
|
-
|
|
175
|
-
Membership methods converge both edges, including an observed partial membership.
|
|
176
|
-
After an uncertain mutation response they re-read the pair; an unconfirmed outcome remains
|
|
177
|
-
explicitly unconfirmed. This is not a global repair scan or an exactly-once guarantee.
|
|
178
|
-
|
|
179
|
-
A Team class extending Group can carry a business permission edge to Project. Membership
|
|
180
|
-
composition lets an Employee, as caller, inherit Team's authority; the protected Project Policy is
|
|
181
|
-
still evaluated by Kernel. Removing composition removes that authority path. Installed
|
|
182
|
-
Kernel E2E evidence, not a handler test, qualifies this behavior.
|
|
183
|
-
|
|
184
|
-
## Installation and View
|
|
185
|
-
|
|
186
|
-
The Shell principal requests all Kernel root functions, the required extends_with operations,
|
|
187
|
-
and the declared grant/revoke authority. Core admin receives the full declared Shell profile,
|
|
188
|
-
including invite, recordProfile, assignMember, unassignMember, link, unlink, rename and assignViews
|
|
189
|
-
so humans inheriting admin can call those methods. Core member receives Download, Introspect, Query,
|
|
190
|
-
Mutate, View.resolve, listEntrypoints and recordProfile, not blanket class-read grants. Core applications receives listEntrypoints,
|
|
191
|
-
View.resolve and Query.
|
|
192
|
-
The Domain definition's requirements, including Core Identity capabilities in requirements.core, are owned by domain.ts and materialized by installation,
|
|
193
|
-
never by invitation handlers.
|
|
194
|
-
|
|
195
|
-
The sole application entrypoint uses the Vite React frontend at /, composed with
|
|
196
|
-
`@astrale-os/shell-react` and `@astrale-os/ui`. It administers the instance under the caller's own
|
|
197
|
-
session, in three tabs. **Access** lists users, then groups: whether each opens the whole OS or only its Views (two spelled-out options
|
|
198
|
-
over its `view-only` membership; an administrator always does, a Core group is decided by its role)
|
|
199
|
-
and, through a picker, the installed Views given to it. **Groups** lists the groups and the direct
|
|
200
|
-
members of the chosen one, to add or remove. **Addresses** lists the installed Views and the name
|
|
201
|
-
`/v/<name>` each opens at, to give, rename or remove through `Namespace.link`, `rename` and `unlink`;
|
|
202
|
-
a name the Namespace would refuse, or one another View has, is refused beside the field before it is
|
|
203
|
-
sent. Every change applies at once and comes back with a
|
|
204
|
-
message when the Kernel refuses it. A user shows its recorded display name and email, or its concrete
|
|
205
|
-
class when it recorded none, never a guessed foreign profile. Every read is a Query under the
|
|
206
|
-
caller's rights; the screen proxies no privileged read.
|
|
117
|
+
Every other failure propagates. `workspace.admin` holders call the three methods, and write `alias`
|
|
118
|
+
Edges by their own Mutations too.
|
|
207
119
|
|
|
208
120
|
## Versions
|
|
209
121
|
|
|
@@ -224,7 +136,7 @@ release.
|
|
|
224
136
|
|
|
225
137
|
Each declaration, Query and Mutation has its own semantic file. Layer roots are facades;
|
|
226
138
|
functions own orchestration, integrations/providers own external effects, views/ui own the
|
|
227
|
-
directory surface. Runtime has one default export and binds
|
|
139
|
+
directory surface. Runtime has one default export and binds every handler.
|
|
228
140
|
The Dataset is referenced lazily by the root astrale.config.ts.
|
|
229
141
|
|
|
230
142
|
Domain authors import Schema from @astrale-domains/shell; platform workers use the explicit
|
|
@@ -252,15 +164,3 @@ schema import cannot traverse Shell's private application or runtime implementat
|
|
|
252
164
|
Source, package, and deterministic test qualification remain distinct from installed-instance,
|
|
253
165
|
released-package, browser, and live-credential evidence. Shell does not broker authentication
|
|
254
166
|
tokens; standard Domain token exchange is owned by Protocol, Server, and SDK.
|
|
255
|
-
|
|
256
|
-
### Breaking membership API migration
|
|
257
|
-
|
|
258
|
-
`Group.assignMember` / `Group.unassignMember` replace `assignUser` / `unassignUser` without aliases.
|
|
259
|
-
Callers must change `{ user, group }` to `{ member, group }` and declare the new exact callable
|
|
260
|
-
requirements. The `member_of_group` Class key is preserved; its source role is now `member` and
|
|
261
|
-
accepts User or Group families. Existing User memberships remain valid.
|
|
262
|
-
|
|
263
|
-
Rebuild and install all affected Schema dependents as one coherent revision closure. Admin bootstrap
|
|
264
|
-
and invitation completion must use the new API when this Shell revision is installed. A downgrade
|
|
265
|
-
to the User-only contract requires handling any Group-to-Group facts first. Validate public admission,
|
|
266
|
-
foreign endpoint traversal, and deployed revisions during the coordinated release.
|