contrast-agent 6.1.1 → 6.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contrast/agent/inventory/database_config.rb +12 -4
- data/lib/contrast/agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c901ed882ebff8176fe2f3794907e29b03cc2903b61260f138d93b2ef02a465c
|
4
|
+
data.tar.gz: 72e4f01ccf5a57bbd5afa0cac58c51cddbe26183691d9495f563dfd9fb37e7e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d60653e61e95443c45bb43caac325b3c72449ddea435096e2d8e49c0a0851ff9ae6486fc16a17f65f663c2f069c58f6157f4f7ef8745d0b082d4fe7c5c0b8b6
|
7
|
+
data.tar.gz: e1e5dd1a542009d153fa6e77f86d889d8bb852d85d66c84400a583b63536be06a70423c4f05e547280f06368851a43720ac941efedf3aeb17a314ff3c9f61a14
|
@@ -74,7 +74,7 @@ module Contrast
|
|
74
74
|
# reporting.
|
75
75
|
#
|
76
76
|
# @param hash_or_str [Hash, String]
|
77
|
-
# @return [Contrast::Api::Dtm::ArchitectureComponent]
|
77
|
+
# @return [Array<Contrast::Api::Dtm::ArchitectureComponent>, nil]
|
78
78
|
def build_from_db_config hash_or_str
|
79
79
|
return unless hash_or_str
|
80
80
|
|
@@ -89,7 +89,7 @@ module Contrast
|
|
89
89
|
# understandable by TeamServer.
|
90
90
|
#
|
91
91
|
# @param hash [Hash] the information used to open a database connection
|
92
|
-
# @return [Contrast::Api::Dtm::ArchitectureComponent]
|
92
|
+
# @return [Array<Contrast::Api::Dtm::ArchitectureComponent>]
|
93
93
|
def build_from_db_hash hash
|
94
94
|
ac = Contrast::Api::Dtm::ArchitectureComponent.build_database
|
95
95
|
ac.vendor = hash[:adapter] || hash[ADAPTER] || Contrast::Utils::ObjectShare::EMPTY_STRING
|
@@ -122,9 +122,11 @@ module Contrast
|
|
122
122
|
# mysql+mysqlconnector://scott:tiger@localhost/foo # pragma: allowlist secret
|
123
123
|
#
|
124
124
|
# @param str [String] the DB connection string
|
125
|
-
# @return [Contrast::Api::Dtm::ArchitectureComponent]
|
125
|
+
# @return [Array<Contrast::Api::Dtm::ArchitectureComponent>, nil]
|
126
126
|
def build_from_db_string str
|
127
127
|
adapter, hosts, database = split_connection_str(str)
|
128
|
+
return unless adapter && hosts && database
|
129
|
+
|
128
130
|
acs = []
|
129
131
|
hosts.split(Contrast::Utils::ObjectShare::COMMA).map do |s|
|
130
132
|
host, port = s.split(Contrast::Utils::ObjectShare::COLON)
|
@@ -143,13 +145,19 @@ module Contrast
|
|
143
145
|
# generation of a Contrast::Api::Dtm::ArchitectureComponent
|
144
146
|
#
|
145
147
|
# @param str [String] the DB connection string
|
146
|
-
# @return [Array<String
|
148
|
+
# @return [Array<String>, nil] the adapter, hosts, and database
|
147
149
|
def split_connection_str str
|
148
150
|
adapter, str = str.split(Contrast::Utils::ObjectShare::COLON_SLASH_SLASH)
|
151
|
+
return unless str
|
152
|
+
|
149
153
|
_auth, str = str.split(Contrast::Utils::ObjectShare::AT)
|
154
|
+
return unless str
|
155
|
+
|
150
156
|
# Not currently used
|
151
157
|
# user, pass = auth.split(Contrast::Utils::ObjectShare::COLON)
|
152
158
|
hosts, db_and_options = str.split(Contrast::Utils::ObjectShare::SLASH)
|
159
|
+
return unless db_and_options
|
160
|
+
|
153
161
|
hosts << LOCALHOST if hosts.empty?
|
154
162
|
database, _options = db_and_options.split(Contrast::Utils::ObjectShare::QUESTION_MARK)
|
155
163
|
|