2021-05-27 08:36:35 +00:00
|
|
|
version 1 .
|
2021-07-22 12:12:53 +00:00
|
|
|
embeddedType EntityRef.Cap .
|
2021-05-27 08:36:35 +00:00
|
|
|
|
2023-02-08 13:33:48 +00:00
|
|
|
; `step` and `description` for use with `gatekeeper.Resolve` and `gatekeeper.Bind` etc.
|
|
|
|
SturdyStep = SturdyRef .
|
|
|
|
SturdyService = <ref @oid any @key bytes> .
|
|
|
|
|
2023-02-06 09:45:41 +00:00
|
|
|
; The sequence of Caveats is run RIGHT-TO-LEFT.
|
2021-05-27 08:36:35 +00:00
|
|
|
; That is, the newest Caveats are at the right.
|
2023-02-06 15:19:03 +00:00
|
|
|
;
|
2023-02-07 11:44:47 +00:00
|
|
|
; Let f(k,d) = HMAC-BLAKE2s-256(k,d)[0..16),
|
|
|
|
; e = canonical machine-oriented serialization of some preserves value, and
|
|
|
|
; k = the original secret key for the ref.
|
2023-02-06 15:19:03 +00:00
|
|
|
;
|
2023-02-07 12:11:14 +00:00
|
|
|
; The `sig` is then f(f(f(f(k, e(oid)), ...), e(Caveat)), ...).
|
2023-02-06 15:19:03 +00:00
|
|
|
;
|
2023-02-06 09:45:41 +00:00
|
|
|
SturdyRef = <ref @oid any @caveatChain [Caveat ...] @sig bytes>.
|
2021-05-27 08:36:35 +00:00
|
|
|
|
|
|
|
; embodies 1st-party caveats over assertion structure, but nothing else
|
|
|
|
; can add 3rd-party caveats and richer predicates later
|
2023-02-07 12:18:18 +00:00
|
|
|
Caveat = Rewrite / Alts / Reject / @unknown any .
|
2023-02-06 10:06:02 +00:00
|
|
|
Rewrite = <rewrite @pattern Pattern @template Template> .
|
|
|
|
Reject = <reject @pattern Pattern> .
|
2021-05-27 08:36:35 +00:00
|
|
|
Alts = <or @alternatives [Rewrite ...]>.
|
|
|
|
|
|
|
|
Oid = int .
|
|
|
|
WireRef = @mine [0 @oid Oid] / @yours [1 @oid Oid @attenuation Caveat ...].
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Lit = <lit @value any>.
|
|
|
|
|
|
|
|
Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
|
|
|
|
PDiscard = <_>.
|
|
|
|
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
|
|
|
|
PEmbedded = =Embedded .
|
2021-07-12 19:10:19 +00:00
|
|
|
PBind = <bind @pattern Pattern>.
|
2021-05-27 08:36:35 +00:00
|
|
|
PAnd = <and @patterns [Pattern ...]>.
|
|
|
|
PNot = <not @pattern Pattern>.
|
2021-12-13 14:43:01 +00:00
|
|
|
PCompound =
|
|
|
|
/ @rec <rec @label any @fields [Pattern ...]>
|
|
|
|
/ @arr <arr @items [Pattern ...]>
|
|
|
|
/ @dict <dict @entries { any: Pattern ...:... }> .
|
2021-05-27 08:36:35 +00:00
|
|
|
|
2021-06-09 13:06:58 +00:00
|
|
|
Template = TAttenuate / TRef / Lit / TCompound .
|
2023-02-06 09:45:41 +00:00
|
|
|
TAttenuate = <attenuate @template Template @attenuation [Caveat ...]>.
|
2021-07-12 19:10:19 +00:00
|
|
|
TRef = <ref @binding int>.
|
2021-12-13 14:43:01 +00:00
|
|
|
TCompound =
|
|
|
|
/ @rec <rec @label any @fields [Template ...]>
|
|
|
|
/ @arr <arr @items [Template ...]>
|
|
|
|
/ @dict <dict @entries { any: Template ...:... }> .
|