diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-09-18 11:38:34 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-26 23:32:43 -0800 |
commit | 802bafc92160205a2a3068b7b780a6a5eeb331d9 (patch) | |
tree | dc471a11f7e7f5bdf5b94ba066ece79adf0a59f3 /rust/src/bin/fatcatd.rs | |
parent | 6a8d793eef101e72dbe44f94c30cbf5e6be75aeb (diff) | |
download | fatcat-802bafc92160205a2a3068b7b780a6a5eeb331d9.tar.gz fatcat-802bafc92160205a2a3068b7b780a6a5eeb331d9.zip |
start skeleton of auth internal bits
Diffstat (limited to 'rust/src/bin/fatcatd.rs')
-rw-r--r-- | rust/src/bin/fatcatd.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/rust/src/bin/fatcatd.rs b/rust/src/bin/fatcatd.rs index 57b6a3da..e14296da 100644 --- a/rust/src/bin/fatcatd.rs +++ b/rust/src/bin/fatcatd.rs @@ -20,9 +20,7 @@ use iron::modifiers::RedirectRaw; use iron::{status, Chain, Iron, IronResult, Request, Response}; use iron_slog::{DefaultLogFormatter, LoggerMiddleware}; use slog::{Drain, Logger}; -//use dotenv::dotenv; -//use std::env; -//use swagger::auth::AllowAllMiddleware; + /// Create custom server, wire it to the autogenerated router, /// and pass it to the web server. @@ -78,11 +76,9 @@ fn main() { let mut chain = Chain::new(LoggerMiddleware::new(router, logger, formatter)); - // Auth stuff unused for now - //chain.link_before(fatcat_api_spec::server::ExtractAuthData); - // add authentication middlewares into the chain here - // for the purpose of this example, pretend we have authenticated a user - //chain.link_before(AllowAllMiddleware::new("cosmo")); + // authentication + chain.link_before(fatcat_api_spec::server::ExtractAuthData); + chain.link_before(fatcat::auth::OpenAuthMiddleware::new()); chain.link_after(fatcat::XClacksOverheadMiddleware); |