diff --git a/Cargo.toml b/Cargo.toml index 86e80d0839..dc6a25b0d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swagger" -version = "0.4.0" +version = "0.5.0" authors = ["Metaswitch Networks Ltd"] license = "Apache-2.0" description = "A set of common utilities for Rust code generated by swagger-codegen" @@ -23,4 +23,3 @@ serde_derive = { version = "1.0", optional = true } hyper = "0.10" base64 = "0.5" iron = "0.5" -chrono = "0.4" diff --git a/src/auth.rs b/src/auth.rs index b99ac21ec7..898acb8a36 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -1,7 +1,6 @@ //! Authentication and authorization data structures use std::collections::BTreeSet; -use chrono::{DateTime, Utc}; use iron; use hyper; @@ -18,34 +17,8 @@ pub enum Scopes { /// REST API authorization. #[derive(Clone, Debug, PartialEq)] pub struct Authorization { - /// Subject of the request. pub subject: String, - - /// Authorization scopes available to the subject. pub scopes: Scopes, - - /// The authentication mechanism that provided this authorization data. - /// - /// In cases where authentication is delegated to other microservices via - /// assertion headers, this field stores the original authentication - /// mechanism that initially authenticated the subject. - pub auth_type: String, - - /// Issuer of this request. - /// - /// When a system is operating on behalf of a subject, the subject field - /// contains the subject of the request, while the issuer field contains - /// the system that issued the request. - pub issuer: Option, - - /// Expiry deadline for this authorization data. - /// - /// This is used when the authorization data is cached, used to start a - /// session, or is used to construct a token passed back to the client. - /// - /// A `None` indicates that this authorization data must not be cached, and - /// is considered only valid for the current request. - pub expiry_deadline: Option>, } impl iron::typemap::Key for Authorization { type Value = Authorization; @@ -83,9 +56,6 @@ impl iron::middleware::BeforeMiddleware for AllowAllMiddleware { req.extensions.insert::(Authorization { subject: self.0.clone(), scopes: Scopes::All, - auth_type: "bypass".to_string(), - issuer: None, - expiry_deadline: None, }); Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index 7b90174e92..77cc1be5b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,6 @@ extern crate serde_json; #[macro_use] extern crate serde_derive; extern crate base64; -extern crate chrono; #[macro_use] extern crate hyper;