fabric/reviewer
The identity that answers an approval request.
An answer (fabric.approve, fabric.reject, graph.approve,
graph.reject) does not take a reviewer: it takes an
approvers.Proof, and the reviewer it records
(run.Approval.reviewer) is the one the approvers’ verify function
returned. A reviewer is that function’s building block: it names the
identity a credential authenticated, such as the subject and issuer of
a verified access token.
use token, requirement <- approvers.new("sso")
use claims <- result.try(verify_token(token, requirement))
reviewer.new(claims.subject)
|> result.try(reviewer.with_issuer(_, claims.issuer))
|> result.map_error(fn(error) {
approvers.NotAuthenticated(reviewer.describe_error(error))
})
A subject and an issuer come from a token, so they are checked: each is
1 to 256 bytes. Fabric may add optional parts to a reviewer; build one
with new and read it with the accessors.
Types
Which part of a reviewer Error names.
pub type Part {
Subject
Issuer
}
Constructors
-
Subject -
Issuer
Values
pub fn issuer(reviewer: Reviewer) -> option.Option(String)
pub fn new(subject: String) -> Result(Reviewer, Error)
A reviewer named by subject: the authenticated identity’s stable id
within its issuer (an OIDC sub, a user id), 1 to 256 bytes.