uc3-dmp-external-api 0.0.20 → 0.0.21
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 +4 -3
- 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: f8c058494e86730fdf579547d77158e5cb95679462ce49f3347b238aaef2dc8a
|
4
|
+
data.tar.gz: 7a14528690fa6ae96f199cd2fe108152b4734097570034e32bcd1382b3ab83cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c923762dc8496373a5642b8a3da41e0c256ccb6a511a5f1c197cae2722e501616812f34c36aab5878b006a42ab45f1c55c235c5af0be5069063acec4b2a9a6d
|
7
|
+
data.tar.gz: 2425c8fe5001b00f24bd5de0c569be9ee465f3f4d8b0a793120ff834d49c07e1c07a92c90d194bfb5121658525374c8ba3ba73f832bdc6d1b0b722aae3d5e203
|
@@ -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, Metrics/ParameterLists
|
21
|
-
def call(url:, method: :get, body: '', basic_auth: {}, additional_headers: {}, logger: nil)
|
21
|
+
def call(url:, method: :get, body: '', basic_auth: {}, additional_headers: {}, timeout: 10, 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:, basic_auth:, additional_headers:, logger:)
|
25
|
+
opts = _options(body:, basic_auth:, additional_headers:, timeout:, logger:)
|
26
26
|
resp = HTTParty.send(method.to_sym, uri, opts)
|
27
27
|
|
28
28
|
unless [200, 201].include?(resp.code)
|
@@ -64,11 +64,12 @@ module Uc3DmpExternalApi
|
|
64
64
|
end
|
65
65
|
|
66
66
|
# Prepare the HTTParty gem options
|
67
|
-
def _options(body:, basic_auth: nil, additional_headers: {}, logger: nil)
|
67
|
+
def _options(body:, basic_auth: nil, additional_headers: {}, timeout: 10, logger: nil)
|
68
68
|
hdrs = _headers(additional_headers:)
|
69
69
|
opts = {
|
70
70
|
headers: hdrs,
|
71
71
|
follow_redirects: true,
|
72
|
+
timeout:,
|
72
73
|
limit: 6
|
73
74
|
}
|
74
75
|
opts[:basic_auth] = basic_auth if basic_auth.is_a?(Hash) && basic_auth.keys.any?
|
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.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Riley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sns
|