contrast-agent 6.1.1 → 6.1.2

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: e548b3df856f888229a5125c351404c3f5b04fcd7ecb5c91937f480ce91c9d42
4
- data.tar.gz: 00c6ee55996e75602d1b80da133a362d3205cb5ef5de0f5c1a35b214528fea2a
3
+ metadata.gz: c901ed882ebff8176fe2f3794907e29b03cc2903b61260f138d93b2ef02a465c
4
+ data.tar.gz: 72e4f01ccf5a57bbd5afa0cac58c51cddbe26183691d9495f563dfd9fb37e7e1
5
5
  SHA512:
6
- metadata.gz: ad8d0f64dc798a22072e977cf0ff83ba47df54a3f24802386a52d2d338f365a02cac5db943868a55ecdf7641e44384f580e55e5d1b05a78522e88c5244013346
7
- data.tar.gz: 804a464d38a9e023da53ce82009573571a6197c9f3f00642988457ac32b8ecc8631ea0a3cfd8bc678918df8afbb1cb24c51fa79dff1fe8fb278c5e966bff74e1
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>] the adapter, hosts, and database
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
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Contrast
5
5
  module Agent
6
- VERSION = '6.1.1'
6
+ VERSION = '6.1.2'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com