Dever v0.0.2
This commit is contained in:
commit
e6e175ebcf
816 files changed
+120349
No files matched your search
@@ -0,0 +1,11 @@
|
||||
type Credentials { key: Secret, count: Int }
|
||||
type Parsed { Ready(value: Credentials), error Failed(reason: dever.json.JsonResult) }
|
||||
hash(value: Bytes) (out: Bytes) { out = dever.crypto.sha256(value) }
|
||||
sign(key: Secret, value: Bytes) (out: Bytes) { out = dever.crypto.hmacSha256(key, value) }
|
||||
equal(left: Bytes, right: Bytes) (out: Bool) { out = dever.crypto.constantTimeEq(left, right) }
|
||||
present(value: Secret?) (out: Bool) { out = value != null }
|
||||
rule required(value: Secret?) (out: Secret)
|
||||
| value | out |
|
||||
| null | fail(Invalid) |
|
||||
| other | value |
|
||||
read(value: Json) (out: Parsed) { out = result(dever.json.decode(value)) }
|
||||
Reference in new issue
Block a user