cf-uaac 4.8.0 → 4.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ruby.yml +4 -4
- data/Gemfile +1 -1
- data/cf-uaac.gemspec +9 -9
- data/lib/uaa/cli/config.rb +1 -1
- data/lib/uaa/cli/curl.rb +23 -16
- data/lib/uaa/cli/token.rb +1 -1
- data/spec/curl_spec.rb +2 -0
- data/version.txt +1 -1
- metadata +20 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 980e72cf51fa122f913bafb404bedf16131cacda6a1c5ddbe8007ce7a1cc5dc2
|
4
|
+
data.tar.gz: e85fcf56ea708436f032cfe018a2bc01a5108a15d7695bf25f337db33c1670c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb967dcbf5f5bf0d86aef886d2b1656f45599f5518669929b146b8f5893c6c1f890cd4e4dea7cda431ee81330c2a281ec8e5ef2d4de0e2ff80aba3855472c085
|
7
|
+
data.tar.gz: bb528d120273c6a7c7040e807a2001933ac7402f0e044242f7f0ae38464eb116e2ada6e8d62dae221dbe4c6c2a1c21cadb9c9046064ee56b94ae3f60fa851075
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ruby.yml
CHANGED
@@ -2,9 +2,9 @@ name: Ruby
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [
|
5
|
+
branches: [ main ]
|
6
6
|
pull_request:
|
7
|
-
branches: [
|
7
|
+
branches: [ main ]
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
@@ -13,10 +13,10 @@ jobs:
|
|
13
13
|
strategy:
|
14
14
|
fail-fast: false
|
15
15
|
matrix:
|
16
|
-
ruby-version: ['2.5', '2.7', '3.0', '3.1']
|
16
|
+
ruby-version: ['2.5', '2.7', '3.0', '3.1', '3.2']
|
17
17
|
|
18
18
|
steps:
|
19
|
-
- uses: actions/checkout@
|
19
|
+
- uses: actions/checkout@v3
|
20
20
|
- name: Set up Ruby
|
21
21
|
uses: ruby/setup-ruby@v1
|
22
22
|
with:
|
data/Gemfile
CHANGED
data/cf-uaac.gemspec
CHANGED
@@ -32,16 +32,16 @@ Gem::Specification.new do |s|
|
|
32
32
|
|
33
33
|
# dependencies
|
34
34
|
s.add_runtime_dependency 'cf-uaa-lib', '~> 4.0'
|
35
|
-
s.add_development_dependency 'rake', '
|
36
|
-
s.add_development_dependency 'rspec', '
|
37
|
-
s.add_development_dependency 'simplecov', '~> 0.
|
38
|
-
s.add_development_dependency 'simplecov-rcov', '~> 0.3.
|
39
|
-
s.add_development_dependency 'ci_reporter', '
|
35
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
36
|
+
s.add_development_dependency 'rspec', '~> 3.12'
|
37
|
+
s.add_development_dependency 'simplecov', '~> 0.22.0'
|
38
|
+
s.add_development_dependency 'simplecov-rcov', '~> 0.3.1'
|
39
|
+
s.add_development_dependency 'ci_reporter', '~> 2.0'
|
40
40
|
s.add_development_dependency 'ci_reporter_rspec', '~> 1.0'
|
41
41
|
s.add_runtime_dependency 'highline', '~> 2.0'
|
42
|
-
s.add_runtime_dependency 'eventmachine', '~> 1.
|
43
|
-
s.add_runtime_dependency 'launchy', '~> 2.
|
42
|
+
s.add_runtime_dependency 'eventmachine', '~> 1.2'
|
43
|
+
s.add_runtime_dependency 'launchy', '~> 2.5'
|
44
44
|
s.add_runtime_dependency 'em-http-request', '~> 1.1', '>= 1.1.2'
|
45
|
-
s.add_runtime_dependency 'json_pure', '
|
46
|
-
s.add_runtime_dependency 'rack', '
|
45
|
+
s.add_runtime_dependency 'json_pure', '~>2.6'
|
46
|
+
s.add_runtime_dependency 'rack', '~>3.0'
|
47
47
|
end
|
data/lib/uaa/cli/config.rb
CHANGED
@@ -34,7 +34,7 @@ class Config
|
|
34
34
|
if config =~ /^---/ || config == ""
|
35
35
|
@config = config == "" ? {} : YAML.load(config)
|
36
36
|
@config_file = nil
|
37
|
-
elsif File.
|
37
|
+
elsif File.exist?(@config_file = config)
|
38
38
|
if (@config = YAML.load_file(@config_file)) && @config.is_a?(Hash)
|
39
39
|
@config.each { |k, v| break @config = nil if k.to_s =~ / / }
|
40
40
|
end
|
data/lib/uaa/cli/curl.rb
CHANGED
@@ -27,15 +27,16 @@ module CF::UAA
|
|
27
27
|
define_option :data, "-d", "--data <data>", "data included in request body"
|
28
28
|
define_option :header, "-H", "--header <header>", "header to be included in the request"
|
29
29
|
define_option :insecure, "-k", "--insecure", "makes request without verifying SSL certificates"
|
30
|
+
define_option :bodyonly, "-b", "--bodyonly", "show body only in response"
|
30
31
|
|
31
|
-
desc "curl [path]", "CURL to a UAA endpoint", :request, :data, :header, :insecure do |path|
|
32
|
+
desc "curl [path]", "CURL to a UAA endpoint", :request, :data, :header, :insecure , :bodyonly do |path|
|
32
33
|
return say_command_help(["curl"]) unless path
|
33
34
|
|
34
35
|
uri = parse_uri(path)
|
35
36
|
opts[:request] ||= "GET"
|
36
|
-
print_request(opts[:request], uri, opts[:data], opts[:header])
|
37
|
+
print_request(opts[:request], uri, opts[:data], opts[:header], opts[:bodyonly])
|
37
38
|
response = make_request(uri, opts)
|
38
|
-
print_response(response)
|
39
|
+
print_response(response, opts[:bodyonly])
|
39
40
|
end
|
40
41
|
|
41
42
|
def parse_uri(path)
|
@@ -46,16 +47,16 @@ module CF::UAA
|
|
46
47
|
uri
|
47
48
|
end
|
48
49
|
|
49
|
-
def print_request(request, uri, data, header)
|
50
|
-
|
51
|
-
|
50
|
+
def print_request(request, uri, data, header, bodyonly)
|
51
|
+
say_it("#{request} #{uri.to_s}", bodyonly)
|
52
|
+
say_it("REQUEST BODY: \"#{data}\"", bodyonly) if data
|
52
53
|
if header
|
53
|
-
|
54
|
+
say_it("REQUEST HEADERS:", bodyonly)
|
54
55
|
Array(header).each do |h|
|
55
|
-
|
56
|
+
say_it(" #{h}", bodyonly)
|
56
57
|
end
|
57
58
|
end
|
58
|
-
|
59
|
+
say_it("", bodyonly)
|
59
60
|
end
|
60
61
|
|
61
62
|
def make_request(uri, options)
|
@@ -76,20 +77,26 @@ module CF::UAA
|
|
76
77
|
http.request(req, options[:data])
|
77
78
|
end
|
78
79
|
|
79
|
-
def print_response(response)
|
80
|
-
|
81
|
-
|
80
|
+
def print_response(response, bodyonly)
|
81
|
+
say_it("#{response.code} #{response.message}", bodyonly)
|
82
|
+
say_it("RESPONSE HEADERS:", bodyonly)
|
82
83
|
response.each_capitalized do |key, value|
|
83
|
-
|
84
|
+
say_it(" #{key}: #{value}", bodyonly)
|
84
85
|
end
|
85
86
|
|
86
|
-
|
87
|
+
say_it("RESPONSE BODY:", bodyonly)
|
87
88
|
if !response['Content-Type'].nil? && response['Content-Type'].include?('application/json')
|
88
89
|
parsed = JSON.parse(response.body)
|
89
90
|
formatted = JSON.pretty_generate(parsed)
|
90
|
-
say
|
91
|
+
say(formatted)
|
91
92
|
else
|
92
|
-
say
|
93
|
+
say(response.body)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def say_it(text, bodyonly)
|
98
|
+
if !bodyonly
|
99
|
+
say text
|
93
100
|
end
|
94
101
|
end
|
95
102
|
end
|
data/lib/uaa/cli/token.rb
CHANGED
@@ -180,7 +180,7 @@ class TokenCli < CommonCli
|
|
180
180
|
return unless opts[:cf]
|
181
181
|
begin
|
182
182
|
cf_target = File.open(CF_TARGET_FILE, 'r') { |f| f.read.strip }
|
183
|
-
tok_json = File.open(CF_TOKEN_FILE, 'r') { |f| f.read } if File.
|
183
|
+
tok_json = File.open(CF_TOKEN_FILE, 'r') { |f| f.read } if File.exist?(CF_TOKEN_FILE)
|
184
184
|
cf_tokens = Util.json_parse(tok_json, :none) || {}
|
185
185
|
cf_tokens[cf_target] = auth_header
|
186
186
|
File.open(CF_TOKEN_FILE, 'w') { |f| f.write(cf_tokens.to_json) }
|
data/spec/curl_spec.rb
CHANGED
@@ -35,6 +35,8 @@ module CF::UAA
|
|
35
35
|
Cli.output.string.should include "curl [path]"
|
36
36
|
Cli.output.string.should include "-X | --request <method>"
|
37
37
|
Cli.output.string.should include "-d | --data <data>"
|
38
|
+
Cli.output.string.should include "-k | --insecure"
|
39
|
+
Cli.output.string.should include "-b | --bodyonly"
|
38
40
|
end
|
39
41
|
|
40
42
|
it "hits the URL on the UAA target" do
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.14.0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-uaac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Syer
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: cf-uaa-lib
|
@@ -32,9 +32,6 @@ dependencies:
|
|
32
32
|
name: rake
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - ">="
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 10.3.1
|
38
35
|
- - "~>"
|
39
36
|
- !ruby/object:Gem::Version
|
40
37
|
version: '13.0'
|
@@ -42,9 +39,6 @@ dependencies:
|
|
42
39
|
prerelease: false
|
43
40
|
version_requirements: !ruby/object:Gem::Requirement
|
44
41
|
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 10.3.1
|
48
42
|
- - "~>"
|
49
43
|
- !ruby/object:Gem::Version
|
50
44
|
version: '13.0'
|
@@ -52,57 +46,48 @@ dependencies:
|
|
52
46
|
name: rspec
|
53
47
|
requirement: !ruby/object:Gem::Requirement
|
54
48
|
requirements:
|
55
|
-
- - ">="
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: 2.14.1
|
58
49
|
- - "~>"
|
59
50
|
- !ruby/object:Gem::Version
|
60
|
-
version: '3.
|
51
|
+
version: '3.12'
|
61
52
|
type: :development
|
62
53
|
prerelease: false
|
63
54
|
version_requirements: !ruby/object:Gem::Requirement
|
64
55
|
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 2.14.1
|
68
56
|
- - "~>"
|
69
57
|
- !ruby/object:Gem::Version
|
70
|
-
version: '3.
|
58
|
+
version: '3.12'
|
71
59
|
- !ruby/object:Gem::Dependency
|
72
60
|
name: simplecov
|
73
61
|
requirement: !ruby/object:Gem::Requirement
|
74
62
|
requirements:
|
75
63
|
- - "~>"
|
76
64
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
65
|
+
version: 0.22.0
|
78
66
|
type: :development
|
79
67
|
prerelease: false
|
80
68
|
version_requirements: !ruby/object:Gem::Requirement
|
81
69
|
requirements:
|
82
70
|
- - "~>"
|
83
71
|
- !ruby/object:Gem::Version
|
84
|
-
version: 0.
|
72
|
+
version: 0.22.0
|
85
73
|
- !ruby/object:Gem::Dependency
|
86
74
|
name: simplecov-rcov
|
87
75
|
requirement: !ruby/object:Gem::Requirement
|
88
76
|
requirements:
|
89
77
|
- - "~>"
|
90
78
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.3.
|
79
|
+
version: 0.3.1
|
92
80
|
type: :development
|
93
81
|
prerelease: false
|
94
82
|
version_requirements: !ruby/object:Gem::Requirement
|
95
83
|
requirements:
|
96
84
|
- - "~>"
|
97
85
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.3.
|
86
|
+
version: 0.3.1
|
99
87
|
- !ruby/object:Gem::Dependency
|
100
88
|
name: ci_reporter
|
101
89
|
requirement: !ruby/object:Gem::Requirement
|
102
90
|
requirements:
|
103
|
-
- - ">="
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: 1.9.2
|
106
91
|
- - "~>"
|
107
92
|
- !ruby/object:Gem::Version
|
108
93
|
version: '2.0'
|
@@ -110,9 +95,6 @@ dependencies:
|
|
110
95
|
prerelease: false
|
111
96
|
version_requirements: !ruby/object:Gem::Requirement
|
112
97
|
requirements:
|
113
|
-
- - ">="
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: 1.9.2
|
116
98
|
- - "~>"
|
117
99
|
- !ruby/object:Gem::Version
|
118
100
|
version: '2.0'
|
@@ -150,40 +132,28 @@ dependencies:
|
|
150
132
|
requirements:
|
151
133
|
- - "~>"
|
152
134
|
- !ruby/object:Gem::Version
|
153
|
-
version: '1.
|
154
|
-
- - ">="
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
version: 1.0.3
|
135
|
+
version: '1.2'
|
157
136
|
type: :runtime
|
158
137
|
prerelease: false
|
159
138
|
version_requirements: !ruby/object:Gem::Requirement
|
160
139
|
requirements:
|
161
140
|
- - "~>"
|
162
141
|
- !ruby/object:Gem::Version
|
163
|
-
version: '1.
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 1.0.3
|
142
|
+
version: '1.2'
|
167
143
|
- !ruby/object:Gem::Dependency
|
168
144
|
name: launchy
|
169
145
|
requirement: !ruby/object:Gem::Requirement
|
170
146
|
requirements:
|
171
147
|
- - "~>"
|
172
148
|
- !ruby/object:Gem::Version
|
173
|
-
version: '2.
|
174
|
-
- - ">="
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: 2.4.2
|
149
|
+
version: '2.5'
|
177
150
|
type: :runtime
|
178
151
|
prerelease: false
|
179
152
|
version_requirements: !ruby/object:Gem::Requirement
|
180
153
|
requirements:
|
181
154
|
- - "~>"
|
182
155
|
- !ruby/object:Gem::Version
|
183
|
-
version: '2.
|
184
|
-
- - ">="
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: 2.4.2
|
156
|
+
version: '2.5'
|
187
157
|
- !ruby/object:Gem::Dependency
|
188
158
|
name: em-http-request
|
189
159
|
requirement: !ruby/object:Gem::Requirement
|
@@ -208,42 +178,30 @@ dependencies:
|
|
208
178
|
name: json_pure
|
209
179
|
requirement: !ruby/object:Gem::Requirement
|
210
180
|
requirements:
|
211
|
-
- - "
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
version: 1.8.1
|
214
|
-
- - "<"
|
181
|
+
- - "~>"
|
215
182
|
- !ruby/object:Gem::Version
|
216
|
-
version: '
|
183
|
+
version: '2.6'
|
217
184
|
type: :runtime
|
218
185
|
prerelease: false
|
219
186
|
version_requirements: !ruby/object:Gem::Requirement
|
220
187
|
requirements:
|
221
|
-
- - "
|
222
|
-
- !ruby/object:Gem::Version
|
223
|
-
version: 1.8.1
|
224
|
-
- - "<"
|
188
|
+
- - "~>"
|
225
189
|
- !ruby/object:Gem::Version
|
226
|
-
version: '
|
190
|
+
version: '2.6'
|
227
191
|
- !ruby/object:Gem::Dependency
|
228
192
|
name: rack
|
229
193
|
requirement: !ruby/object:Gem::Requirement
|
230
194
|
requirements:
|
231
|
-
- - "
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version: 1.5.2
|
234
|
-
- - "<"
|
195
|
+
- - "~>"
|
235
196
|
- !ruby/object:Gem::Version
|
236
|
-
version: '
|
197
|
+
version: '3.0'
|
237
198
|
type: :runtime
|
238
199
|
prerelease: false
|
239
200
|
version_requirements: !ruby/object:Gem::Requirement
|
240
201
|
requirements:
|
241
|
-
- - "
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: 1.5.2
|
244
|
-
- - "<"
|
202
|
+
- - "~>"
|
245
203
|
- !ruby/object:Gem::Version
|
246
|
-
version: '
|
204
|
+
version: '3.0'
|
247
205
|
description: Client command line tools for interacting with the CloudFoundry User
|
248
206
|
Account and Authorization (UAA) server. The UAA is an OAuth2 Authorization Server
|
249
207
|
so it can be used by webapps and command line apps to obtain access tokens to act
|