From 33a4cce0b97832f5f0301b318a0a50073ce6b615 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 15 May 2018 00:33:33 -0700 Subject: revert to v2.3.1 codegen This reverts back to something compatible with Iron and simple (blocking) parallelism, instead of the new async hyper 0.11 stuff. --- rust/fatcat-api/src/server/auth.rs | 93 -------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 rust/fatcat-api/src/server/auth.rs (limited to 'rust/fatcat-api/src/server/auth.rs') diff --git a/rust/fatcat-api/src/server/auth.rs b/rust/fatcat-api/src/server/auth.rs deleted file mode 100644 index 48dfd7d6..00000000 --- a/rust/fatcat-api/src/server/auth.rs +++ /dev/null @@ -1,93 +0,0 @@ -use Api; -use hyper; -use hyper::{Error, Request, Response, StatusCode}; -use server::url::form_urlencoded; -use std::io; -use swagger::auth::{AuthData, Authorization, Scopes}; - -pub struct NewService -where - T: hyper::server::NewService< - Request = (Request, Option), - Response = Response, - Error = Error, - >, -{ - inner: T, -} - -impl NewService -where - T: hyper::server::NewService< - Request = (Request, Option), - Response = Response, - Error = Error, - > - + 'static, -{ - pub fn new(inner: T) -> NewService { - NewService { inner } - } -} - -impl hyper::server::NewService for NewService -where - T: hyper::server::NewService< - Request = (Request, Option), - Response = Response, - Error = Error, - > - + 'static, -{ - type Request = Request; - type Response = Response; - type Error = Error; - type Instance = Service; - - fn new_service(&self) -> Result { - self.inner.new_service().map(|s| Service::new(s)) - } -} - -/// Middleware to extract authentication data from request -pub struct Service -where - T: hyper::server::Service< - Request = (Request, Option), - Response = Response, - Error = Error, - >, -{ - inner: T, -} - -impl Service -where - T: hyper::server::Service< - Request = (Request, Option), - Response = Response, - Error = Error, - >, -{ - pub fn new(inner: T) -> Service { - Service { inner } - } -} - -impl hyper::server::Service for Service -where - T: hyper::server::Service< - Request = (Request, Option), - Response = Response, - Error = Error, - >, -{ - type Request = Request; - type Response = Response; - type Error = Error; - type Future = T::Future; - - fn call(&self, req: Self::Request) -> Self::Future { - return self.inner.call((req, None)); - } -} -- cgit v1.2.3