#[non_exhaustive]pub enum Requirement {
AgentToken,
PersonToken,
AuthToken {
resource_token: String,
},
Approval,
Interaction {
url: Option<String>,
code: String,
},
Clarification,
Claims,
}Expand description
What a 401 (or a Person Server’s 202) asks for.
let header = r#"requirement=auth-token;resource-token="eyJ.eyJ.sig""#;
assert_eq!(
Requirement::parse(header),
Some(Requirement::AuthToken { resource_token: "eyJ.eyJ.sig".into() })
);
assert_eq!(Requirement::Approval.to_header(), "requirement=approval");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AgentToken
Present an agent token.
PersonToken
Present a person token from the agent’s Person Server.
AuthToken
Exchange this resource token at the Person Server for an auth token.
Approval
A human is deciding; poll the response’s Location.
Interaction
Send the person to url with code.
Fields
Clarification
The server needs the agent to clarify its request.
Claims
The server needs claims about the person.
Implementations§
Trait Implementations§
Source§impl Clone for Requirement
impl Clone for Requirement
Source§impl Debug for Requirement
impl Debug for Requirement
impl Eq for Requirement
Source§impl PartialEq for Requirement
impl PartialEq for Requirement
impl StructuralPartialEq for Requirement
Auto Trait Implementations§
impl Freeze for Requirement
impl RefUnwindSafe for Requirement
impl Send for Requirement
impl Sync for Requirement
impl Unpin for Requirement
impl UnsafeUnpin for Requirement
impl UnwindSafe for Requirement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more