1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use actix_web::{web, Scope};
use tracing::info;

pub mod oauth_v2;
pub mod openid_connect;

pub trait AuthenticationServerModule {
    fn config(&mut self, cfg: &mut web::ServiceConfig);
}

/// A User Authentication Server
pub struct AuthenticationServer {}

impl AuthenticationServer {
    pub fn new() -> AuthenticationServer {
        info!("Creating Authentication Server");

        AuthenticationServer {}
    }

    pub fn config(&mut self) -> Scope {
        web::scope("/oauth").service(oauth_v2::config())
    }

    #[cfg(feature = "my-feature")]
    pub fn service(&mut self) {}
}