[−][src]Struct orizentic::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]
&self,
token: &UnverifiedToken
) -> Result<VerifiedToken, Error>
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]
&self,
text: &String
) -> Result<VerifiedToken, Error>
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
impl Unpin for OrizenticCtx
impl Sync for OrizenticCtx
impl Send for OrizenticCtx
impl RefUnwindSafe for OrizenticCtx
impl UnwindSafe for OrizenticCtx
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,