global_sign 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -0
- data/lib/global_sign.rb +2 -0
- data/lib/global_sign/client.rb +6 -1
- data/lib/global_sign/dv_approver_list.rb +2 -0
- data/lib/global_sign/dv_approver_list/request.rb +27 -0
- data/lib/global_sign/dv_approver_list/response.rb +33 -0
- data/lib/global_sign/dv_order.rb +2 -0
- data/lib/global_sign/dv_order/request.rb +72 -0
- data/lib/global_sign/dv_order/response.rb +19 -0
- data/lib/global_sign/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b61f4c3a95b781f91f21f77edbe3536de9a029af
|
4
|
+
data.tar.gz: a7f875c2e646bc51e608408fdf95fb2b6e53b1e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4382bee9a338e265906f0a6d2903e650617b8afe41b747a3e0b5b183f7798d8f9c49db5659c243a02680b543d11966de3b54564af40206ff6a00d9ab4c00c14
|
7
|
+
data.tar.gz: def1382d5dc859cf74b6511207eedee1b1c1c959589c090513f8f5996135f93cc1dfc1ad982152a832bc61e1ee03ff5442f420e8943ad3de2cab6c9464c5a3c3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 2.2.0
|
2
|
+
|
3
|
+
- Added `options` optional keyword argument to `GlobalSign::Client`
|
4
|
+
- It supports `timeout` which specifies number of seconds to wait for request
|
5
|
+
|
1
6
|
## 2.1.1
|
2
7
|
- Fixed bug: `GlobalSign::OrderGetterByOrderId::Request` NoMethodError: undefined method `text` for nil:NilClass
|
3
8
|
|
data/README.md
CHANGED
@@ -236,6 +236,15 @@ response = client.process(request)
|
|
236
236
|
puts response.params # => { common_name: "www.example.com", ... }
|
237
237
|
```
|
238
238
|
|
239
|
+
### Client options
|
240
|
+
|
241
|
+
`GlobalSign::Client` allows `options` argument in order to specify its behavior.
|
242
|
+
For now, it supports `timeout` which specifies number of seconds to wait for request.
|
243
|
+
|
244
|
+
```ruby
|
245
|
+
client = GlobalSign::Client.new(options: { timeout: 120 })
|
246
|
+
```
|
247
|
+
|
239
248
|
## Contributing
|
240
249
|
|
241
250
|
1. Create your feature branch (git checkout -b my-new-feature)
|
data/lib/global_sign.rb
CHANGED
@@ -14,6 +14,8 @@ require 'global_sign/order_getter_by_order_id'
|
|
14
14
|
require 'global_sign/csr_decoder'
|
15
15
|
require 'global_sign/dns_verification'
|
16
16
|
require 'global_sign/dns_verification_for_issue'
|
17
|
+
require 'global_sign/dv_approver_list'
|
18
|
+
require 'global_sign/dv_order'
|
17
19
|
|
18
20
|
module GlobalSign
|
19
21
|
class << self
|
data/lib/global_sign/client.rb
CHANGED
@@ -2,12 +2,13 @@ require 'faraday'
|
|
2
2
|
|
3
3
|
module GlobalSign
|
4
4
|
class Client
|
5
|
-
def initialize
|
5
|
+
def initialize(options: {})
|
6
6
|
@configuration = GlobalSign.configuration
|
7
7
|
|
8
8
|
@connection = Faraday::Connection.new(url: @configuration.endpoint) do |conn|
|
9
9
|
conn.request :url_encoded
|
10
10
|
conn.adapter Faraday.default_adapter
|
11
|
+
conn.options[:timeout] = options[:timeout] if options[:timeout].present?
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
@@ -37,6 +38,10 @@ module GlobalSign
|
|
37
38
|
GlobalSign::UrlVerificationForIssue::Response
|
38
39
|
when GlobalSign::OrderGetterByOrderId::Request
|
39
40
|
GlobalSign::OrderGetterByOrderId::Response
|
41
|
+
when GlobalSign::DVApproverList::Request
|
42
|
+
GlobalSign::DVApproverList::Response
|
43
|
+
when GlobalSign::DVOrder::Request
|
44
|
+
GlobalSign::DVOrder::Response
|
40
45
|
else
|
41
46
|
raise ArgumentError, 'invalid request argument'
|
42
47
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module GlobalSign
|
2
|
+
module DVApproverList
|
3
|
+
class Request < GlobalSign::Request
|
4
|
+
def initialize(fqdn)
|
5
|
+
@fqdn = fqdn
|
6
|
+
end
|
7
|
+
|
8
|
+
def path
|
9
|
+
'ServerSSLService'
|
10
|
+
end
|
11
|
+
|
12
|
+
def action
|
13
|
+
'GetDVApproverList'
|
14
|
+
end
|
15
|
+
|
16
|
+
def request_header
|
17
|
+
:QueryRequestHeader
|
18
|
+
end
|
19
|
+
|
20
|
+
def params
|
21
|
+
{
|
22
|
+
FQDN: @fqdn
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module GlobalSign
|
2
|
+
module DVApproverList
|
3
|
+
class Response < GlobalSign::Response
|
4
|
+
module XPath
|
5
|
+
ORDER_ID = '//Response/OrderID'.freeze
|
6
|
+
APPROVERS = '//Response/Approvers'.freeze
|
7
|
+
SEARCH_ORDER_DETAIL = '//Approvers/SearchOrderDetail'.freeze
|
8
|
+
end
|
9
|
+
|
10
|
+
def response_header
|
11
|
+
:QueryResponseHeader
|
12
|
+
end
|
13
|
+
|
14
|
+
def params
|
15
|
+
@params ||= {
|
16
|
+
order_id: @xml.xpath(XPath::ORDER_ID).text,
|
17
|
+
approvers: approvers_list
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def approvers_list
|
24
|
+
@approvers ||= @xml.xpath(XPath::SEARCH_ORDER_DETAIL).map do |approver|
|
25
|
+
{
|
26
|
+
type: approver.xpath('ApproverType').text,
|
27
|
+
email: approver.xpath('ApproverEmail').text
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module GlobalSign
|
2
|
+
module DVOrder
|
3
|
+
class Request < GlobalSign::Request
|
4
|
+
KIND_RENEWAL = 'renewal'.freeze
|
5
|
+
|
6
|
+
def initialize(product_code:, order_kind:, validity_period_months:, csr:, approver_email:, order_id:, renewal_target_order_id: nil, contract_info: nil)
|
7
|
+
@product_code = product_code
|
8
|
+
@order_kind = order_kind
|
9
|
+
@validity_period_months = validity_period_months
|
10
|
+
@csr = csr
|
11
|
+
@approver_email = approver_email
|
12
|
+
@order_id = order_id
|
13
|
+
@renewal_target_order_id = renewal_target_order_id
|
14
|
+
@contract_info = contract_info || GlobalSign.contract
|
15
|
+
end
|
16
|
+
|
17
|
+
def path
|
18
|
+
'ServerSSLService'
|
19
|
+
end
|
20
|
+
|
21
|
+
def action
|
22
|
+
'DVOrder'
|
23
|
+
end
|
24
|
+
|
25
|
+
def request_header
|
26
|
+
:OrderRequestHeader
|
27
|
+
end
|
28
|
+
|
29
|
+
def params
|
30
|
+
@params = {
|
31
|
+
OrderRequestParameter: order_request_parameter,
|
32
|
+
OrderID: @order_id,
|
33
|
+
ApproverEmail: @approver_email,
|
34
|
+
ContactInfo: contact_info
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def order_request_parameter
|
41
|
+
request_params.tap do |params|
|
42
|
+
params[:RenewalTargetOrderID] = @renewal_target_order_id if renew?
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def request_params
|
47
|
+
{
|
48
|
+
ProductCode: @product_code,
|
49
|
+
OrderKind: @order_kind,
|
50
|
+
Licenses: 1,
|
51
|
+
ValidityPeriod: {
|
52
|
+
Months: @validity_period_months
|
53
|
+
},
|
54
|
+
CSR: @csr
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
def contact_info
|
59
|
+
{
|
60
|
+
FirstName: @contract_info.first_name,
|
61
|
+
LastName: @contract_info.last_name,
|
62
|
+
Phone: @contract_info.phone_number,
|
63
|
+
Email: @contract_info.email
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
def renew?
|
68
|
+
@order_kind == KIND_RENEWAL
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module GlobalSign
|
2
|
+
module DVOrder
|
3
|
+
class Response < GlobalSign::Response
|
4
|
+
module XPath
|
5
|
+
ORDER_ID = '//Response/OrderID'.freeze
|
6
|
+
end
|
7
|
+
|
8
|
+
def response_header
|
9
|
+
:OrderResponseHeader
|
10
|
+
end
|
11
|
+
|
12
|
+
def params
|
13
|
+
@params ||= {
|
14
|
+
order_id: @xml.xpath(XPath::ORDER_ID).text
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/global_sign/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: global_sign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ku00
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -194,6 +194,12 @@ files:
|
|
194
194
|
- lib/global_sign/dns_verification_for_issue.rb
|
195
195
|
- lib/global_sign/dns_verification_for_issue/request.rb
|
196
196
|
- lib/global_sign/dns_verification_for_issue/response.rb
|
197
|
+
- lib/global_sign/dv_approver_list.rb
|
198
|
+
- lib/global_sign/dv_approver_list/request.rb
|
199
|
+
- lib/global_sign/dv_approver_list/response.rb
|
200
|
+
- lib/global_sign/dv_order.rb
|
201
|
+
- lib/global_sign/dv_order/request.rb
|
202
|
+
- lib/global_sign/dv_order/response.rb
|
197
203
|
- lib/global_sign/order_getter_by_order_id.rb
|
198
204
|
- lib/global_sign/order_getter_by_order_id/request.rb
|
199
205
|
- lib/global_sign/order_getter_by_order_id/response.rb
|
@@ -229,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
235
|
version: '0'
|
230
236
|
requirements: []
|
231
237
|
rubyforge_project:
|
232
|
-
rubygems_version: 2.
|
238
|
+
rubygems_version: 2.6.13
|
233
239
|
signing_key:
|
234
240
|
specification_version: 4
|
235
241
|
summary: A Ruby interface to the GlobalSign API.
|