swindon 0.7.8

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
18
use tk_http::server::{Error};

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

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