bbox_core/auth/
mod.rs

1#[cfg(feature = "oidc")]
2pub mod oidc;
3
4pub struct Identity {
5    pub username: String,
6    pub groups: Vec<String>,
7}
8
9#[cfg(not(feature = "oidc"))]
10pub mod oidc {
11    use super::Identity;
12    use serde::{Deserialize, Serialize};
13
14    type AuthError = std::io::Error;
15
16    #[derive(Deserialize, Serialize, Default, Clone, Debug)]
17    pub struct OidcAuthCfg;
18
19    #[derive(Default, Clone)]
20    pub struct OidcClient {
21        pub authorize_url: String,
22    }
23
24    impl OidcClient {
25        pub async fn from_config(_cfg: &OidcAuthCfg) -> Self {
26            Self::default()
27        }
28    }
29
30    #[derive(Deserialize, Serialize)]
31    pub struct AuthRequest;
32
33    impl AuthRequest {
34        pub async fn auth(&self, _oidc: &OidcClient) -> Result<Identity, AuthError> {
35            unimplemented!()
36        }
37    }
38}