yao 0.13.2 → 0.13.3
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 +4 -4
- data/README.md +2 -1
- data/lib/yao/auth.rb +1 -1
- data/lib/yao/client.rb +5 -2
- data/lib/yao/version.rb +1 -1
- data/test/yao/test_client.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 919bc587d14da66211d65e2b3a9b73b41f458947f9417bdc64d09fc818aafde6
|
4
|
+
data.tar.gz: b88b52c34a06ba337b3fc84944eb7cb83e496588df76a3b659dedf0e195ffd1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594a7f34ebd9d3f879377125d8383eb42a50295f668111757e63cdbecc7c40b7f4d43a93e94477a8874f24996d30e813b7f9268d49ba0604aca8f3b980b95687
|
7
|
+
data.tar.gz: 689b7970f7ac73e37bbb174ac1871e7b56a1c6778da40f3d1e7c5042097b72d6d1fba4059debaff0914b6e95ce953581021fea103d48c967a176c30c2e9e8d2e
|
data/README.md
CHANGED
data/lib/yao/auth.rb
CHANGED
@@ -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
|
data/lib/yao/client.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/yao/version.rb
CHANGED
data/test/yao/test_client.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|