Enum lite_session::LiteSessionError[][src]

pub enum LiteSessionError {
    NonceLengthError,
    ServerKeyLengthError,
    TokenSizeTooLarge,
    TokenFieldsLengthError,
    DataFieldsLengthError,
    InvalidHexString,
    InvalidTai64NTime,
    InvalidBytesForBlake3,
    FromUtf8TokenError,
}

Error handling for the library

Variants

NonceLengthError

The nonce length is not valid as it should be of 12 bytes/96bit length. Using a 12 characters alphanumeric string generated from a cryptographically secure random number(CSPRNG) is recommended.

ServerKeyLengthError

The key length of the provided server key is not valid as it should be 32byte/256bit length. Using a 32 characters alphanumeric string generated from a cryptographically secure random number(CSPRNG) is recommended.

TokenSizeTooLarge

The size of the token from a user is too big as it should not be more than 1KiB in size This circumvents denial-of-service(DOS) attacks since a very large token can consume execessive resources thereby starving other requests or processes

TokenFieldsLengthError

The provided tokens length has been tampered with or the token is corrupted

DataFieldsLengthError

The provided token contains invalid length acl fields indicating a tampered or corrupted token

InvalidHexString

The string provided was not of type hex even though a hex type is needed

InvalidTai64NTime

The destructured time in hex cannot be converted to a valid TAI64N scientific time value

InvalidBytesForBlake3

The bytes provided cannot be converted to a valid blake3::Hash

FromUtf8TokenError

The provided bytes cannot be converted to a valid UTF-8 token. This usually happens when the key or nonce used or both are invalid resulting in a bad deserialization

Trait Implementations

impl Debug for LiteSessionError[src]

impl PartialEq<LiteSessionError> for LiteSessionError[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.