Add proc for minting test capabilities

This commit is contained in:
Emery Hemingway 2021-12-04 11:36:22 +00:00
parent 9c2f58ad39
commit a8030cce4d
1 changed files with 5 additions and 0 deletions

View File

@ -15,6 +15,11 @@ proc mint*[T](key: openarray[byte]; oid: T): SturdyRef =
let oidPr = toPreserve(oid, Ref)
SturdyRef(oid: oidPr, sig: hmacSha256(key, encode(oidPr), key.len))
proc mint*(): SturdyRef {.deprecated.} =
## Mint a test capability for the use with the Syndicate server.
var key: array[16, byte]
mint(key, "syndicate")
proc attenuate*(r: SturdyRef; caveats: Attenuation): SturdyRef =
result = SturdyRef(
oid: r.oid,