Skip to content

Commit 342617b

Browse files
authored
Merge pull request #19 from Metaswitch/add-issuer-to-auth
Add issuer to auth
2 parents 3efce33 + 116cf71 commit 342617b

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
### Added
9+
10+
### Changed
11+
- Authorization struct now has new field `issuer`.
12+
13+
## [0.5.0] - 2017-09-18
14+
- Start of changelog.
15+
16+
[Unreleased]: https://github.com/Metaswitch/swagger-rs/compare/0.5.0...HEAD
17+
[0.5.0]: https://github.com/Metaswitch/swagger-rs/compare/0.4.0...0.5.0

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[package]
22
name = "swagger"
3-
version = "0.5.0"
3+
version = "0.6.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"
77
homepage = "https://github.com/Metaswitch/swagger-rs"
88
repository = "https://github.com/Metaswitch/swagger-rs"
99
readme = "README.md"
10+
keywords = ["swagger"]
1011

1112
[badges.travis-ci]
1213
repository = "Metaswitch/swagger-rs"

src/auth.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,25 @@ pub enum Scopes {
1717
/// REST API authorization.
1818
#[derive(Clone, Debug, PartialEq)]
1919
pub struct Authorization {
20-
/// Authenticated subject of the request
20+
/// Subject for which authorization is granted
21+
/// (i.e., what may be accessed.)
2122
pub subject: String,
22-
/// Authorization scopes of the authenticated subject
23+
24+
/// Scopes for which authorization is granted
25+
/// (i.e., what types of access are permitted).
2326
pub scopes: Scopes,
27+
28+
/// Identity of the party to whom authorization was granted, if available
29+
/// (i.e., who is responsible for the access).
30+
///
31+
/// In an OAuth environment, this is the identity of the client which
32+
/// issued an authorization request to the resource owner (end-user),
33+
/// and which has been directly authorized by the resource owner
34+
/// to access the protected resource. If the client delegates that
35+
/// authorization to another service (e.g., a proxy or other delegate),
36+
/// the `issuer` is still the original client which was authorized by
37+
/// the resource owner.
38+
pub issuer: Option<String>,
2439
}
2540
impl iron::typemap::Key for Authorization {
2641
type Value = Authorization;
@@ -58,6 +73,7 @@ impl iron::middleware::BeforeMiddleware for AllowAllMiddleware {
5873
req.extensions.insert::<Authorization>(Authorization {
5974
subject: self.0.clone(),
6075
scopes: Scopes::All,
76+
issuer: None,
6177
});
6278
Ok(())
6379
}

0 commit comments

Comments
 (0)