cf-uaa-lib 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/uaa/http.rb +8 -2
- data/lib/uaa/info.rb +1 -0
- data/lib/uaa/scim.rb +1 -0
- data/lib/uaa/token_coder.rb +1 -1
- data/lib/uaa/token_issuer.rb +1 -0
- data/lib/uaa/version.rb +1 -1
- data/spec/http_spec.rb +11 -0
- metadata +44 -26
- checksums.yaml +0 -7
data/lib/uaa/http.rb
CHANGED
@@ -50,7 +50,7 @@ module Http
|
|
50
50
|
|
51
51
|
def self.included(base)
|
52
52
|
base.class_eval do
|
53
|
-
attr_accessor :http_proxy, :https_proxy, :skip_ssl_validation
|
53
|
+
attr_accessor :http_proxy, :https_proxy, :skip_ssl_validation, :ssl_ca_file
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
@@ -182,7 +182,13 @@ module Http
|
|
182
182
|
|
183
183
|
if uri.is_a?(URI::HTTPS)
|
184
184
|
http.use_ssl = true
|
185
|
-
|
185
|
+
|
186
|
+
if skip_ssl_validation
|
187
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
188
|
+
elsif ssl_ca_file
|
189
|
+
http.ca_file = File.expand_path(ssl_ca_file)
|
190
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
191
|
+
end
|
186
192
|
end
|
187
193
|
|
188
194
|
@http_cache[cache_key] = http
|
data/lib/uaa/info.rb
CHANGED
@@ -32,6 +32,7 @@ class Info
|
|
32
32
|
def initialize(target, options = {})
|
33
33
|
self.target = target
|
34
34
|
self.skip_ssl_validation = options[:skip_ssl_validation]
|
35
|
+
self.ssl_ca_file = options[:ssl_ca_file]
|
35
36
|
self.symbolize_keys = options[:symbolize_keys]
|
36
37
|
self.http_proxy = options[:http_proxy]
|
37
38
|
self.https_proxy = options[:https_proxy]
|
data/lib/uaa/scim.rb
CHANGED
@@ -100,6 +100,7 @@ class Scim
|
|
100
100
|
@target, @auth_header = target, auth_header
|
101
101
|
@key_style = options[:symbolize_keys] ? :downsym : :down
|
102
102
|
self.skip_ssl_validation = options[:skip_ssl_validation]
|
103
|
+
self.ssl_ca_file = options[:ssl_ca_file]
|
103
104
|
self.http_proxy = options[:http_proxy]
|
104
105
|
self.https_proxy = options[:https_proxy]
|
105
106
|
end
|
data/lib/uaa/token_coder.rb
CHANGED
@@ -42,7 +42,7 @@ class InvalidAudience < AuthError; end
|
|
42
42
|
class TokenCoder
|
43
43
|
|
44
44
|
def self.init_digest(algo) # @private
|
45
|
-
OpenSSL::Digest
|
45
|
+
OpenSSL::Digest.new(algo.sub('HS', 'sha').sub('RS', 'sha'))
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.normalize_options(opts) # @private
|
data/lib/uaa/token_issuer.rb
CHANGED
@@ -110,6 +110,7 @@ class TokenIssuer
|
|
110
110
|
@token_target = options[:token_target] || target
|
111
111
|
@key_style = options[:symbolize_keys] ? :sym : nil
|
112
112
|
self.skip_ssl_validation = options[:skip_ssl_validation]
|
113
|
+
self.ssl_ca_file = options[:ssl_ca_file]
|
113
114
|
self.http_proxy = options[:http_proxy]
|
114
115
|
self.https_proxy = options[:https_proxy]
|
115
116
|
end
|
data/lib/uaa/version.rb
CHANGED
data/spec/http_spec.rb
CHANGED
@@ -69,6 +69,17 @@ describe Http do
|
|
69
69
|
http_instance.http_get("https://uncached.example.com")
|
70
70
|
expect(http_double).to have_received(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE)
|
71
71
|
end
|
72
|
+
|
73
|
+
it "passes ssl certificate file if provided" do
|
74
|
+
http_double = double('http').as_null_object
|
75
|
+
Net::HTTP.stub(:new).and_return(http_double)
|
76
|
+
|
77
|
+
http_instance.ssl_ca_file = "/fake-ca-file"
|
78
|
+
http_instance.http_get("https://uncached.example.com")
|
79
|
+
|
80
|
+
expect(http_double).to have_received(:ca_file=).with("/fake-ca-file")
|
81
|
+
expect(http_double).to have_received(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER)
|
82
|
+
end
|
72
83
|
end
|
73
84
|
|
74
85
|
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-uaa-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Dave Syer
|
@@ -12,118 +13,134 @@ authors:
|
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
|
-
date:
|
16
|
+
date: 2015-03-20 00:00:00.000000000 Z
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|
18
19
|
name: multi_json
|
19
20
|
requirement: !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
20
22
|
requirements:
|
21
|
-
- -
|
23
|
+
- - ! '>='
|
22
24
|
- !ruby/object:Gem::Version
|
23
25
|
version: '0'
|
24
26
|
type: :runtime
|
25
27
|
prerelease: false
|
26
28
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
27
30
|
requirements:
|
28
|
-
- -
|
31
|
+
- - ! '>='
|
29
32
|
- !ruby/object:Gem::Version
|
30
33
|
version: '0'
|
31
34
|
- !ruby/object:Gem::Dependency
|
32
35
|
name: bundler
|
33
36
|
requirement: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
34
38
|
requirements:
|
35
|
-
- -
|
39
|
+
- - ! '>='
|
36
40
|
- !ruby/object:Gem::Version
|
37
41
|
version: '0'
|
38
42
|
type: :development
|
39
43
|
prerelease: false
|
40
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
41
46
|
requirements:
|
42
|
-
- -
|
47
|
+
- - ! '>='
|
43
48
|
- !ruby/object:Gem::Version
|
44
49
|
version: '0'
|
45
50
|
- !ruby/object:Gem::Dependency
|
46
51
|
name: rake
|
47
52
|
requirement: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
48
54
|
requirements:
|
49
|
-
- -
|
55
|
+
- - ~>
|
50
56
|
- !ruby/object:Gem::Version
|
51
57
|
version: 10.3.2
|
52
58
|
type: :development
|
53
59
|
prerelease: false
|
54
60
|
version_requirements: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
55
62
|
requirements:
|
56
|
-
- -
|
63
|
+
- - ~>
|
57
64
|
- !ruby/object:Gem::Version
|
58
65
|
version: 10.3.2
|
59
66
|
- !ruby/object:Gem::Dependency
|
60
67
|
name: rspec
|
61
68
|
requirement: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
62
70
|
requirements:
|
63
|
-
- -
|
71
|
+
- - ~>
|
64
72
|
- !ruby/object:Gem::Version
|
65
73
|
version: 2.14.1
|
66
74
|
type: :development
|
67
75
|
prerelease: false
|
68
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
none: false
|
69
78
|
requirements:
|
70
|
-
- -
|
79
|
+
- - ~>
|
71
80
|
- !ruby/object:Gem::Version
|
72
81
|
version: 2.14.1
|
73
82
|
- !ruby/object:Gem::Dependency
|
74
83
|
name: simplecov
|
75
84
|
requirement: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
76
86
|
requirements:
|
77
|
-
- -
|
87
|
+
- - ~>
|
78
88
|
- !ruby/object:Gem::Version
|
79
89
|
version: 0.8.2
|
80
90
|
type: :development
|
81
91
|
prerelease: false
|
82
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
83
94
|
requirements:
|
84
|
-
- -
|
95
|
+
- - ~>
|
85
96
|
- !ruby/object:Gem::Version
|
86
97
|
version: 0.8.2
|
87
98
|
- !ruby/object:Gem::Dependency
|
88
99
|
name: simplecov-rcov
|
89
100
|
requirement: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
90
102
|
requirements:
|
91
|
-
- -
|
103
|
+
- - ~>
|
92
104
|
- !ruby/object:Gem::Version
|
93
105
|
version: 0.2.3
|
94
106
|
type: :development
|
95
107
|
prerelease: false
|
96
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
97
110
|
requirements:
|
98
|
-
- -
|
111
|
+
- - ~>
|
99
112
|
- !ruby/object:Gem::Version
|
100
113
|
version: 0.2.3
|
101
114
|
- !ruby/object:Gem::Dependency
|
102
115
|
name: ci_reporter
|
103
116
|
requirement: !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
104
118
|
requirements:
|
105
|
-
- -
|
119
|
+
- - ~>
|
106
120
|
- !ruby/object:Gem::Version
|
107
121
|
version: 1.9.2
|
108
122
|
type: :development
|
109
123
|
prerelease: false
|
110
124
|
version_requirements: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
111
126
|
requirements:
|
112
|
-
- -
|
127
|
+
- - ~>
|
113
128
|
- !ruby/object:Gem::Version
|
114
129
|
version: 1.9.2
|
115
130
|
- !ruby/object:Gem::Dependency
|
116
131
|
name: json_pure
|
117
132
|
requirement: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
118
134
|
requirements:
|
119
|
-
- -
|
135
|
+
- - ~>
|
120
136
|
- !ruby/object:Gem::Version
|
121
137
|
version: 1.8.1
|
122
138
|
type: :development
|
123
139
|
prerelease: false
|
124
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
125
142
|
requirements:
|
126
|
-
- -
|
143
|
+
- - ~>
|
127
144
|
- !ruby/object:Gem::Version
|
128
145
|
version: 1.8.1
|
129
146
|
description: Client library for interacting with the CloudFoundry User Account and
|
@@ -141,9 +158,9 @@ executables: []
|
|
141
158
|
extensions: []
|
142
159
|
extra_rdoc_files: []
|
143
160
|
files:
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
161
|
+
- .gitignore
|
162
|
+
- .travis.yml
|
163
|
+
- .yardopts
|
147
164
|
- CHANGELOG.md
|
148
165
|
- Gemfile
|
149
166
|
- LICENSE.TXT
|
@@ -170,26 +187,27 @@ files:
|
|
170
187
|
homepage: https://github.com/cloudfoundry/cf-uaa-lib
|
171
188
|
licenses:
|
172
189
|
- Apache 2.0
|
173
|
-
metadata: {}
|
174
190
|
post_install_message:
|
175
191
|
rdoc_options: []
|
176
192
|
require_paths:
|
177
193
|
- lib
|
178
194
|
required_ruby_version: !ruby/object:Gem::Requirement
|
195
|
+
none: false
|
179
196
|
requirements:
|
180
|
-
- -
|
197
|
+
- - ! '>='
|
181
198
|
- !ruby/object:Gem::Version
|
182
199
|
version: '0'
|
183
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
184
202
|
requirements:
|
185
|
-
- -
|
203
|
+
- - ! '>='
|
186
204
|
- !ruby/object:Gem::Version
|
187
205
|
version: '0'
|
188
206
|
requirements: []
|
189
207
|
rubyforge_project: cf-uaa-lib
|
190
|
-
rubygems_version:
|
208
|
+
rubygems_version: 1.8.23.2
|
191
209
|
signing_key:
|
192
|
-
specification_version:
|
210
|
+
specification_version: 3
|
193
211
|
summary: Client library for CloudFoundry UAA
|
194
212
|
test_files:
|
195
213
|
- spec/http_spec.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6b4d37f1fd550f4599f73272b8585b71000afb91
|
4
|
-
data.tar.gz: 857e2c137890ee3dc1dd0b699581c1e644935885
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: a9ab7f79ec21ae03a11c40731395eaef4ac6239277b54c9270aabad6c44a203350a0337a4d320f4aa5cdf03f0b485ec562a3fe26c9214a02838e25ba3c79300f
|
7
|
-
data.tar.gz: 5c5127f173c8b05d6ec032783b40cb4c69c142e3368f2188375d1aa1448d8f71e4955cbe4eb8f1ee46100285c57e858a6bd042423142b2cfe8d68f99de26dc12
|