etcd-discovery 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/etcd-discovery/host.rb +15 -10
- data/lib/etcd-discovery/service.rb +16 -11
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02edd48044abeca02169d432516a65ea48c8843b22942686c88f4c9761fd10f4
|
4
|
+
data.tar.gz: a3c0768508b0043521b98017d71442261e17fd63f7d4cd8c7c5f0e05ece91203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573344b8a4f8de0222d0da6e38ef5dddfe8f67d55585c26d66edd44345dbd3adb27f25c4e911fe15bba2f3be711d8db5d4374dc3cdd189ebdc8495f8c0cf51cd
|
7
|
+
data.tar.gz: 7620dff391769b07332e7e8608098b734f4285f794ee670dafe1e4dd45607c21d3cc1c5f2ec54b4ea9fd4eaa9c8478ddb7285a8156653b985c86ac49f68cd7e3
|
data/lib/etcd-discovery/host.rb
CHANGED
@@ -25,16 +25,16 @@ module EtcdDiscovery
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def to_uri(schemes = ["https", "http"])
|
28
|
-
|
29
|
-
|
30
|
-
scheme = schemes.find { |s|
|
31
|
-
|
32
|
-
|
33
|
-
if
|
34
|
-
URI("#{scheme}://#{
|
35
|
-
else
|
36
|
-
URI("#{scheme}://#{a["user"]}:#{a["password"]}@#{a["name"]}:#{a["ports"][scheme]}")
|
28
|
+
schemes = Array(schemes)
|
29
|
+
|
30
|
+
scheme = schemes.find { |s| attributes["ports"][s] }
|
31
|
+
raise "No valid scheme found" unless scheme
|
32
|
+
|
33
|
+
if attributes["user"].nil? || attributes["user"].empty?
|
34
|
+
return URI("#{scheme}://#{attributes["name"]}:#{attributes["ports"][scheme]}")
|
37
35
|
end
|
36
|
+
|
37
|
+
URI("#{scheme}://#{attributes["user"]}:#{attributes["password"]}@#{attributes["name"]}:#{attributes["ports"][scheme]}")
|
38
38
|
end
|
39
39
|
|
40
40
|
def to_private_uri(schemes = ["https", "http"])
|
@@ -60,7 +60,12 @@ module EtcdDiscovery
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def to_s
|
63
|
-
to_uri
|
63
|
+
uri = to_uri
|
64
|
+
if uri.userinfo
|
65
|
+
user, _password = uri.userinfo.split(":", 2)
|
66
|
+
uri.userinfo = "#{user}:REDACTED"
|
67
|
+
end
|
68
|
+
uri.to_s
|
64
69
|
end
|
65
70
|
end
|
66
71
|
end
|
@@ -43,22 +43,27 @@ module EtcdDiscovery
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def to_uri(schemes = ["https", "http"])
|
46
|
-
|
47
|
-
return one.to_uri(schemes) unless a["public"]
|
46
|
+
schemes = Array(schemes)
|
48
47
|
|
49
|
-
schemes
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
URI("#{scheme}://#{a["user"]}:#{a["password"]}@#{a["hostname"]}:#{a["ports"][scheme]}")
|
48
|
+
return one.to_uri(schemes) unless attributes["public"]
|
49
|
+
|
50
|
+
scheme = schemes.find { |s| attributes["ports"][s] }
|
51
|
+
raise "No valid scheme found" unless scheme
|
52
|
+
|
53
|
+
if attributes["user"].nil? || attributes["user"].empty?
|
54
|
+
return URI("#{scheme}://#{attributes["hostname"]}:#{attributes["ports"][scheme]}")
|
57
55
|
end
|
56
|
+
|
57
|
+
URI("#{scheme}://#{attributes["user"]}:#{attributes["password"]}@#{attributes["hostname"]}:#{attributes["ports"][scheme]}")
|
58
58
|
end
|
59
59
|
|
60
60
|
def to_s
|
61
|
-
to_uri
|
61
|
+
uri = to_uri
|
62
|
+
if uri.userinfo
|
63
|
+
user, _password = uri.userinfo.split(":", 2)
|
64
|
+
uri.userinfo = "#{user}:REDACTED"
|
65
|
+
end
|
66
|
+
uri.to_s
|
62
67
|
end
|
63
68
|
|
64
69
|
def to_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etcd-discovery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Léo Unbekandt
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: etcd
|
@@ -43,7 +43,7 @@ homepage: http://github.com/Scalingo/etcd-discovery-ruby
|
|
43
43
|
licenses:
|
44
44
|
- BSD
|
45
45
|
metadata: {}
|
46
|
-
post_install_message:
|
46
|
+
post_install_message:
|
47
47
|
rdoc_options: []
|
48
48
|
require_paths:
|
49
49
|
- lib
|
@@ -58,8 +58,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.3.
|
62
|
-
signing_key:
|
61
|
+
rubygems_version: 3.3.26
|
62
|
+
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: Service discovery based on etcd
|
65
65
|
test_files: []
|