fastcomments_sdk/sso/
mod.rs

1use hmac::digest::InvalidLength;
2
3pub mod fastcomments_sso;
4pub mod secure_sso_payload;
5pub mod secure_sso_user_data;
6pub mod simple_sso_user_data;
7pub mod helpers;
8
9#[derive(Debug)]
10pub enum CreateHashError {
11    InvalidLength(InvalidLength),
12}
13
14impl std::fmt::Display for CreateHashError {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        match self {
17            CreateHashError::InvalidLength(_) => write!(f, "Error initializing HMAC"),
18        }
19    }
20}
21
22impl std::error::Error for CreateHashError {
23    fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
24        match self {
25            CreateHashError::InvalidLength(e) => Some(e),
26        }
27    }
28}
29
30impl From<InvalidLength> for CreateHashError {
31    fn from(err: InvalidLength) -> Self {
32        CreateHashError::InvalidLength(err)
33    }
34}