uc3-dmp-external-api 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-external-api/client.rb +3 -2
- data/lib/uc3-dmp-external-api/version.rb +1 -1
- 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: 3dcc09638fbcc4da99904246c145c4c8622e416960aea9a9807fd55c50d8cacf
|
4
|
+
data.tar.gz: ec892e6e99e5f4b85db275b2acbb0ad300b7697d9e59215edd6715a01aaa3581
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88efda8dbe66252392fe49b10d80fda286251db33ad6a659a93c4b500d3518ebb6298f0e89c57f017902bc65ab5386d9b055cd1c1cbf7f6b2332264eca07b43d
|
7
|
+
data.tar.gz: 79695db7a217a21e5b155e07340fc6719ffab6e1a0c2b6bf02ae6227d8da70d825245c73c5d84d58b69ae86f2c1e76c3effd521cb8317afe2859e6a3aebc874b
|
@@ -18,11 +18,11 @@ module Uc3DmpExternalApi
|
|
18
18
|
class << self
|
19
19
|
# Call the specified URL using the specified HTTP method, body and headers
|
20
20
|
# rubocop:disable Metrics/AbcSize
|
21
|
-
def call(url:, method: :get, body: '', additional_headers: {}, logger: nil)
|
21
|
+
def call(url:, method: :get, body: '', basic_auth: {}, additional_headers: {}, logger: nil)
|
22
22
|
uri = URI(url)
|
23
23
|
# Skip the body if we are doing a get
|
24
24
|
body = nil if method.to_sym == :get
|
25
|
-
opts = _options(body: body, additional_headers: additional_headers, logger: logger)
|
25
|
+
opts = _options(body: body, basic_auth: basic_auth, additional_headers: additional_headers, logger: logger)
|
26
26
|
resp = HTTParty.send(method.to_sym, uri, opts)
|
27
27
|
|
28
28
|
if resp.code != 200
|
@@ -69,6 +69,7 @@ module Uc3DmpExternalApi
|
|
69
69
|
follow_redirects: true,
|
70
70
|
limit: 6
|
71
71
|
}
|
72
|
+
opts[:basic_auth] = basic_auth if basic_auth.is_a?(Hash)
|
72
73
|
# If the body is not already JSON and we intend to send JSON, convert it
|
73
74
|
opts[:body] = body.is_a?(Hash) && hdrs['Content-Type'] == 'application/json' ? body.to_json : body
|
74
75
|
# If debug is enabled then tap into the HTTParty gem's debug option
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc3-dmp-external-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sns
|