Skip to content

Commit 18ce5cc

Browse files
authored
Merge pull request #16 from Metaswitch/revert-14-serde-auth
Revert "Add metadata about auth to Authorization"
2 parents 07d460b + 0b644ac commit 18ce5cc

File tree

3 files changed

+1
-33
lines changed

3 files changed

+1
-33
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "swagger"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
authors = ["Metaswitch Networks Ltd"]
55
license = "Apache-2.0"
66
description = "A set of common utilities for Rust code generated by swagger-codegen"
@@ -23,4 +23,3 @@ serde_derive = { version = "1.0", optional = true }
2323
hyper = "0.10"
2424
base64 = "0.5"
2525
iron = "0.5"
26-
chrono = "0.4"

src/auth.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Authentication and authorization data structures
22
33
use std::collections::BTreeSet;
4-
use chrono::{DateTime, Utc};
54
use iron;
65
use hyper;
76

@@ -18,34 +17,8 @@ pub enum Scopes {
1817
/// REST API authorization.
1918
#[derive(Clone, Debug, PartialEq)]
2019
pub struct Authorization {
21-
/// Subject of the request.
2220
pub subject: String,
23-
24-
/// Authorization scopes available to the subject.
2521
pub scopes: Scopes,
26-
27-
/// The authentication mechanism that provided this authorization data.
28-
///
29-
/// In cases where authentication is delegated to other microservices via
30-
/// assertion headers, this field stores the original authentication
31-
/// mechanism that initially authenticated the subject.
32-
pub auth_type: String,
33-
34-
/// Issuer of this request.
35-
///
36-
/// When a system is operating on behalf of a subject, the subject field
37-
/// contains the subject of the request, while the issuer field contains
38-
/// the system that issued the request.
39-
pub issuer: Option<String>,
40-
41-
/// Expiry deadline for this authorization data.
42-
///
43-
/// This is used when the authorization data is cached, used to start a
44-
/// session, or is used to construct a token passed back to the client.
45-
///
46-
/// A `None` indicates that this authorization data must not be cached, and
47-
/// is considered only valid for the current request.
48-
pub expiry_deadline: Option<DateTime<Utc>>,
4922
}
5023
impl iron::typemap::Key for Authorization {
5124
type Value = Authorization;
@@ -83,9 +56,6 @@ impl iron::middleware::BeforeMiddleware for AllowAllMiddleware {
8356
req.extensions.insert::<Authorization>(Authorization {
8457
subject: self.0.clone(),
8558
scopes: Scopes::All,
86-
auth_type: "bypass".to_string(),
87-
issuer: None,
88-
expiry_deadline: None,
8959
});
9060
Ok(())
9161
}

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extern crate serde_json;
99
#[macro_use]
1010
extern crate serde_derive;
1111
extern crate base64;
12-
extern crate chrono;
1312

1413
#[macro_use]
1514
extern crate hyper;

0 commit comments

Comments
 (0)