cf-uaac 4.8.0 → 4.9.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 +3 -3
- data/Gemfile +1 -1
- data/cf-uaac.gemspec +8 -8
- data/lib/uaa/cli/curl.rb +23 -16
- data/spec/curl_spec.rb +2 -0
- data/version.txt +1 -1
- metadata +18 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0599e99dc76531f4c49de667cdb3d87e7dd75fd0507242d518f7c4af6ef3bf3b'
|
4
|
+
data.tar.gz: c5b279aff340657a2ce1730eba9cf0acd1940fe92d9a78d5312f747e0f5d26ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e9e366ccb26ab246ac80da0193ed18cb5135132bbc8862874a3a6c9f8fbb08799703bcb1e98deb6a40ea7dece5d530a1a2c2fef5284bc84de45849e3c210610
|
7
|
+
data.tar.gz: 3b2c6421c71c098cb4339fb9ed0940472d74c31937868f3b2fd3f080a7fd7f65a4595bcae7116e095fb5eb13f6dcb2b9ad0e63ef662d8fda2f05c08e2361997a
|
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:
|
@@ -16,7 +16,7 @@ jobs:
|
|
16
16
|
ruby-version: ['2.5', '2.7', '3.0', '3.1']
|
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', '
|
35
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
36
|
+
s.add_development_dependency 'rspec', '~> 3.12'
|
37
37
|
s.add_development_dependency 'simplecov', '~> 0.21.2'
|
38
|
-
s.add_development_dependency 'simplecov-rcov', '~> 0.3.
|
39
|
-
s.add_development_dependency 'ci_reporter', '
|
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/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/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.9.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.9.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: 2022-
|
15
|
+
date: 2022-12-12 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,22 +46,16 @@ 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
|
@@ -88,21 +76,18 @@ dependencies:
|
|
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
|