eac_rest 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eac_rest/api.rb +5 -2
- data/lib/eac_rest/request.rb +22 -1
- data/lib/eac_rest/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: 9e61a282ddea34e4c91a02b4e00029ebe618d6b4ec6e0e8e19341efd1133a495
|
4
|
+
data.tar.gz: 27459c0f50091b22a719a9e969e775caf90946c539147ca97189f0202279fd87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d0c93473149b8688bd9ae95ed4079609f5c48b8a6d5d1a0ce26de10af8577055c2966a18428482cb80b407e6c478eda0390172e972e6b3d698dba0c40916c09
|
7
|
+
data.tar.gz: 689cd7e948b2b59b3e2c0a5e530eb14e16c59bfdad5fb148c681b64e1cab1825ee2b1502fedc6f619af5be4deb0be0adcbc6f086ffcae452faad2deccf34d0fa
|
data/lib/eac_rest/api.rb
CHANGED
@@ -8,11 +8,14 @@ module EacRest
|
|
8
8
|
# * self.issue_get_url_suffix(provider_issue_id)
|
9
9
|
class Api
|
10
10
|
require_sub __FILE__, include_modules: true
|
11
|
-
|
11
|
+
attr_accessor :ssl_verify
|
12
|
+
common_constructor :root_url, :username, :password, default: [nil, nil] do
|
13
|
+
self.ssl_verify = true
|
14
|
+
end
|
12
15
|
|
13
16
|
def request(service_url_suffix, headers = {}, &body_data_proc)
|
14
17
|
r = ::EacRest::Request.new(build_service_url(service_url_suffix),
|
15
|
-
body_data_proc)
|
18
|
+
body_data_proc).ssl_verify(ssl_verify)
|
16
19
|
headers.each { |name, value| r = r.header(name, value) }
|
17
20
|
r = r.autenticate(username, password) if username.present?
|
18
21
|
r
|
data/lib/eac_rest/request.rb
CHANGED
@@ -7,11 +7,13 @@ require 'ostruct'
|
|
7
7
|
|
8
8
|
module EacRest
|
9
9
|
class Request
|
10
|
+
BOOLEAN_MODIFIERS = %w[ssl_verify ssl_verify_peer ssl_verify_host].freeze
|
10
11
|
COMMON_MODIFIERS = %w[auth body_data verb].freeze
|
11
12
|
HASH_MODIFIERS = %w[header].freeze
|
12
|
-
MODIFIERS = COMMON_MODIFIERS + HASH_MODIFIERS.map(&:pluralize)
|
13
|
+
MODIFIERS = COMMON_MODIFIERS + BOOLEAN_MODIFIERS + HASH_MODIFIERS.map(&:pluralize)
|
13
14
|
|
14
15
|
enable_immutable
|
16
|
+
immutable_accessor(*BOOLEAN_MODIFIERS, type: :boolean)
|
15
17
|
immutable_accessor(*COMMON_MODIFIERS, type: :common)
|
16
18
|
immutable_accessor(*HASH_MODIFIERS, type: :hash)
|
17
19
|
|
@@ -56,6 +58,25 @@ module EacRest
|
|
56
58
|
curl.headers.merge!(headers)
|
57
59
|
end
|
58
60
|
|
61
|
+
def build_curl_ssl_verify(curl)
|
62
|
+
return if ssl_verify?.nil?
|
63
|
+
|
64
|
+
curl.ssl_verify_host = ssl_verify?
|
65
|
+
curl.ssl_verify_peer = ssl_verify?
|
66
|
+
end
|
67
|
+
|
68
|
+
def build_curl_ssl_verify_peer(curl)
|
69
|
+
return if ssl_verify_peer?.nil?
|
70
|
+
|
71
|
+
curl.ssl_verify_peer = ssl_verify_peer?
|
72
|
+
end
|
73
|
+
|
74
|
+
def build_curl_ssl_verify_host(curl)
|
75
|
+
return if ssl_verify_host?.nil?
|
76
|
+
|
77
|
+
curl.ssl_verify_peer = ssl_verify_host?
|
78
|
+
end
|
79
|
+
|
59
80
|
def build_curl_verb(curl)
|
60
81
|
curl.set(
|
61
82
|
:customrequest,
|
data/lib/eac_rest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo H. Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eac_ruby_utils
|