new_cfoundry 4.9.0 → 4.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/cfoundry.gemspec +1 -1
- data/lib/cfoundry/baseclient.rb +2 -6
- data/lib/cfoundry/rest_client.rb +1 -2
- data/lib/cfoundry/uaaclient.rb +4 -14
- data/lib/cfoundry/v2/client.rb +2 -2
- data/spec/cfoundry/baseclient_spec.rb +0 -16
- data/spec/cfoundry/uaaclient_spec.rb +1 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef42baba30ec4f7dcd67b58882c138c33be49bf
|
4
|
+
data.tar.gz: ca8599b0ee42c40c4ae0ec232a713b7331542aa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 155f92eecd6308f7caa4bc436a8203781f74d7f55fd2b6842dc90b312aa81e1440bc9b9899cfe0bb819700ddae88de18ef8b3daa951f92fa734d47e4bcdd2d0a
|
7
|
+
data.tar.gz: bfbe03e0b417453219c0d3fd2dd098131cdadfe276c14eedf248d1a31a86716dc13bd77676189d6713f820f3ce185264c5e33a464692165310dc6f53702cbf9a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.9.
|
1
|
+
4.9.1
|
data/cfoundry.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.require_paths = %w[lib]
|
20
20
|
|
21
21
|
s.add_dependency "activemodel", "<5.0.0", ">= 3.2.13"
|
22
|
-
s.add_dependency "cf-uaa-lib", "~>
|
22
|
+
s.add_dependency "cf-uaa-lib", "~> 3.8.0"
|
23
23
|
s.add_dependency "jwt", "~> 1.5"
|
24
24
|
s.add_dependency "multi_json", "~> 1.7"
|
25
25
|
s.add_dependency "multipart-post", "~> 1.1"
|
data/lib/cfoundry/baseclient.rb
CHANGED
@@ -15,13 +15,10 @@ module CFoundry
|
|
15
15
|
attr_accessor :client_id, :client_secret
|
16
16
|
|
17
17
|
def_delegators :rest_client, :target, :target=, :token,
|
18
|
-
:trace, :backtrace, :backtrace=, :log, :log
|
19
|
-
:http_proxy, :http_proxy=, :https_proxy, :https_proxy=
|
18
|
+
:trace, :backtrace, :backtrace=, :log, :log=
|
20
19
|
|
21
20
|
def initialize(target, token = nil, options = {})
|
22
21
|
@rest_client = CFoundry::RestClient.new(target, token)
|
23
|
-
@rest_client.http_proxy = options[:http_proxy]
|
24
|
-
@rest_client.https_proxy = options[:https_proxy]
|
25
22
|
self.client_id = options[:client_id]
|
26
23
|
self.client_secret = options[:client_secret]
|
27
24
|
self.trace = false
|
@@ -36,8 +33,7 @@ module CFoundry
|
|
36
33
|
if endpoint
|
37
34
|
uaa = CFoundry::UAAClient.new(endpoint,
|
38
35
|
client_id || "cf",
|
39
|
-
client_secret: client_secret
|
40
|
-
http_proxy: http_proxy, https_proxy: https_proxy)
|
36
|
+
client_secret: client_secret)
|
41
37
|
uaa.trace = trace
|
42
38
|
uaa.token = token
|
43
39
|
uaa
|
data/lib/cfoundry/rest_client.rb
CHANGED
@@ -38,8 +38,7 @@ module CFoundry
|
|
38
38
|
|
39
39
|
attr_reader :target
|
40
40
|
|
41
|
-
attr_accessor :trace, :backtrace, :log,
|
42
|
-
:request_id, :token, :http_proxy, :https_proxy
|
41
|
+
attr_accessor :trace, :backtrace, :log, :request_id, :token
|
43
42
|
|
44
43
|
def initialize(target, token = nil)
|
45
44
|
@target = target
|
data/lib/cfoundry/uaaclient.rb
CHANGED
@@ -3,14 +3,12 @@ require "uaa"
|
|
3
3
|
|
4
4
|
module CFoundry
|
5
5
|
class UAAClient
|
6
|
-
attr_accessor :target, :client_id, :client_secret, :token, :trace
|
6
|
+
attr_accessor :target, :client_id, :client_secret, :token, :trace
|
7
7
|
|
8
8
|
def initialize(target, client_id = "cf", options = {})
|
9
9
|
@target = target
|
10
10
|
@client_id = client_id
|
11
11
|
@client_secret = options[:client_secret]
|
12
|
-
@http_proxy = options[:http_proxy]
|
13
|
-
@https_proxy = options[:https_proxy]
|
14
12
|
@uaa_info_client = uaa_info_client_for(target)
|
15
13
|
end
|
16
14
|
|
@@ -95,26 +93,18 @@ module CFoundry
|
|
95
93
|
private
|
96
94
|
|
97
95
|
def uaa_info_client_for(url)
|
98
|
-
CF::UAA::Info.new(url,
|
99
|
-
:symbolize_keys => true,
|
100
|
-
:http_proxy => http_proxy,
|
101
|
-
:https_proxy => https_proxy
|
102
|
-
)
|
96
|
+
CF::UAA::Info.new(url, :symbolize_keys => true)
|
103
97
|
end
|
104
98
|
|
105
99
|
def token_issuer
|
106
|
-
@token_issuer ||= CF::UAA::TokenIssuer.new(target, client_id, client_secret,
|
107
|
-
:symbolize_keys => true,
|
108
|
-
:http_proxy => @http_proxy,
|
109
|
-
:https_proxy => @https_proxy
|
110
|
-
)
|
100
|
+
@token_issuer ||= CF::UAA::TokenIssuer.new(target, client_id, client_secret, :symbolize_keys => true)
|
111
101
|
@token_issuer.logger.level = @trace ? Logger::Severity::TRACE : 1
|
112
102
|
@token_issuer
|
113
103
|
end
|
114
104
|
|
115
105
|
def scim
|
116
106
|
auth_header = token && token.auth_header
|
117
|
-
scim = CF::UAA::Scim.new(uaa_url, auth_header, :symbolize_keys => true
|
107
|
+
scim = CF::UAA::Scim.new(uaa_url, auth_header, :symbolize_keys => true)
|
118
108
|
scim.logger.level = @trace ? Logger::Severity::TRACE : 1
|
119
109
|
scim
|
120
110
|
end
|
data/lib/cfoundry/v2/client.rb
CHANGED
@@ -18,8 +18,8 @@ module CFoundry::V2
|
|
18
18
|
# [Space] Currently targeted space.
|
19
19
|
attr_accessor :current_space
|
20
20
|
|
21
|
-
def_delegators :@base, :target, :target=, :token, :token=,
|
22
|
-
:
|
21
|
+
def_delegators :@base, :target, :target=, :token, :token=,
|
22
|
+
:trace, :trace=, :log, :log=, :info
|
23
23
|
|
24
24
|
# Create a new Client for interfacing with the given target.
|
25
25
|
#
|
@@ -135,22 +135,6 @@ describe CFoundry::BaseClient do
|
|
135
135
|
expect(subject.uaa.target).to eq "foo"
|
136
136
|
end
|
137
137
|
end
|
138
|
-
|
139
|
-
context "when proxy is set" do
|
140
|
-
before do
|
141
|
-
subject.http_proxy = 'http-proxy.example.com'
|
142
|
-
subject.https_proxy = 'https-proxy.example.com'
|
143
|
-
end
|
144
|
-
|
145
|
-
it "passes the proxy to the uaa client" do
|
146
|
-
allow(CFoundry::UAAClient).to receive(:new).and_call_original
|
147
|
-
subject.uaa
|
148
|
-
expect(CFoundry::UAAClient).to have_received(:new).with(anything, anything, hash_including(
|
149
|
-
http_proxy: 'http-proxy.example.com',
|
150
|
-
https_proxy: 'https-proxy.example.com'
|
151
|
-
))
|
152
|
-
end
|
153
|
-
end
|
154
138
|
end
|
155
139
|
|
156
140
|
describe "#token=" do
|
@@ -25,17 +25,6 @@ EOF
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe '#initialize' do
|
29
|
-
it "passes proxy info to the UAA info client" do
|
30
|
-
allow(CF::UAA::Info).to receive(:new)
|
31
|
-
CFoundry::UAAClient.new(target, 'cf', http_proxy: 'http-proxy.example.com', https_proxy: 'https-proxy.example.com')
|
32
|
-
expect(CF::UAA::Info).to have_received(:new).with(anything, hash_including(
|
33
|
-
http_proxy: 'http-proxy.example.com',
|
34
|
-
https_proxy: 'https-proxy.example.com'
|
35
|
-
))
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
28
|
describe '#prompts' do
|
40
29
|
subject { uaa.prompts }
|
41
30
|
|
@@ -382,14 +371,11 @@ EOF
|
|
382
371
|
|
383
372
|
it "passes proxy info to the token issuer" do
|
384
373
|
allow(CF::UAA::TokenIssuer).to receive(:new).and_call_original
|
385
|
-
uaa.http_proxy = 'http-proxy.example.com'
|
386
|
-
uaa.https_proxy = 'https-proxy.example.com'
|
387
374
|
|
388
375
|
uaa.send(:token_issuer)
|
389
376
|
|
390
377
|
expect(CF::UAA::TokenIssuer).to have_received(:new).with(anything, anything, anything, hash_including(
|
391
|
-
|
392
|
-
https_proxy: 'https-proxy.example.com'
|
378
|
+
symbolize_keys: true
|
393
379
|
))
|
394
380
|
end
|
395
381
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: new_cfoundry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.
|
4
|
+
version: 4.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CI-Platform-Team
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.8.0
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 3.8.0
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: jwt
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|