[][src]Struct orizentic::OrizenticCtx

pub struct OrizenticCtx(_, _);

The Orizentic Context encapsulates a set of claims and an associated secret. This provides the overall convenience of easily creating and validating tokens. Generated claimsets are stored here on the theory that, even with validation, only those claims actually stored in the database should be considered valid.

Methods

impl OrizenticCtx[src]

pub fn new(secret: Secret, claims_lst: Vec<ClaimSet>) -> OrizenticCtx[src]

Create a new Orizentic Context with an initial set of claims.

pub fn validate_token(
    &self,
    token: &UnverifiedToken
) -> Result<VerifiedToken, Error>
[src]

Validate a token by checking its signature, that it is not expired, and that it is still present in the database. Return an error if any check fails, but return a VerifiedToken if it all succeeds.

pub fn decode_and_validate_text(
    &self,
    text: &String
) -> Result<VerifiedToken, Error>
[src]

Given a text string, as from a web application's Authorization header, decode the string and then validate the token.

pub fn add_claimset(&mut self, claimset: ClaimSet)[src]

Add a claimset to the database.

pub fn revoke_claimset(&mut self, claim: &ClaimSet)[src]

Remove a claims set from the database so that all additional validation checks fail.

pub fn revoke_by_uuid(&mut self, claim_id: &String)[src]

Revoke a ClaimsSet given its ID, which is set in the jti claim of a JWT or the id field of a ClaimSet.

pub fn replace_claimsets(&mut self, _claims_lst: Vec<ClaimSet>)[src]

NOT IMPLEMENTED

pub fn list_claimsets(&self) -> Vec<&ClaimSet>[src]

List all of the ClaimSet IDs in the database.

pub fn find_claimset(&self, claims_id: &String) -> Option<&ClaimSet>[src]

Find a ClaimSet by ID.

pub fn encode_claimset(&self, claims: &ClaimSet) -> Result<VerifiedToken, Error>[src]

Encode and sign a claimset, returning the result as a VerifiedToken.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]