@astrale-os/kernel-core 0.9.0-beta.9 → 1.0.0-beta.2
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/auth/authority/accept.js +4 -0
- package/dist/auth/authority/admission/admission.d.ts +4 -1
- package/dist/auth/authority/admission/admission.js +46 -147
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/auth/authority/canonical.d.ts +2 -0
- package/dist/auth/authority/canonical.js +15 -0
- package/dist/auth/authority/index.d.ts +9 -2
- package/dist/auth/authority/index.js +6 -1
- package/dist/auth/authority/language/index.d.ts +3 -1
- package/dist/auth/authority/language/index.js +1 -0
- package/dist/auth/authority/language/predicate.d.ts +31 -16
- package/dist/auth/authority/language/predicate.js +1 -1
- package/dist/auth/authority/language/program.d.ts +21 -0
- package/dist/auth/authority/language/program.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +38 -16
- package/dist/auth/authority/ownership.optimization.d.ts +8 -0
- package/dist/auth/authority/ownership.optimization.js +83 -0
- package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
- package/dist/auth/authority/prepare-binder-body.js +31 -0
- package/dist/auth/authority/program.d.ts +28 -0
- package/dist/auth/authority/program.js +191 -0
- package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
- package/dist/auth/authority/semantics/class-authority.js +26 -0
- package/dist/auth/authority/semantics/composition.d.ts +39 -0
- package/dist/auth/authority/semantics/composition.js +112 -0
- package/dist/auth/authority/semantics/failure.d.ts +21 -0
- package/dist/auth/authority/semantics/failure.js +10 -0
- package/dist/auth/authority/semantics/index.d.ts +11 -0
- package/dist/auth/authority/semantics/index.js +5 -0
- package/dist/auth/authority/semantics/interpret.d.ts +41 -0
- package/dist/auth/authority/semantics/interpret.js +388 -0
- package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
- package/dist/auth/authority/semantics/terms.d.ts +20 -0
- package/dist/auth/authority/semantics/terms.js +96 -0
- package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
- package/dist/auth/context/context.d.ts +4 -3
- package/dist/auth/expression/authoring/builder.d.ts +2 -11
- package/dist/auth/expression/authoring/builder.js +1 -45
- package/dist/auth/expression/authoring/index.d.ts +1 -1
- package/dist/auth/expression/authoring/index.js +1 -1
- package/dist/auth/expression/index.d.ts +1 -2
- package/dist/auth/expression/index.js +1 -2
- package/dist/auth/expression/language/identity-expression.d.ts +2 -22
- package/dist/auth/grant/index.d.ts +1 -1
- package/dist/auth/grant/index.js +1 -1
- package/dist/auth/grant/resolved/admission.d.ts +4 -3
- package/dist/auth/grant/resolved/admission.js +23 -13
- package/dist/auth/grant/resolved/grant.d.ts +1 -1
- package/dist/auth/grant/resolved/index.d.ts +1 -1
- package/dist/auth/grant/resolved/index.js +1 -1
- package/dist/auth/grant/unresolved/admission.d.ts +4 -1
- package/dist/auth/grant/unresolved/admission.js +27 -67
- package/dist/auth/grant/unresolved/limits.d.ts +2 -4
- package/dist/auth/grant/unresolved/limits.js +1 -5
- package/dist/auth/identity/admission.js +11 -3
- package/dist/auth/identity/identity.d.ts +15 -3
- package/dist/auth/identity/index.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +1 -1
- package/dist/auth/jwk/index.d.ts +1 -1
- package/dist/auth/jwk/index.js +1 -1
- package/dist/auth/jwk/thumbprint.d.ts +2 -0
- package/dist/auth/jwk/thumbprint.js +12 -6
- package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
- package/dist/auth/register/fingerprint/fingerprint.js +31 -0
- package/dist/auth/register/fingerprint/index.d.ts +2 -0
- package/dist/auth/register/index.d.ts +5 -0
- package/dist/auth/register/request/admission.d.ts +3 -0
- package/dist/auth/register/request/admission.js +103 -0
- package/dist/auth/register/request/index.d.ts +3 -0
- package/dist/auth/register/request/limits.d.ts +6 -0
- package/dist/auth/register/request/limits.js +6 -0
- package/dist/auth/register/request/request.d.ts +19 -0
- package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
- package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
- package/dist/auth/register/result/index.d.ts +1 -0
- package/dist/auth/register/result/result.d.ts +10 -0
- package/dist/auth/register/result/result.js +1 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +18 -2
- package/dist/callable/index.d.ts +3 -2
- package/dist/callable/index.js +2 -1
- package/dist/callable/invocation/call.d.ts +16 -2
- package/dist/callable/invocation/call.js +41 -1
- package/dist/callable/invocation/index.d.ts +1 -1
- package/dist/callable/invocation/index.js +1 -1
- package/dist/callable/invocation/result.d.ts +2 -2
- package/dist/dns-label.d.ts +1 -2
- package/dist/dns-label.js +2 -3
- package/dist/graph/graph/graph.d.ts +1 -5
- package/dist/graph/graph/graph.js +3 -27
- package/dist/graph/graph/index.d.ts +2 -4
- package/dist/graph/graph/index.js +2 -3
- package/dist/graph/graph/model/codec.js +4 -4
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +58 -78
- package/dist/graph/graph/model/wire.js +18 -19
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/authoring/create.js +13 -5
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/language/wire.d.ts +226 -215
- package/dist/graph/mutate/language/wire.js +42 -47
- package/dist/graph/mutate/result/index.d.ts +4 -3
- package/dist/graph/mutate/result/index.js +8 -6
- package/dist/graph/mutate/result/wire.d.ts +4 -4
- package/dist/graph/mutate/result/wire.js +7 -4
- package/dist/graph/node/identity/id.d.ts +0 -4
- package/dist/graph/node/identity/id.js +0 -5
- package/dist/graph/node/identity/order.js +20 -0
- package/dist/graph/path/authoring/path.d.ts +8 -5
- package/dist/graph/path/authoring/path.js +21 -3
- package/dist/graph/path/language/model.d.ts +8 -3
- package/dist/graph/path/language/syntax.js +23 -8
- package/dist/graph/query/authoring/builder.js +37 -5
- package/dist/graph/query/authoring/model.d.ts +20 -1
- package/dist/graph/query/index.d.ts +4 -2
- package/dist/graph/query/index.js +1 -0
- package/dist/graph/query/language/codec.js +18 -3
- package/dist/graph/query/language/fingerprint.js +8 -0
- package/dist/graph/query/language/model.d.ts +22 -4
- package/dist/graph/query/language/wire.d.ts +124 -114
- package/dist/graph/query/language/wire.js +54 -47
- package/dist/graph/query/order/index.d.ts +53 -0
- package/dist/graph/query/order/index.js +79 -0
- package/dist/graph/query/reference/evaluate.d.ts +1 -0
- package/dist/graph/query/reference/evaluate.js +39 -52
- package/dist/graph/query/result/index.js +1 -1
- package/dist/graph/query/result/wire.d.ts +93 -94
- package/dist/graph/query/result/wire.js +20 -20
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
- package/dist/graph/reconcile/planning/canonical.js +28 -0
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +8 -4
- package/dist/graph/reconcile/planning/plan.js +2 -1
- package/dist/schema/authority/authority-relation.js +3 -0
- package/dist/schema/authority/claims.d.ts +24 -25
- package/dist/schema/authority/claims.js +8 -8
- package/dist/schema/authority/governed-by.d.ts +16 -91
- package/dist/schema/authority/governed-by.js +1 -1
- package/dist/schema/authority/operation-node.d.ts +27 -13
- package/dist/schema/authority/operations.d.ts +8 -168
- package/dist/schema/authority/policy.d.ts +27 -15
- package/dist/schema/authority/vocabulary.d.ts +3 -0
- package/dist/schema/authority/vocabulary.js +25 -0
- package/dist/schema/callables/entrypoint.d.ts +32 -0
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/execution.d.ts +269 -0
- package/dist/schema/callables/execution.js +32 -0
- package/dist/schema/callables/function.d.ts +3400 -55
- package/dist/schema/callables/function.js +4 -3
- package/dist/schema/callables/index.d.ts +2 -1
- package/dist/schema/callables/index.js +2 -1
- package/dist/schema/callables/method-of.d.ts +18 -143
- package/dist/schema/callables/method-of.js +2 -2
- package/dist/schema/callables/view.d.ts +83 -51
- package/dist/schema/definitions/class.d.ts +45 -33
- package/dist/schema/definitions/extends.d.ts +16 -110
- package/dist/schema/definitions/instance-of.d.ts +17 -69
- package/dist/schema/domain/domain.d.ts +3343 -148
- package/dist/schema/domain/domain.js +6 -3
- package/dist/schema/domain/of-domain.d.ts +18 -192
- package/dist/schema/domain/of-domain.js +1 -1
- package/dist/schema/identity/composition.d.ts +5 -0
- package/dist/schema/identity/composition.js +5 -0
- package/dist/schema/identity/identity.d.ts +225 -122
- package/dist/schema/identity/identity.js +3 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/installation/operation-id.d.ts +1 -2
- package/dist/schema/installation/operation-id.js +2 -4
- package/dist/schema/introspection/index.d.ts +1 -1
- package/dist/schema/introspection/language.d.ts +12 -28
- package/dist/schema/kernel/projection/callables.js +2 -3
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/index.d.ts +3 -3
- package/dist/schema/kernel/projection/index.js +2 -2
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
- package/dist/schema/kernel/projection/project.d.ts +4 -2
- package/dist/schema/kernel/projection/project.js +33 -258
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +61 -0
- package/dist/schema/kernel/projection/types.d.ts +28 -2
- package/dist/schema/kernel/schema.d.ts +8737 -5086
- package/dist/schema/kernel/schema.js +12 -8
- package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
- package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
- package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
- package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
- package/dist/schema/kernel/syscalls/contracts/execution.d.ts +60 -0
- package/dist/schema/kernel/syscalls/contracts/execution.js +46 -0
- package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
- package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
- package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
- package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
- package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
- package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
- package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +149 -217
- package/dist/schema/kernel/syscalls/contracts/install.js +22 -26
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +65 -351
- package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
- package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
- package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
- package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
- package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
- package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
- package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
- package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
- package/dist/schema/kernel/syscalls/contracts/query.d.ts +232 -222
- package/dist/schema/kernel/syscalls/contracts/query.js +10 -15
- package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
- package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
- package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +54 -148
- package/dist/schema/kernel/syscalls/contracts/uninstall.js +6 -5
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
- package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
- package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
- package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
- package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
- package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
- package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
- package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
- package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/execution.d.ts +105 -0
- package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +870 -1323
- package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +29 -172
- package/dist/schema/kernel/syscalls/declarations/install.js +7 -5
- package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
- package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
- package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
- package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
- package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
- package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +235 -260
- package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +49 -153
- package/dist/schema/kernel/syscalls/declarations/uninstall.js +4 -2
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
- package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
- package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
- package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
- package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
- package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
- package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
- package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +153 -0
- package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
- package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
- package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
- package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
- package/dist/schema/kernel/syscalls/index.d.ts +2 -2
- package/dist/schema/kernel/syscalls/index.js +2 -2
- package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
- package/dist/schema/kernel/syscalls/references/execution.js +13 -0
- package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
- package/dist/schema/kernel/syscalls/references/functions.js +3 -1
- package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
- package/dist/schema/kernel/syscalls/references/identity.js +1 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/references/index.js +2 -1
- package/dist/schema/meta/created-by.d.ts +32 -0
- package/dist/schema/meta/created-by.js +17 -0
- package/dist/schema/meta/descriptable.d.ts +13 -11
- package/dist/schema/meta/edge.d.ts +5 -9
- package/dist/schema/meta/iconable.d.ts +13 -11
- package/dist/schema/meta/index.d.ts +1 -0
- package/dist/schema/meta/index.js +1 -0
- package/dist/schema/meta/named.d.ts +13 -9
- package/dist/schema/meta/node.d.ts +9 -1
- package/dist/schema/meta/remotable.d.ts +15 -22
- package/dist/schema/meta/statused.d.ts +13 -7
- package/dist/schema/meta/timestamped.d.ts +14 -12
- package/package.json +9 -7
- package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
- package/dist/auth/expression/normalization/canonicalize.js +0 -102
- package/dist/auth/expression/normalization/index.d.ts +0 -2
- package/dist/auth/expression/normalization/index.js +0 -2
- package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
- package/dist/auth/expression/normalization/raise-denials.js +0 -59
- package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
- package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
- package/dist/auth/provision/fingerprint/index.d.ts +0 -2
- package/dist/auth/provision/index.d.ts +0 -5
- package/dist/auth/provision/request/admission.d.ts +0 -3
- package/dist/auth/provision/request/admission.js +0 -125
- package/dist/auth/provision/request/index.d.ts +0 -3
- package/dist/auth/provision/request/request.d.ts +0 -29
- package/dist/auth/provision/result/index.d.ts +0 -1
- package/dist/auth/provision/result/result.d.ts +0 -12
- package/dist/graph/graph/navigation/error.d.ts +0 -12
- package/dist/graph/graph/navigation/error.js +0 -20
- package/dist/graph/graph/navigation/index.d.ts +0 -2
- package/dist/graph/graph/navigation/index.js +0 -1
- package/dist/graph/graph/navigation/model.d.ts +0 -15
- package/dist/schema/callables/view-for.d.ts +0 -296
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/projection/path.d.ts +0 -2
- package/dist/schema/kernel/projection/path.js +0 -140
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
- package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
- package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
- package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
- package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
- package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
- /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
- /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
- /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
- /package/dist/auth/{provision → register}/index.js +0 -0
- /package/dist/auth/{provision → register}/request/index.js +0 -0
- /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
- /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
|
@@ -2,7 +2,6 @@ import type { Attestation } from '../attestation/index.js';
|
|
|
2
2
|
import type { CredentialInput } from '../credential/input/index.js';
|
|
3
3
|
import type { VerifiedCredential } from '../credential/verified/index.js';
|
|
4
4
|
import type { Delegation } from '../delegation/index.js';
|
|
5
|
-
import type { Grant } from '../grant/index.js';
|
|
6
5
|
import type { IdentityId } from '../identity/index.js';
|
|
7
6
|
/** The original credential together with the claims established by verification. */
|
|
8
7
|
export interface CredentialContext {
|
|
@@ -12,15 +11,17 @@ export interface CredentialContext {
|
|
|
12
11
|
/** Verified credential result before every runtime authority value is necessarily resolved. */
|
|
13
12
|
export interface Authenticated {
|
|
14
13
|
readonly credential: CredentialContext;
|
|
15
|
-
readonly
|
|
14
|
+
readonly caller?: IdentityId;
|
|
16
15
|
readonly attestation?: Attestation;
|
|
17
16
|
readonly delegation?: Delegation;
|
|
18
17
|
}
|
|
19
18
|
/** Complete authenticated kernel context. */
|
|
20
19
|
export interface AuthContext {
|
|
21
20
|
readonly credential: CredentialContext;
|
|
21
|
+
/** Authenticated executor: ceiling, installed ownership, Root bypass, and audit. */
|
|
22
22
|
readonly principal: IdentityId;
|
|
23
|
-
|
|
23
|
+
/** The one Identity whose authority the call exercises; equals principal for direct calls. */
|
|
24
|
+
readonly caller: IdentityId;
|
|
24
25
|
/** Earliest expiry of all credential proofs from which this authority was derived. */
|
|
25
26
|
readonly validUntil?: number;
|
|
26
27
|
readonly attestation?: Attestation;
|
|
@@ -6,11 +6,8 @@ export type BuiltExpr = IdentityExpr | UnresolvedIdentityExpr;
|
|
|
6
6
|
export interface ExprBuilder<E extends BuiltExpr = IdentityExpr> {
|
|
7
7
|
build(): E;
|
|
8
8
|
}
|
|
9
|
-
/** Immutable
|
|
9
|
+
/** Immutable handle for one Identity leaf; there is no Identity set algebra. */
|
|
10
10
|
export interface Expr<E extends BuiltExpr = IdentityExpr> extends ExprBuilder<E> {
|
|
11
|
-
union(other: Expr<E>): Expr<E>;
|
|
12
|
-
intersect(other: Expr<E>): Expr<E>;
|
|
13
|
-
exclude(other: Expr<E>): Expr<E>;
|
|
14
11
|
}
|
|
15
12
|
export declare function isExprBuilder(input: unknown): input is ExprBuilder<IdentityExpr> | ExprBuilder<UnresolvedIdentityExpr>;
|
|
16
13
|
/** Build one resolved Identity leaf. */
|
|
@@ -19,11 +16,5 @@ export declare function identity(id: IdentityId): Expr<IdentityExpr>;
|
|
|
19
16
|
export declare function self(): Expr<UnresolvedIdentityExpr>;
|
|
20
17
|
/** Build one unresolved nested-credential leaf. */
|
|
21
18
|
export declare function cred(credential: CredentialInput): Expr<UnresolvedIdentityExpr>;
|
|
22
|
-
/** Re-enter
|
|
19
|
+
/** Re-enter from an already trusted or separately admitted Identity leaf. */
|
|
23
20
|
export declare function raw<E extends BuiltExpr>(expr: E): Expr<E>;
|
|
24
|
-
/** Compose at least two expressions of the same resolved or unresolved phase. */
|
|
25
|
-
export declare function union<E extends BuiltExpr>(first: Expr<E>, second: Expr<NoInfer<E>>, ...rest: Expr<NoInfer<E>>[]): Expr<E>;
|
|
26
|
-
/** Intersect at least two expressions of the same resolved or unresolved phase. */
|
|
27
|
-
export declare function intersect<E extends BuiltExpr>(first: Expr<E>, second: Expr<NoInfer<E>>, ...rest: Expr<NoInfer<E>>[]): Expr<E>;
|
|
28
|
-
/** Exclude one expression from another expression of the same phase. */
|
|
29
|
-
export declare function exclude<E extends BuiltExpr>(base: Expr<E>, excluded: Expr<NoInfer<E>>): Expr<E>;
|
|
@@ -13,27 +13,6 @@ class Expression {
|
|
|
13
13
|
build() {
|
|
14
14
|
return this.value;
|
|
15
15
|
}
|
|
16
|
-
union(other) {
|
|
17
|
-
return compose('union', this, other);
|
|
18
|
-
}
|
|
19
|
-
intersect(other) {
|
|
20
|
-
return compose('intersect', this, other);
|
|
21
|
-
}
|
|
22
|
-
exclude(other) {
|
|
23
|
-
const current = this.value;
|
|
24
|
-
if (current.kind === 'exclude') {
|
|
25
|
-
return expression({
|
|
26
|
-
kind: 'exclude',
|
|
27
|
-
base: current.base,
|
|
28
|
-
excluded: [...current.excluded, other.build()],
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return expression({
|
|
32
|
-
kind: 'exclude',
|
|
33
|
-
base: current,
|
|
34
|
-
excluded: [other.build()],
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
16
|
}
|
|
38
17
|
/** Build one resolved Identity leaf. */
|
|
39
18
|
export function identity(id) {
|
|
@@ -55,33 +34,10 @@ export function cred(credential) {
|
|
|
55
34
|
}
|
|
56
35
|
return expression(Object.freeze({ kind: 'identity', credential: credential.slice() }));
|
|
57
36
|
}
|
|
58
|
-
/** Re-enter
|
|
37
|
+
/** Re-enter from an already trusted or separately admitted Identity leaf. */
|
|
59
38
|
export function raw(expr) {
|
|
60
39
|
return expression(expr);
|
|
61
40
|
}
|
|
62
|
-
/** Compose at least two expressions of the same resolved or unresolved phase. */
|
|
63
|
-
export function union(first, second, ...rest) {
|
|
64
|
-
return compose('union', first, second, ...rest);
|
|
65
|
-
}
|
|
66
|
-
/** Intersect at least two expressions of the same resolved or unresolved phase. */
|
|
67
|
-
export function intersect(first, second, ...rest) {
|
|
68
|
-
return compose('intersect', first, second, ...rest);
|
|
69
|
-
}
|
|
70
|
-
/** Exclude one expression from another expression of the same phase. */
|
|
71
|
-
export function exclude(base, excluded) {
|
|
72
|
-
return base.exclude(excluded);
|
|
73
|
-
}
|
|
74
|
-
function compose(kind, first, second, ...rest) {
|
|
75
|
-
const operands = [];
|
|
76
|
-
for (const builder of [first, second, ...rest]) {
|
|
77
|
-
const value = builder.build();
|
|
78
|
-
if (value.kind === kind)
|
|
79
|
-
operands.push(...value.operands);
|
|
80
|
-
else
|
|
81
|
-
operands.push(value);
|
|
82
|
-
}
|
|
83
|
-
return expression({ kind, operands });
|
|
84
|
-
}
|
|
85
41
|
function expression(value) {
|
|
86
42
|
return Object.freeze(new Expression(value));
|
|
87
43
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { BuiltExpr, Expr, ExprBuilder } from './builder.js';
|
|
2
|
-
export { cred,
|
|
2
|
+
export { cred, identity, isExprBuilder, raw, self } from './builder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cred,
|
|
1
|
+
export { cred, identity, isExprBuilder, raw, self } from './builder.js';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export type { BuiltExpr, Expr, ExprBuilder } from './authoring/index.js';
|
|
2
|
-
export { cred,
|
|
2
|
+
export { cred, identity, isExprBuilder, raw, self } from './authoring/index.js';
|
|
3
3
|
export type { IdentityExpr, SelfIdentityExpr, UnresolvedIdentityExpr } from './language/index.js';
|
|
4
|
-
export { canonicalize, raiseDenials } from './normalization/index.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { cred,
|
|
2
|
-
export { canonicalize, raiseDenials } from './normalization/index.js';
|
|
1
|
+
export { cred, identity, isExprBuilder, raw, self } from './authoring/index.js';
|
|
@@ -5,33 +5,13 @@ export type SelfIdentityExpr = {
|
|
|
5
5
|
readonly kind: 'identity';
|
|
6
6
|
readonly self: true;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
8
|
+
/** The one resolved Identity leaf carried by Kernel bearer and delegation proof claims. */
|
|
9
9
|
export type IdentityExpr = {
|
|
10
10
|
readonly kind: 'identity';
|
|
11
11
|
readonly id: IdentityId;
|
|
12
|
-
} | {
|
|
13
|
-
readonly kind: 'union';
|
|
14
|
-
readonly operands: readonly IdentityExpr[];
|
|
15
|
-
} | {
|
|
16
|
-
readonly kind: 'intersect';
|
|
17
|
-
readonly operands: readonly IdentityExpr[];
|
|
18
|
-
} | {
|
|
19
|
-
readonly kind: 'exclude';
|
|
20
|
-
readonly base: IdentityExpr;
|
|
21
|
-
readonly excluded: readonly IdentityExpr[];
|
|
22
12
|
};
|
|
23
|
-
/** Caller-authored
|
|
13
|
+
/** Caller-authored single leaf accepted only inside a versioned credential claim. */
|
|
24
14
|
export type UnresolvedIdentityExpr = SelfIdentityExpr | {
|
|
25
15
|
readonly kind: 'identity';
|
|
26
16
|
readonly credential: CredentialInput;
|
|
27
|
-
} | {
|
|
28
|
-
readonly kind: 'union';
|
|
29
|
-
readonly operands: readonly UnresolvedIdentityExpr[];
|
|
30
|
-
} | {
|
|
31
|
-
readonly kind: 'intersect';
|
|
32
|
-
readonly operands: readonly UnresolvedIdentityExpr[];
|
|
33
|
-
} | {
|
|
34
|
-
readonly kind: 'exclude';
|
|
35
|
-
readonly base: UnresolvedIdentityExpr;
|
|
36
|
-
readonly excluded: readonly UnresolvedIdentityExpr[];
|
|
37
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { accept,
|
|
1
|
+
export { accept, self } from './resolved/index.js';
|
|
2
2
|
export type { Grant } from './resolved/index.js';
|
|
3
3
|
export { acceptUnresolved, limits } from './unresolved/index.js';
|
|
4
4
|
export type { UnresolvedGrant } from './unresolved/index.js';
|
package/dist/auth/grant/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { accept,
|
|
1
|
+
export { accept, self } from './resolved/index.js';
|
|
2
2
|
export { acceptUnresolved, limits } from './unresolved/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Grant } from './grant.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Admit one exact resolved claim value `{ expr: { kind: 'identity', id } }`. Compound structure
|
|
4
|
+
* keeps the unresolved claim's stable code, AUTH_GRANT_COMPOUND.
|
|
5
|
+
*/
|
|
3
6
|
export declare function accept(input: unknown): Grant;
|
|
4
|
-
/** Re-canonicalize a trusted Grant value. */
|
|
5
|
-
export declare function canonicalize(input: Grant): Grant;
|
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { isNodeId, NodeId } from '../../../graph/node/index.js';
|
|
2
3
|
import { AuthValueError } from '../../error.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
4
|
+
const COMPOUND = new Set(['union', 'intersect', 'exclude']);
|
|
5
|
+
/**
|
|
6
|
+
* Admit one exact resolved claim value `{ expr: { kind: 'identity', id } }`. Compound structure
|
|
7
|
+
* keeps the unresolved claim's stable code, AUTH_GRANT_COMPOUND.
|
|
8
|
+
*/
|
|
5
9
|
export function accept(input) {
|
|
6
10
|
try {
|
|
7
11
|
const value = portable.accept(input);
|
|
8
|
-
|
|
9
|
-
invalid('', 'Expected a Grant object');
|
|
10
|
-
}
|
|
11
|
-
const grant = value;
|
|
12
|
+
const grant = record(value, '', 'Expected a Grant object');
|
|
12
13
|
exact(grant, ['expr'], '');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const expr = record(grant.expr, '/expr', 'Expected one resolved Identity leaf');
|
|
15
|
+
if (typeof expr.kind === 'string' && COMPOUND.has(expr.kind)) {
|
|
16
|
+
throw new AuthValueError('AUTH_GRANT_COMPOUND', 'Resolved Grant must name exactly one Identity', '/expr');
|
|
17
|
+
}
|
|
18
|
+
exact(expr, ['id', 'kind'], '/expr');
|
|
19
|
+
if (expr.kind !== 'identity')
|
|
20
|
+
invalid('/expr/kind', 'Expected one resolved Identity leaf');
|
|
21
|
+
if (typeof expr.id !== 'string' || !isNodeId(expr.id)) {
|
|
22
|
+
invalid('/expr/id', 'Expected one canonical IdentityId');
|
|
23
|
+
}
|
|
24
|
+
return Object.freeze({ expr: Object.freeze({ kind: 'identity', id: NodeId(expr.id) }) });
|
|
16
25
|
}
|
|
17
26
|
catch (cause) {
|
|
18
27
|
if (cause instanceof AuthValueError)
|
|
19
28
|
throw cause;
|
|
20
|
-
throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected a
|
|
29
|
+
throw new AuthValueError('AUTH_GRANT_INVALID', 'Expected a resolved single-Identity Grant', '', {
|
|
21
30
|
cause,
|
|
22
31
|
});
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
function record(value, path, message) {
|
|
35
|
+
if (value === null || Array.isArray(value) || typeof value !== 'object')
|
|
36
|
+
invalid(path, message);
|
|
37
|
+
return value;
|
|
28
38
|
}
|
|
29
39
|
function exact(value, expected, path) {
|
|
30
40
|
const actual = Object.keys(value).sort(compare);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IdentityExpr } from '../../expression/language/index.js';
|
|
2
|
-
/**
|
|
2
|
+
/** The resolved single-identity claim value carried by Kernel bearers and delegation proofs. */
|
|
3
3
|
export interface Grant {
|
|
4
4
|
readonly expr: IdentityExpr;
|
|
5
5
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { accept
|
|
1
|
+
export { accept } from './admission.js';
|
|
2
2
|
export { self } from './self.js';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { UnresolvedGrant } from './grant.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Admit the exact version-1 unresolved Grant claim: exactly one `self` or one credential leaf.
|
|
4
|
+
* Compound structure is refused before any nested credential could be verified.
|
|
5
|
+
*/
|
|
3
6
|
export declare function acceptUnresolved(input: unknown): UnresolvedGrant;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { AuthValueError } from '../../error.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/**
|
|
2
|
+
import { CREDENTIAL_BYTES_LIMIT } from './limits.js';
|
|
3
|
+
const COMPOUND = new Set(['union', 'intersect', 'exclude']);
|
|
4
|
+
/**
|
|
5
|
+
* Admit the exact version-1 unresolved Grant claim: exactly one `self` or one credential leaf.
|
|
6
|
+
* Compound structure is refused before any nested credential could be verified.
|
|
7
|
+
*/
|
|
5
8
|
export function acceptUnresolved(input) {
|
|
6
9
|
try {
|
|
7
10
|
const value = record(input, '');
|
|
8
11
|
exact(value, ['expr', 'v'], '');
|
|
9
12
|
if (data(value, 'v', '/v') !== 1)
|
|
10
13
|
invalid('/v', 'Unsupported unresolved Grant version');
|
|
11
|
-
return Object.freeze({
|
|
12
|
-
v: 1,
|
|
13
|
-
expr: expression(data(value, 'expr', '/expr'), '/expr', 0, 0, new WeakSet()),
|
|
14
|
-
});
|
|
14
|
+
return Object.freeze({ v: 1, expr: leaf(data(value, 'expr', '/expr'), '/expr') });
|
|
15
15
|
}
|
|
16
16
|
catch (cause) {
|
|
17
17
|
if (cause instanceof AuthValueError)
|
|
@@ -21,61 +21,29 @@ export function acceptUnresolved(input) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
if (depth > EXPRESSION_DEPTH_LIMIT)
|
|
26
|
-
invalid(path, 'Identity expression exceeds its depth limit');
|
|
24
|
+
function leaf(input, path) {
|
|
27
25
|
const value = record(input, path);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (hasSelf === hasCredential)
|
|
38
|
-
invalid(path, 'Expected exactly one unresolved Identity leaf');
|
|
39
|
-
if (hasSelf) {
|
|
40
|
-
exact(value, ['kind', 'self'], path);
|
|
41
|
-
if (data(value, 'self', `${path}/self`) !== true)
|
|
42
|
-
invalid(`${path}/self`, 'Expected true');
|
|
43
|
-
return Object.freeze({ kind: 'identity', self: true });
|
|
44
|
-
}
|
|
45
|
-
exact(value, ['credential', 'kind'], path);
|
|
46
|
-
if (credentialDepth >= CREDENTIAL_NESTING_DEPTH_LIMIT) {
|
|
47
|
-
invalid(`${path}/credential`, 'Credential nesting exceeds its limit');
|
|
48
|
-
}
|
|
49
|
-
return Object.freeze({
|
|
50
|
-
kind: 'identity',
|
|
51
|
-
credential: credential(data(value, 'credential', `${path}/credential`), `${path}/credential`),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
case 'union':
|
|
55
|
-
case 'intersect': {
|
|
56
|
-
exact(value, ['kind', 'operands'], path);
|
|
57
|
-
const operands = list(data(value, 'operands', `${path}/operands`), `${path}/operands`, 2);
|
|
58
|
-
return Object.freeze({
|
|
59
|
-
kind,
|
|
60
|
-
operands: Object.freeze(operands.map((operand, index) => expression(operand, `${path}/operands/${index}`, depth + 1, credentialDepth, active))),
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
case 'exclude': {
|
|
64
|
-
exact(value, ['base', 'excluded', 'kind'], path);
|
|
65
|
-
const excluded = list(data(value, 'excluded', `${path}/excluded`), `${path}/excluded`, 1);
|
|
66
|
-
return Object.freeze({
|
|
67
|
-
kind: 'exclude',
|
|
68
|
-
base: expression(data(value, 'base', `${path}/base`), `${path}/base`, depth + 1, credentialDepth, active),
|
|
69
|
-
excluded: Object.freeze(excluded.map((operand, index) => expression(operand, `${path}/excluded/${index}`, depth + 1, credentialDepth, active))),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
default:
|
|
73
|
-
invalid(`${path}/kind`, 'Expected identity, union, intersect, or exclude');
|
|
74
|
-
}
|
|
26
|
+
const kind = data(value, 'kind', `${path}/kind`);
|
|
27
|
+
if (typeof kind === 'string' && COMPOUND.has(kind)) {
|
|
28
|
+
throw new AuthValueError('AUTH_GRANT_COMPOUND', 'Unresolved Grant must name exactly one Identity', path);
|
|
29
|
+
}
|
|
30
|
+
if (kind !== 'identity')
|
|
31
|
+
invalid(`${path}/kind`, 'Expected identity');
|
|
32
|
+
const hasSelf = own(value, 'self');
|
|
33
|
+
if (hasSelf === own(value, 'credential')) {
|
|
34
|
+
invalid(path, 'Expected exactly one unresolved Identity leaf');
|
|
75
35
|
}
|
|
76
|
-
|
|
77
|
-
|
|
36
|
+
if (hasSelf) {
|
|
37
|
+
exact(value, ['kind', 'self'], path);
|
|
38
|
+
if (data(value, 'self', `${path}/self`) !== true)
|
|
39
|
+
invalid(`${path}/self`, 'Expected true');
|
|
40
|
+
return Object.freeze({ kind: 'identity', self: true });
|
|
78
41
|
}
|
|
42
|
+
exact(value, ['credential', 'kind'], path);
|
|
43
|
+
return Object.freeze({
|
|
44
|
+
kind: 'identity',
|
|
45
|
+
credential: credential(data(value, 'credential', `${path}/credential`), `${path}/credential`),
|
|
46
|
+
});
|
|
79
47
|
}
|
|
80
48
|
function credential(input, path) {
|
|
81
49
|
if (typeof input === 'string') {
|
|
@@ -120,14 +88,6 @@ function exact(input, expected, path) {
|
|
|
120
88
|
invalid(path, `Expected exactly ${expected.join(', ')}`);
|
|
121
89
|
}
|
|
122
90
|
}
|
|
123
|
-
function list(input, path, minimum) {
|
|
124
|
-
if (!Array.isArray(input) || input.length < minimum || input.length > EXPRESSION_OPERAND_LIMIT) {
|
|
125
|
-
invalid(path, `Expected ${minimum}-${EXPRESSION_OPERAND_LIMIT} operands`);
|
|
126
|
-
}
|
|
127
|
-
if (Object.keys(input).length !== input.length)
|
|
128
|
-
invalid(path, 'Expected a dense array');
|
|
129
|
-
return input;
|
|
130
|
-
}
|
|
131
91
|
function compare(left, right) {
|
|
132
92
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
133
93
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare const CREDENTIAL_NESTING_DEPTH_LIMIT = 3;
|
|
2
1
|
export declare const CREDENTIAL_BYTES_LIMIT: number;
|
|
3
2
|
export declare const limits: {
|
|
4
|
-
|
|
5
|
-
readonly
|
|
6
|
-
readonly credentialNestingDepth: 3;
|
|
3
|
+
/** One nested Kernel delegation proof; proofs never nest further. */
|
|
4
|
+
readonly credentialNestingDepth: 1;
|
|
7
5
|
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { EXPRESSION_DEPTH_LIMIT, EXPRESSION_OPERAND_LIMIT, } from '../../expression/normalization/index.js';
|
|
2
|
-
export const CREDENTIAL_NESTING_DEPTH_LIMIT = 3;
|
|
3
1
|
export const CREDENTIAL_BYTES_LIMIT = 64 * 1024;
|
|
4
2
|
export const limits = Object.freeze({
|
|
5
|
-
|
|
6
|
-
operandsPerExpression: EXPRESSION_OPERAND_LIMIT,
|
|
7
|
-
credentialNestingDepth: CREDENTIAL_NESTING_DEPTH_LIMIT,
|
|
3
|
+
credentialNestingDepth: 1,
|
|
8
4
|
});
|
|
@@ -7,11 +7,19 @@ import { accept as acceptIssuer } from '../issuer/index.js';
|
|
|
7
7
|
export function accept(input) {
|
|
8
8
|
try {
|
|
9
9
|
const value = object(portable.accept(input), '');
|
|
10
|
-
exact(value, ['frozen', 'id', '
|
|
10
|
+
exact(value, ['frozen', 'id', 'iss', 'requiredClaims', 'sub'], '');
|
|
11
|
+
const hasIssuer = value.iss !== undefined;
|
|
12
|
+
const hasSubject = value.sub !== undefined;
|
|
13
|
+
if (hasIssuer !== hasSubject)
|
|
14
|
+
invalid('', 'Expected both iss and sub or neither');
|
|
11
15
|
return Object.freeze({
|
|
12
16
|
id: NodeId(text(value.id, '/id')),
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
...(hasIssuer
|
|
18
|
+
? {
|
|
19
|
+
iss: acceptIssuer(text(value.iss, '/iss')),
|
|
20
|
+
sub: text(value.sub, '/sub'),
|
|
21
|
+
}
|
|
22
|
+
: {}),
|
|
15
23
|
frozen: value.frozen === undefined ? false : boolean(value.frozen, '/frozen'),
|
|
16
24
|
requiredClaims: constraints(value.requiredClaims, '/requiredClaims'),
|
|
17
25
|
});
|
|
@@ -4,11 +4,23 @@ import type { IssuerId } from '../issuer/index.js';
|
|
|
4
4
|
/** Stable graph identity of one authenticated principal. */
|
|
5
5
|
export type IdentityId = NodeId;
|
|
6
6
|
export type Subject = string;
|
|
7
|
+
/** One complete authentication assertion at an API boundary. */
|
|
8
|
+
export interface Authentication {
|
|
9
|
+
readonly iss: IssuerId;
|
|
10
|
+
readonly sub: Subject;
|
|
11
|
+
}
|
|
7
12
|
/** Normalized Identity value used at authentication boundaries, not a complete graph Node. */
|
|
8
|
-
|
|
13
|
+
interface IdentityBase {
|
|
9
14
|
readonly id: IdentityId;
|
|
10
|
-
readonly issuer: IssuerId;
|
|
11
|
-
readonly subject: Subject;
|
|
12
15
|
readonly frozen: boolean;
|
|
13
16
|
readonly requiredClaims: readonly ClaimConstraint[];
|
|
14
17
|
}
|
|
18
|
+
/** A stable principal with either both protected authentication facts or neither. */
|
|
19
|
+
export type Identity = IdentityBase & ({
|
|
20
|
+
readonly iss?: never;
|
|
21
|
+
readonly sub?: never;
|
|
22
|
+
} | {
|
|
23
|
+
readonly iss: IssuerId;
|
|
24
|
+
readonly sub: Subject;
|
|
25
|
+
});
|
|
26
|
+
export {};
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { AuthValueError } from './error.js';
|
|
2
2
|
export type { Attestation } from './attestation/index.js';
|
|
3
|
-
export type { AuthorityExpr, AuthorityPredicate } from './authority/language/index.js';
|
|
3
|
+
export type { AuthorityExpr, AuthorityPredicate, AuthorityProgram, PredicateRef, ClosedEdgeExtent, } from './authority/language/index.js';
|
|
4
4
|
export type { ClaimConstraint } from './claims/index.js';
|
|
5
5
|
export type { AuthenticationEvidence, AuthenticationMethod, CredentialAudience, CredentialInput, MintedCredential, UnverifiedCredential, VerifiedCredential, } from './credential/index.js';
|
|
6
6
|
export type { AuthContext, Authenticated, CredentialContext } from './context/index.js';
|
|
7
7
|
export type { Delegation, DelegationCredential } from './delegation/index.js';
|
|
8
8
|
export type { IdentityExpr, SelfIdentityExpr, UnresolvedIdentityExpr } from './expression/index.js';
|
|
9
9
|
export type { Grant, UnresolvedGrant } from './grant/index.js';
|
|
10
|
-
export type { Identity, IdentityId, Subject } from './identity/index.js';
|
|
10
|
+
export type { Authentication, Identity, IdentityId, Subject } from './identity/index.js';
|
|
11
11
|
export type { IssuerId } from './issuer/index.js';
|
|
12
12
|
export type { JsonWebKey, KeyId } from './jwk/index.js';
|
|
13
|
-
export type {
|
|
13
|
+
export type { IdentityRegistration, RegisterFingerprint, RegisterFingerprintIdentity, RegisterFingerprintInput, RegisterRequest, RegisterResult, RegisteredIdentity, } from './register/index.js';
|
|
14
14
|
export type { AuthenticationCandidate, AuthenticationTrust, StringPatternSet, TrustDecision, TrustRule, } from './trust/index.js';
|
|
15
15
|
export * as attestation from './attestation/index.js';
|
|
16
16
|
export * as authority from './authority/index.js';
|
|
@@ -22,5 +22,5 @@ export * as grant from './grant/index.js';
|
|
|
22
22
|
export * as identity from './identity/index.js';
|
|
23
23
|
export * as issuer from './issuer/index.js';
|
|
24
24
|
export * as jwk from './jwk/index.js';
|
|
25
|
-
export * as
|
|
25
|
+
export * as register from './register/index.js';
|
|
26
26
|
export * as trust from './trust/index.js';
|
package/dist/auth/index.js
CHANGED
|
@@ -9,5 +9,5 @@ export * as grant from './grant/index.js';
|
|
|
9
9
|
export * as identity from './identity/index.js';
|
|
10
10
|
export * as issuer from './issuer/index.js';
|
|
11
11
|
export * as jwk from './jwk/index.js';
|
|
12
|
-
export * as
|
|
12
|
+
export * as register from './register/index.js';
|
|
13
13
|
export * as trust from './trust/index.js';
|
package/dist/auth/jwk/index.d.ts
CHANGED
package/dist/auth/jwk/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { acceptPublic } from './public-key.js';
|
|
2
|
-
export { thumbprint } from './thumbprint.js';
|
|
2
|
+
export { thumbprint, thumbprintMembers } from './thumbprint.js';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { JsonWebKey } from './public-key.js';
|
|
2
2
|
/** Compute the RFC 7638 SHA-256 thumbprint of an admitted public key. */
|
|
3
3
|
export declare function thumbprint(input: JsonWebKey): Promise<string>;
|
|
4
|
+
/** Return the exact RFC 7638 members that identify one public key's cryptographic material. */
|
|
5
|
+
export declare function thumbprintMembers(input: JsonWebKey): Readonly<Record<string, string>>;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { acceptPublic } from './public-key.js';
|
|
2
2
|
/** Compute the RFC 7638 SHA-256 thumbprint of an admitted public key. */
|
|
3
3
|
export async function thumbprint(input) {
|
|
4
|
-
const
|
|
5
|
-
const canonical = JSON.stringify(members(key));
|
|
4
|
+
const canonical = JSON.stringify(thumbprintMembers(input));
|
|
6
5
|
const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(canonical)));
|
|
7
6
|
return base64url(digest);
|
|
8
7
|
}
|
|
9
|
-
|
|
8
|
+
/** Return the exact RFC 7638 members that identify one public key's cryptographic material. */
|
|
9
|
+
export function thumbprintMembers(input) {
|
|
10
|
+
const key = acceptPublic(input);
|
|
10
11
|
if (key.kty === 'EC') {
|
|
11
|
-
return {
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
crv: key.crv,
|
|
14
|
+
kty: key.kty,
|
|
15
|
+
x: key.x,
|
|
16
|
+
y: key.y,
|
|
17
|
+
});
|
|
12
18
|
}
|
|
13
19
|
if (key.kty === 'RSA') {
|
|
14
|
-
return { e: key.e, kty: key.kty, n: key.n };
|
|
20
|
+
return Object.freeze({ e: key.e, kty: key.kty, n: key.n });
|
|
15
21
|
}
|
|
16
|
-
return { crv: key.crv, kty: key.kty, x: key.x };
|
|
22
|
+
return Object.freeze({ crv: key.crv, kty: key.kty, x: key.x });
|
|
17
23
|
}
|
|
18
24
|
function base64url(input) {
|
|
19
25
|
let binary = '';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Authentication, IdentityId } from '../../identity/index.js';
|
|
2
|
+
import type { JsonWebKey } from '../../jwk/index.js';
|
|
3
|
+
declare const REGISTER_FINGERPRINT: unique symbol;
|
|
4
|
+
/** Digest of the semantic request. Credential bytes and verifier evidence are excluded. */
|
|
5
|
+
export type RegisterFingerprint = `sha256:${string}` & {
|
|
6
|
+
readonly [REGISTER_FINGERPRINT]: true;
|
|
7
|
+
};
|
|
8
|
+
export type RegisterFingerprintIdentity = {
|
|
9
|
+
readonly id: IdentityId;
|
|
10
|
+
readonly mode: 'external';
|
|
11
|
+
readonly authentication: Authentication;
|
|
12
|
+
readonly publicKey?: never;
|
|
13
|
+
} | {
|
|
14
|
+
readonly id: IdentityId;
|
|
15
|
+
readonly mode: 'self';
|
|
16
|
+
readonly authentication: Authentication;
|
|
17
|
+
readonly publicKey: JsonWebKey;
|
|
18
|
+
};
|
|
19
|
+
export interface RegisterFingerprintInput {
|
|
20
|
+
readonly idempotencyKey: string;
|
|
21
|
+
readonly identities: readonly [RegisterFingerprintIdentity, ...RegisterFingerprintIdentity[]];
|
|
22
|
+
}
|
|
23
|
+
/** Compute a deterministic post-verification digest without retaining credential evidence. */
|
|
24
|
+
export declare function fingerprint(input: RegisterFingerprintInput): Promise<RegisterFingerprint>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
+
import { thumbprint as jwkThumbprint } from '../../jwk/index.js';
|
|
3
|
+
/** Compute a deterministic post-verification digest without retaining credential evidence. */
|
|
4
|
+
export async function fingerprint(input) {
|
|
5
|
+
const identities = await Promise.all([...input.identities]
|
|
6
|
+
.sort((left, right) => compare(left.id, right.id))
|
|
7
|
+
.map(async (identity) => ({
|
|
8
|
+
id: identity.id,
|
|
9
|
+
mode: identity.mode,
|
|
10
|
+
iss: identity.authentication.iss,
|
|
11
|
+
sub: identity.authentication.sub,
|
|
12
|
+
...(identity.mode === 'self' ? { publication: await publication(identity.publicKey) } : {}),
|
|
13
|
+
})));
|
|
14
|
+
const encoded = portable.json.encode(portable.accept({ version: 2, idempotencyKey: input.idempotencyKey, identities }));
|
|
15
|
+
const digest = await crypto.subtle.digest('SHA-256', Uint8Array.from(encoded).buffer);
|
|
16
|
+
return `sha256:${hex(new Uint8Array(digest))}`;
|
|
17
|
+
}
|
|
18
|
+
async function publication(publicKey) {
|
|
19
|
+
const thumbprint = await jwkThumbprint(publicKey);
|
|
20
|
+
return Object.freeze({
|
|
21
|
+
key: publicKey,
|
|
22
|
+
thumbprint,
|
|
23
|
+
slot: publicKey.kid === undefined ? `thumbprint:${thumbprint}` : `kid:${publicKey.kid}`,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function hex(input) {
|
|
27
|
+
return [...input].map((value) => value.toString(16).padStart(2, '0')).join('');
|
|
28
|
+
}
|
|
29
|
+
function compare(left, right) {
|
|
30
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
31
|
+
}
|