version 1 . embeddedType EntityRef.Cap . # --------------------------------------------------------------------------- # Binding and connection SturdyStepType = =ref . # In a gatekeeper.Step or gatekeeper.PathStep, use Parameters as detail. SturdyStepDetail = Parameters . SturdyPathStepDetail = Parameters . # In a gatekeeper.Description, use the following detail. SturdyDescriptionDetail = { oid: any, key: bytes, } . # --------------------------------------------------------------------------- # Macaroons # The sequence of Caveats is run RIGHT-TO-LEFT. # That is, the newest Caveats are at the right. # # 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. # # The `sig` is then f(f(f(f(k, e(oid)), ...), e(Caveat)), ...). # SturdyRef = . Parameters = { oid: any, sig: bytes, } & @caveats CaveatsField . CaveatsField = @present { caveats: [Caveat ...] } / @invalid { caveats: any } / @absent {} . # embodies 1st-party caveats over assertion structure, but nothing else # can add 3rd-party caveats and richer predicates later Caveat = Rewrite / Alts / Reject / @unknown any . Rewrite = . Reject = . Alts = . Oid = int . WireRef = @mine [0 @oid Oid] / @yours [1 @oid Oid @attenuation Caveat ...]. # --------------------------------------------------------------------------- Lit = . Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound . PDiscard = <_>. PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol . PEmbedded = =Embedded . PBind = . PAnd = . PNot = . PCompound = / @rec / @arr / @dict . Template = TAttenuate / TRef / Lit / TCompound . TAttenuate = . TRef = . TCompound = / @rec / @arr / @dict .