uc3-dmp-external-api 0.0.20 → 0.0.22

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: 1a92ee0736f47ac2ff52f7e661c150e80ede4a2fe5a6950d3299487fb33834c1
4
+ data.tar.gz: 0745cacf33055db58fa55249eb4c16cdfec483179cc27cec153669c28d8cd5ed
5
5
  SHA512:
6
- metadata.gz: 73212fffa7074aaf31638a5a14e70429dc2916cc24ece9666cc98af2a928541024bd215329279825149a3070b1481ae3cba29f73f4f7536ea5750909c1c41b03
7
- data.tar.gz: 980063a3cde752cdd289a89ef7bd39d836da49ee9e83c31ade76160bf8a5e72f28220d6774c80b3c0621e2c09b88a3657bb2c69ea9910ac3c7e2d36796645102
6
+ metadata.gz: 683297d4cfb646b905e7527c382f785a15e0a7a33800a232021d65974210288cc57ec1b71a5546d57b0e0afd93d9ec2704ae0a3c683aae8d2072aaba4e3eb055
7
+ data.tar.gz: 1897e1b7d8430bc120ec8908f71c11e8e1d9f5f5024447390db468990743930d74860c5c11589aae87d4fceccd00cb312b29d221dcfbeef1f025c46e74018a1c
@@ -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.22'
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.22
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-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sns