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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d81cb7f9cbee4f822a3f4ff5ead07879586a5efe3c4e0c2f799f92079382a92
4
- data.tar.gz: 76f9e493bb62e76b3c047f178496627001020c211a3351f1dac1a3d92ca6120f
3
+ metadata.gz: f8c058494e86730fdf579547d77158e5cb95679462ce49f3347b238aaef2dc8a
4
+ data.tar.gz: 7a14528690fa6ae96f199cd2fe108152b4734097570034e32bcd1382b3ab83cd
5
5
  SHA512:
6
- metadata.gz: 73212fffa7074aaf31638a5a14e70429dc2916cc24ece9666cc98af2a928541024bd215329279825149a3070b1481ae3cba29f73f4f7536ea5750909c1c41b03
7
- data.tar.gz: 980063a3cde752cdd289a89ef7bd39d836da49ee9e83c31ade76160bf8a5e72f28220d6774c80b3c0621e2c09b88a3657bb2c69ea9910ac3c7e2d36796645102
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpExternalApi
4
- VERSION = '0.0.20'
4
+ VERSION = '0.0.21'
5
5
  end
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.20
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-01-31 00:00:00.000000000 Z
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