Skip to main content

fiberplane_models/
auth.rs

1use serde::{Deserialize, Serialize};
2use thiserror::Error;
3
4#[cfg(feature = "fp-bindgen")]
5use fp_bindgen::prelude::Serializable;
6
7#[derive(Debug, Deserialize, Error, Serialize, Clone, Copy, PartialEq, Eq)]
8#[cfg_attr(
9    feature = "fp-bindgen",
10    derive(Serializable),
11    fp(rust_module = "fiberplane_models::auth")
12)]
13#[non_exhaustive]
14#[serde(tag = "type", rename_all = "snake_case")]
15pub enum AuthError {
16    #[error("no credentials were provided")]
17    Unauthenticated,
18
19    #[error("credentials are not allowed to perform this action")]
20    Unauthorized,
21}