swindon 0.5.2

An HTTP edge (frontend) server with smart websockets support
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tk_http::server::{Error};

use incoming::{AuthInput};
use config::{Authorizer};
use authorizers;

// TODO(tailhook) this should eventually be a virtual method on Authorizer
impl Authorizer {
    pub fn check(&self, input: &mut AuthInput) -> Result<bool, Error> {
        match *self {
            Authorizer::SourceIp(ref cfg) => {
                authorizers::source_ip::check(cfg, input)
            }
            Authorizer::Ldap(_) => unimplemented!(),
        }
    }
}