cf-uaac 4.18.0 → 4.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b470c3d2590a9e00f4481b0d5ac9c611b38f6f14b3d506c3a2c3c4b6eeede7c3
4
- data.tar.gz: f0838fe08f2a05f001a12d70c093b32f5c209986e271ab3fd0ed71ff12f58699
3
+ metadata.gz: 6dc4e3b1a66d1246f967c01af8cb76701512db9def2b5bb6b71bc6a78520486d
4
+ data.tar.gz: 4d8c6b3f7c1697154b6a182ed0dd9996dc82ede51f3638bd3a891c1088b9f6a7
5
5
  SHA512:
6
- metadata.gz: 40db2b6725b381ad1b516ed64ccf567130e2a9760da0b9555973f7c4b6f0cd8a42fca39203048358117bd067e459492ff03d9978fc6fae994fc8b938730e4ba5
7
- data.tar.gz: a7c3573b9409e08c22f9629de314c7b4b3f2e89c2359ebce22291bd21cdf7fe85fb471c2042c9ffe29d08fa89515a7affd652029da227bb30a96ed525d8e51cd
6
+ metadata.gz: 9eee4fde101ef7a677c286a22ffeaa807a0eb4806d812ba78cf51d9c908be359c8a1372ca2262b6d7ced08d795c8fe00338d35858ba1cea65e6e87f1f55a56e6
7
+ data.tar.gz: 0fea98fc2eb0ca6bcd2b5c7af118f7c191bfb92f11aaea2c3f3f8fa8cd34eccf415ef9e7c2a593564d502d599547b3021074ff1a73d06310638980f2fc983f18
data/lib/uaa/cli/curl.rb CHANGED
@@ -27,9 +27,10 @@ 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 :cacert, "-C", "--cacert <ca_file>", "CA certificate to verify peer against"
30
31
  define_option :bodyonly, "-b", "--bodyonly", "show body only in response"
31
32
 
32
- desc "curl [path]", "CURL to a UAA endpoint", :request, :data, :header, :insecure , :bodyonly do |path|
33
+ desc "curl [path]", "CURL to a UAA endpoint", :request, :data, :header, :insecure, :cacert, :bodyonly do |path|
33
34
  return say_command_help(["curl"]) unless path
34
35
 
35
36
  uri = parse_uri(path)
@@ -65,6 +66,9 @@ module CF::UAA
65
66
  http.use_ssl = true
66
67
  if options[:insecure]
67
68
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
69
+ elsif options[:cacert]
70
+ http.ca_file = File.expand_path(options[:cacert])
71
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
68
72
  end
69
73
  end
70
74
  request_class = Net::HTTP.const_get("#{options[:request][0]}#{options[:request][1..-1].downcase}")
data/spec/curl_spec.rb CHANGED
@@ -37,6 +37,7 @@ module CF::UAA
37
37
  Cli.output.string.should include "-d | --data <data>"
38
38
  Cli.output.string.should include "-k | --insecure"
39
39
  Cli.output.string.should include "-b | --bodyonly"
40
+ Cli.output.string.should include "-C | --cacert"
40
41
  end
41
42
 
42
43
  it "hits the URL on the UAA target" do
@@ -108,5 +109,19 @@ module CF::UAA
108
109
  Cli.output.string.should_not include "ECONNRESET"
109
110
  Cli.output.string.should include "200 OK"
110
111
  end
112
+
113
+ it "makes insecure requests without the -k flag" do
114
+ Cli.run("curl https://example.com/")
115
+
116
+ Cli.output.string.should_not include "ECONNRESET"
117
+ Cli.output.string.should include "200 OK"
118
+ end
119
+
120
+ it "makes requests using invalid custom ca cert file with the -C flag" do
121
+ Cli.run("curl https://example.com/ -C ca.pem")
122
+
123
+ Cli.output.string.should_not include "200 OK"
124
+ Cli.output.string.should include "SSLError"
125
+ end
111
126
  end
112
127
  end
data/version.txt CHANGED
@@ -1 +1 @@
1
- 4.18.0
1
+ 4.20.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.18.0
4
+ version: 4.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Syer
@@ -9,10 +9,10 @@ authors:
9
9
  - Joel D'sa
10
10
  - Vidya Valmikinathan
11
11
  - Luke Taylor
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2023-11-21 00:00:00.000000000 Z
15
+ date: 2024-01-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: cf-uaa-lib
@@ -269,7 +269,7 @@ homepage: https://github.com/cloudfoundry/cf-uaac
269
269
  licenses:
270
270
  - Apache-2.0
271
271
  metadata: {}
272
- post_install_message:
272
+ post_install_message:
273
273
  rdoc_options: []
274
274
  require_paths:
275
275
  - lib
@@ -284,8 +284,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
284
  - !ruby/object:Gem::Version
285
285
  version: '0'
286
286
  requirements: []
287
- rubygems_version: 3.1.6
288
- signing_key:
287
+ rubygems_version: 3.3.26
288
+ signing_key:
289
289
  specification_version: 4
290
290
  summary: Command line interface for CloudFoundry UAA
291
291
  test_files: []