Enum kvarn_auth::Validation

source ·
pub enum Validation<T: Serialize + DeserializeOwned> {
    Unauthorized,
    Authorized(AuthData<T>),
}
Expand description

The state of the user in question.

Variants§

§

Unauthorized

This can come from multiple sources, including but not limited to:

  • invalid base64 encoding
  • invalid JWT structure
  • mismatched hash (the user changed their privilege)
  • serialization errors to the desired structured type
  • unexpected data in the JSON
  • failed to parse JSON
  • expiry date is not included
§

Authorized(AuthData<T>)

The user is authorized with the provided data. The data is guaranteed to be what you authorized.

Trait Implementations§

source§

impl<T: Debug + Serialize + DeserializeOwned> Debug for Validation<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
</