diff options
Diffstat (limited to 'rust')
-rw-r--r-- | rust/Cargo.toml | 1 | ||||
-rw-r--r-- | rust/src/api_server.rs | 26 | ||||
-rw-r--r-- | rust/src/bin/fatcat-iron.rs | 8 | ||||
-rw-r--r-- | rust/src/lib.rs | 2 |
4 files changed, 14 insertions, 23 deletions
diff --git a/rust/Cargo.toml b/rust/Cargo.toml index ab3f5e35..9883a18b 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -26,6 +26,7 @@ slog = "^2.0" slog-term = "*" slog-async = "*" +# Unused (hyper 0.11 and https) #hyper-openssl = {version = "0.2", optional = true} #hyper-tls = {version = "0.1.2", optional = true} #tokio-core = "0.1.6" diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs index 2dd1bd8c..d9273186 100644 --- a/rust/src/api_server.rs +++ b/rust/src/api_server.rs @@ -1,24 +1,15 @@ -//! Server implementation of fatcat. +//! API endpoint handlers -#![allow(unused_imports)] - -use chrono; -use futures::{self, Future}; - -use std::collections::HashMap; - -use self::models::*; use ConnectionPool; -use diesel; +use database_schema::container_rev::table as container_rev; use diesel::prelude::*; -use diesel::r2d2::ConnectionManager; -use r2d2; - -use swagger; - -use database_schema::creator_rev::table as container_rev; - +use futures::{self, Future}; +//use database_schema::creator_rev::table as creator_rev; +//use database_schema::file_rev::table as file_rev; +//use database_schema::release_rev::table as release_rev; +//use database_schema::work_rev::table as work_rev; use fatcat_api::models; +use fatcat_api::models::*; use fatcat_api::{Api, ApiError, ContainerIdGetResponse, ContainerLookupGetResponse, ContainerPostResponse, Context, CreatorIdGetResponse, CreatorLookupGetResponse, CreatorPostResponse, EditgroupIdAcceptPostResponse, EditgroupIdGetResponse, @@ -27,7 +18,6 @@ use fatcat_api::{Api, ApiError, ContainerIdGetResponse, ContainerLookupGetRespon FilePostResponse, ReleaseIdGetResponse, ReleaseLookupGetResponse, ReleasePostResponse, WorkIdGetResponse, WorkPostResponse}; -//#[derive(Copy, Clone)] #[derive(Clone)] pub struct Server { pub db_pool: ConnectionPool, diff --git a/rust/src/bin/fatcat-iron.rs b/rust/src/bin/fatcat-iron.rs index 9f684b92..6e8c3765 100644 --- a/rust/src/bin/fatcat-iron.rs +++ b/rust/src/bin/fatcat-iron.rs @@ -9,7 +9,6 @@ extern crate fatcat_api; extern crate futures; extern crate iron; extern crate iron_slog; -extern crate swagger; #[macro_use] extern crate error_chain; #[macro_use] @@ -23,7 +22,7 @@ use iron::{Chain, Iron}; use iron_slog::{DefaultLogFormatter, LoggerMiddleware}; use slog::{Drain, Logger}; use std::env; -use swagger::auth::AllowAllMiddleware; +//use swagger::auth::AllowAllMiddleware; /// Create custom server, wire it to the autogenerated router, /// and pass it to the web server. @@ -47,10 +46,11 @@ fn main() { let mut chain = Chain::new(LoggerMiddleware::new(router, logger, formatter)); - chain.link_before(fatcat_api::server::ExtractAuthData); + // Auth stuff unused for now + //chain.link_before(fatcat_api::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")); + //chain.link_before(AllowAllMiddleware::new("cosmo")); chain.link_after(fatcat::XClacksOverheadMiddleware); diff --git a/rust/src/lib.rs b/rust/src/lib.rs index e2b2f892..56364be0 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -7,7 +7,7 @@ extern crate dotenv; extern crate futures; #[macro_use] extern crate hyper; -extern crate swagger; +//extern crate swagger; #[macro_use] extern crate error_chain; extern crate iron; |