Files
core/test/rust/native/blocking.dever
T
2026-11-27 06:03:56 +00:00

95 lines
3.3 KiB
Plaintext

flow hash(password: Secret) (out: Text)
| step | kind | do |
| out | calc | blocking(dever.crypto.passwordHash(password)) |
flow verify(password: Secret, hash: Text) (out: Bool)
| step | kind | do |
| out | calc | blocking(dever.crypto.passwordVerify(password, hash)) |
flow spawned(password: Secret, hash: Text) (out: Bool)
| step | kind | do |
| t | calc | run(dever.crypto.passwordVerify(password, hash)) |
| out | calc | wait(t) |
flow pair(password: Secret, hash: Text) (valid: Bool, size: Int)
| step | kind | do |
| valid | flow | dever.crypto.passwordVerify(password, hash) |
| size | calc | length(hash) |
flow multiple(password: Secret, hash: Text) (out: Int)
| step | kind | do |
| checked | calc | blocking(pair(password, hash)) |
| - | check | checked.valid else Invalid |
| out | calc | checked.size |
flow apply(password: Secret, hash: Text, action: handler(password: Secret, hash: Text) (value: Bool)) (out: Bool)
| step | kind | do |
| out | calc | blocking(action(password, hash)) |
flow handled(password: Secret, hash: Text) (out: Bool)
| step | kind | do |
| out | flow | apply(password, hash, dever.crypto.passwordVerify) |
flow together(password: Secret, hash: Text) (out: Bool)
| step | kind | parallel | do |
| first | calc | verify | blocking(dever.crypto.passwordVerify(password, hash)) |
| second | calc | verify | blocking(dever.crypto.passwordVerify(password, hash)) |
| out | calc | - | first and second |
type Attempt { Done(value: Bool), error Failed(reason: dever.crypto.VerifyResult) }
rule resolved(value: Attempt) (out: Bool) recover("report invalid password encodings as false")
| value | out |
| Done(valid) | valid |
| Failed(reason) | false |
flow captured(password: Secret, hash: Text) (out: Bool)
| step | kind | do |
| received: Attempt | calc | result(blocking(dever.crypto.passwordVerify(password, hash))) |
| out | rule | resolved(received) |
guard(value: Text) (out: Text) {
check length(value) > 0 else Invalid
out = value
}
flow argumentFailure(password: Secret, hash: Text) (out: Bool)
| step | kind | do |
| received: Attempt | calc | result(blocking(dever.crypto.passwordVerify(password, guard(hash)))) |
| out | rule | resolved(received) |
flow member(password: Secret, hash: Text) ()
| step | kind | do |
| valid | flow | dever.crypto.passwordVerify(password, hash) |
| - | check | valid else Invalid |
flow grouped(password: Secret, hash: Text) ()
| step | kind | do |
| tasks | calc | group(1) |
| - | calc | run(tasks, member(password, hash)) |
| - | calc | wait(tasks) |
flow failing(password: Secret, hash: Text, value: Int) (out: Int)
| step | kind | do |
| valid | flow | dever.crypto.passwordVerify(password, hash) |
| - | check | valid else Invalid |
| out | calc | value + 1 |
flow overflow(password: Secret, hash: Text, value: Int) (out: Int)
| step | kind | do |
| out | calc | blocking(failing(password, hash, value)) |
flow spawnedOverflow(password: Secret, hash: Text, value: Int) (out: Int)
| step | kind | do |
| task | calc | run(failing(password, hash, value)) |
| out | calc | wait(task) |
setting password: Secret
setting saved_hash: Text
flow configuredTarget() (out: Bool)
| step | kind | do |
| out | flow | dever.crypto.passwordVerify(password, saved_hash) |
flow configured() (out: Bool)
| step | kind | do |
| out | calc | blocking(configuredTarget()) |
cmd verify = verify