yao 0.13.2 → 0.13.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 051a375b0fda12cf9a9a3553d13905638adb2af8e661606d2407c0a1b832c032
4
- data.tar.gz: a0592f5d24e3d258b2b2bba0c6b7d16dc48a26a365a27c4b98354a349da04144
3
+ metadata.gz: 919bc587d14da66211d65e2b3a9b73b41f458947f9417bdc64d09fc818aafde6
4
+ data.tar.gz: b88b52c34a06ba337b3fc84944eb7cb83e496588df76a3b659dedf0e195ffd1a
5
5
  SHA512:
6
- metadata.gz: 9c3859bf07d45e3f257ab3b7c8e45da5304cb0046b823916617fcd896d3ea2e7811dd4b3fce463a9fb1916dba336df00c6f817a246feeea6227036b7206a49b0
7
- data.tar.gz: 5fc9b2a499232273a76bde3134102d1913baa41c233cd42a5aa4d84704a19817a39285fcba8ab05bfbe0dc2d060705d7e0d580a30b4b53e49f2928b518ff7a44
6
+ metadata.gz: 594a7f34ebd9d3f879377125d8383eb42a50295f668111757e63cdbecc7c40b7f4d43a93e94477a8874f24996d30e813b7f9268d49ba0604aca8f3b980b95687
7
+ data.tar.gz: 689b7970f7ac73e37bbb174ac1871e7b56a1c6778da40f3d1e7c5042097b72d6d1fba4059debaff0914b6e95ce953581021fea103d48c967a176c30c2e9e8d2e
data/README.md CHANGED
@@ -34,7 +34,8 @@ Yao.configure do
34
34
  # timeout is optional
35
35
  timeout 300
36
36
 
37
- # If your endpoint requires cert & key
37
+ # If your endpoint requires cacert,cert and key
38
+ ca_cert "/path/to/my.ca"
38
39
  client_cert "/path/to/my.pem"
39
40
  client_key "/path/to/my.key"
40
41
 
@@ -5,7 +5,7 @@ require 'yao/token'
5
5
  require 'yao/tokenv3'
6
6
 
7
7
  module Yao
8
- %i(tenant_name username password timeout client_cert client_key region_name
8
+ %i(tenant_name username password timeout ca_cert client_cert client_key region_name
9
9
  identity_api_version user_domain_id user_domain_name project_domain_id project_domain_name).each do |name|
10
10
  Yao.config.param name, nil
11
11
  end
@@ -127,10 +127,13 @@ module Yao
127
127
  if Yao.config.client_cert && Yao.config.client_key
128
128
  cert = OpenSSL::X509::Certificate.new(File.read(Yao.config.client_cert))
129
129
  key = OpenSSL::PKey.read(File.read(Yao.config.client_key))
130
- opt.merge!(ssl: {
130
+ h = {
131
131
  client_cert: cert,
132
132
  client_key: key,
133
- })
133
+ }
134
+
135
+ h[:ca_file] = Yao.config.ca_cert if Yao.config.ca_cert
136
+ opt.merge!(ssl: h)
134
137
  end
135
138
  opt
136
139
  end
@@ -1,3 +1,3 @@
1
1
  module Yao
2
- VERSION = "0.13.2"
2
+ VERSION = "0.13.3"
3
3
  end
@@ -64,6 +64,7 @@ class TestClient < Test::Unit::TestCase
64
64
  end
65
65
 
66
66
  def test_cert_key
67
+ stub(Yao.config).ca_cert { File.expand_path("../../fixtures/dummy.pem", __FILE__) }
67
68
  stub(Yao.config).client_cert { File.expand_path("../../fixtures/dummy.pem", __FILE__) }
68
69
  stub(Yao.config).client_key { File.expand_path("../../fixtures/dummy.key", __FILE__) }
69
70
  stub(OpenSSL::X509::Certificate).new { "DummyCert" }
@@ -71,6 +72,7 @@ class TestClient < Test::Unit::TestCase
71
72
 
72
73
  cli = Yao::Client.gen_client("http://cool-api.example.com:12345/v3.0")
73
74
  ssl = cli.ssl
75
+ assert { ssl[:ca_file] == File.expand_path("../../fixtures/dummy.pem", __FILE__) }
74
76
  assert { ssl[:client_cert] == "DummyCert" }
75
77
  assert { ssl[:client_key] == "DummyKey" }
76
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yao
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio, KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-16 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json