xolphin-api 1.5.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +13 -12
- data/.rspec +2 -2
- data/.rubocop.yml +28 -28
- data/.travis.yml +5 -5
- data/CHANGELOG.md +19 -0
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +169 -169
- data/Rakefile +12 -12
- data/bin/console +14 -14
- data/bin/setup +8 -8
- data/examples/_credentials.rb +9 -8
- data/examples/certificate_cancel.rb +6 -6
- data/examples/certificate_reissue.rb +23 -25
- data/examples/certificate_renew.rb +22 -22
- data/examples/get_notes.rb +9 -9
- data/examples/invoices_get.rb +7 -0
- data/examples/request_create.rb +40 -0
- data/examples/request_create_ee.rb +29 -29
- data/examples/request_get_id.rb +6 -0
- data/examples/request_validation_call.rb +6 -5
- data/examples/requests_get.rb +8 -7
- data/examples/send_csa_email.rb +5 -5
- data/examples/send_note.rb +6 -6
- data/lib/xolphin/api/certificate_requests/certificate_reissue.rb +54 -47
- data/lib/xolphin/api/certificate_requests/certificate_renew.rb +58 -51
- data/lib/xolphin/api/certificate_requests/create_certificate_request.rb +59 -52
- data/lib/xolphin/api/certificate_requests/create_ee_request.rb +28 -33
- data/lib/xolphin/api/client.rb +25 -21
- data/lib/xolphin/api/dcv_type.rb +9 -9
- data/lib/xolphin/api/endpoint/certificate.rb +59 -59
- data/lib/xolphin/api/endpoint/invoice.rb +40 -0
- data/lib/xolphin/api/endpoint/request.rb +116 -86
- data/lib/xolphin/api/endpoint/support.rb +47 -47
- data/lib/xolphin/api/format_type.rb +12 -12
- data/lib/xolphin/api/http.rb +70 -67
- data/lib/xolphin/api/invoice_format_type.rb +8 -0
- data/lib/xolphin/api/product_type.rb +9 -9
- data/lib/xolphin/api/responses/base.rb +43 -43
- data/lib/xolphin/api/responses/certificate.rb +53 -53
- data/lib/xolphin/api/responses/certificates.rb +25 -25
- data/lib/xolphin/api/responses/csr_data.rb +43 -43
- data/lib/xolphin/api/responses/invoice.rb +57 -0
- data/lib/xolphin/api/responses/invoices.rb +25 -0
- data/lib/xolphin/api/responses/note.rb +45 -37
- data/lib/xolphin/api/responses/notes.rb +23 -24
- data/lib/xolphin/api/responses/product.rb +53 -53
- data/lib/xolphin/api/responses/product_price.rb +27 -27
- data/lib/xolphin/api/responses/products.rb +25 -25
- data/lib/xolphin/api/responses/request.rb +142 -119
- data/lib/xolphin/api/responses/request_ee.rb +29 -29
- data/lib/xolphin/api/responses/request_validation.rb +37 -37
- data/lib/xolphin/api/responses/request_validation_domain.rb +51 -35
- data/lib/xolphin/api/responses/requests.rb +25 -25
- data/lib/xolphin/api/responses/validation_call.rb +23 -0
- data/lib/xolphin/api/responses/validation_calls.rb +25 -0
- data/lib/xolphin/api/version.rb +5 -5
- data/lib/xolphin/api.rb +38 -32
- data/xolphin-api.gemspec +25 -26
- metadata +19 -9
- data/xolphin-api-0.1.0.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0b37e70b0b2c0f01661f2a47efffaeec51c13c537df04934e463fadc2551a45d
|
4
|
+
data.tar.gz: a90dc771d67d2a0f0dbdc7f265b6c86ff20ef80cf1416aee823fe7f06dde6af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1bd2ac569ee9d8a7739b26eebf19b71a33dad0860798869fba44bb4faadfd0e01aad58f8f6a56efa07e493762738f34963cf2b0a1c3e3520d07897265b9fd41
|
7
|
+
data.tar.gz: cee4ebd929af45ac28d6c45d59ff9450defebc51842ff7cb200fd93287f4dd6052e9c6ca591b63bca64a5b5c2f3a89dbbe0658210975e20cdacaaf587723574f
|
data/.gitignore
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
/.
|
2
|
-
/.
|
3
|
-
|
4
|
-
/
|
5
|
-
/
|
6
|
-
/
|
7
|
-
/
|
8
|
-
/
|
9
|
-
/
|
10
|
-
|
11
|
-
.ruby-
|
12
|
-
.
|
1
|
+
/.idea
|
2
|
+
/.bundle/
|
3
|
+
/.yardoc
|
4
|
+
/Gemfile.lock
|
5
|
+
/_yardoc/
|
6
|
+
/coverage/
|
7
|
+
/doc/
|
8
|
+
/pkg/
|
9
|
+
/spec/reports/
|
10
|
+
/tmp/
|
11
|
+
.ruby-version
|
12
|
+
.ruby-gemset
|
13
|
+
.DS_Store
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
--format documentation
|
2
|
-
--color
|
1
|
+
--format documentation
|
2
|
+
--color
|
data/.rubocop.yml
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
# Xolphin-API RuboCop configuration
|
2
|
-
|
3
|
-
AllCops:
|
4
|
-
TargetRubyVersion: 2.2
|
5
|
-
DisplayCopNames: true
|
6
|
-
DisplayStyleGuide: true
|
7
|
-
|
8
|
-
Metrics/AbcSize:
|
9
|
-
Enabled: false
|
10
|
-
|
11
|
-
Metrics/LineLength:
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
Metrics/MethodLength:
|
15
|
-
Enabled: false
|
16
|
-
|
17
|
-
Style/Documentation:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Style/NumericLiterals:
|
21
|
-
Exclude:
|
22
|
-
- 'spec/**/*.rb'
|
23
|
-
|
24
|
-
Style/MutableConstant:
|
25
|
-
Enabled: false
|
26
|
-
|
27
|
-
Style/StringLiterals:
|
28
|
-
Enabled: false
|
1
|
+
# Xolphin-API RuboCop configuration
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.2
|
5
|
+
DisplayCopNames: true
|
6
|
+
DisplayStyleGuide: true
|
7
|
+
|
8
|
+
Metrics/AbcSize:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Metrics/LineLength:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Metrics/MethodLength:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/Documentation:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Style/NumericLiterals:
|
21
|
+
Exclude:
|
22
|
+
- 'spec/**/*.rb'
|
23
|
+
|
24
|
+
Style/MutableConstant:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Style/StringLiterals:
|
28
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.2.5
|
5
|
-
before_install: gem install bundler -v 1.13.6
|
1
|
+
sudo: false
|
2
|
+
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 2.2.5
|
5
|
+
before_install: gem install bundler -v 1.13.6
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
## [1.8.0] - 2020-03-02
|
5
|
+
### Added
|
6
|
+
- Certificate Requests: Support the new validation information from Comodo
|
7
|
+
- Certificate Requests: Added method for cancelling a request
|
8
|
+
- Certificate Requests: Added some missing properties
|
9
|
+
- Certificate Requests: Added support for scheduling validation calls
|
10
|
+
- Invoices: Added invoices endpoints
|
11
|
+
|
12
|
+
## [1.5.0] - 2017-06-07
|
13
|
+
### Added
|
14
|
+
- Certificates: Reissue and renewal of certificates
|
15
|
+
- Certificate Requests: Get and send notes linked to an order
|
16
|
+
- Certificate Requests: Send Subscriber Agreement
|
17
|
+
- Certificate Requests: Resend DCV email
|
18
|
+
- Certificate Requests: You can now send a language parameter with the request, which will be used for (eg) the Subscriber Agreement
|
19
|
+
- Certificate Requests: A new field 'brandValidation' is added, which is used to indicate if the request is being held for review due to specific brand names
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in xolphin-api.gemspec
|
4
|
-
gemspec
|
5
|
-
|
6
|
-
gem 'rubocop', '~> 0.45.0'
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in xolphin-api.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'rubocop', '~> 0.45.0'
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2016 Kentaa
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Kentaa
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,169 +1,169 @@
|
|
1
|
-
# Xolphin API gem for Ruby
|
2
|
-
xolphin-api-ruby is a library which allows quick integration of the [Xolphin REST API](https://api.xolphin.com) in Ruby to automated ordering, issuance and installation of SSL Certificates.
|
3
|
-
|
4
|
-
## About Xolphin
|
5
|
-
[Xolphin](https://www.xolphin.nl/) is the largest supplier of [SSL Certificates](https://www.sslcertificaten.nl) and [Digital Signatures](https://www.digitalehandtekeningen.nl) in the Netherlands. Xolphin has
|
6
|
-
a professional team providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands such as Comodo, GeoTrust, GlobalSign, Thawte and Symantec.
|
7
|
-
|
8
|
-
## Installation
|
9
|
-
|
10
|
-
Add this line to your application's Gemfile:
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
gem 'xolphin-api'
|
14
|
-
```
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
$ bundle
|
19
|
-
|
20
|
-
Or install it yourself as:
|
21
|
-
|
22
|
-
$ gem install xolphin-api
|
23
|
-
|
24
|
-
## Usage
|
25
|
-
|
26
|
-
### Client initialization
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
require 'xolphin/api'
|
30
|
-
|
31
|
-
client = Xolphin::Api::Client.new('<username>', '<password>')
|
32
|
-
```
|
33
|
-
|
34
|
-
### Requests
|
35
|
-
|
36
|
-
#### Getting list of requests
|
37
|
-
|
38
|
-
```ruby
|
39
|
-
requests = client.request.all
|
40
|
-
requests.each do |request|
|
41
|
-
puts request.id, request.product.id
|
42
|
-
end
|
43
|
-
```
|
44
|
-
|
45
|
-
#### Getting request by ID
|
46
|
-
|
47
|
-
```ruby
|
48
|
-
request = client.request.get(960000024)
|
49
|
-
puts request.product.brand
|
50
|
-
```
|
51
|
-
|
52
|
-
#### Requesting certificate
|
53
|
-
|
54
|
-
```ruby
|
55
|
-
ccr = client.request.create(24, 1, 'csr string', Xolphin::Api::DcvType::EMAIL)
|
56
|
-
ccr.address = 'Address'
|
57
|
-
ccr.approver_first_name = 'FirstName'
|
58
|
-
ccr.approver_last_name = 'LastName'
|
59
|
-
ccr.approver_phone = '+12345678901'
|
60
|
-
ccr.approver_email = 'email@domain.com'
|
61
|
-
ccr.zipcode = '123456'
|
62
|
-
ccr.city = 'City'
|
63
|
-
ccr.company = 'Company'
|
64
|
-
ccr.subject_alternative_names = ['test1.domain.com', 'test2.domain.com']
|
65
|
-
ccr.dcv = [{
|
66
|
-
'domain' => 'test1.domain.com',
|
67
|
-
'dcvType' => Xolphin::Api::DcvType::EMAIL,
|
68
|
-
'approverEmail' => 'email@domain.com'
|
69
|
-
}]
|
70
|
-
|
71
|
-
request = client.request.send(ccr)
|
72
|
-
puts request.id
|
73
|
-
```
|
74
|
-
|
75
|
-
#### Reissue certificate
|
76
|
-
|
77
|
-
```ruby
|
78
|
-
certificate = client.certificate.get(<certificate_id>);
|
79
|
-
request = Xolphin::Api::CertificateRequests::ReissueCertificateRequest.new(<csr_string>,"EMAIL")
|
80
|
-
client.certificate.reissue(certificate.id, request)
|
81
|
-
```
|
82
|
-
|
83
|
-
#### Renew certificate
|
84
|
-
|
85
|
-
```ruby
|
86
|
-
certificate = client.certificate.get(<certificate_id>);
|
87
|
-
request = Xolphin::Api::CertificateRequests::RenewCertificateRequest.new(certificate.product.id, <years>, <csr_string>, 'FILE')
|
88
|
-
client.certificate.renew(certificate.id, request)
|
89
|
-
```
|
90
|
-
|
91
|
-
#### Create a note
|
92
|
-
|
93
|
-
```ruby
|
94
|
-
result = client.request.sendNote(1234, 'message')
|
95
|
-
```
|
96
|
-
|
97
|
-
#### Get list of notes
|
98
|
-
|
99
|
-
```ruby
|
100
|
-
result = client.request.getNotes(1234)
|
101
|
-
result.notes.each do |note|
|
102
|
-
puts note.message_body, note.created_at
|
103
|
-
end
|
104
|
-
```
|
105
|
-
|
106
|
-
#### Send a "Comodo Subscriber Agreement" email
|
107
|
-
|
108
|
-
```ruby
|
109
|
-
# currently available languages: en, de, fr, nl
|
110
|
-
result = client.request.sendComodoSAEmail(1234, 'email@example.com', '<language>');
|
111
|
-
```
|
112
|
-
|
113
|
-
#### Request an "Encryption Everywhere" certificate
|
114
|
-
```ruby
|
115
|
-
request = client.request.createEE
|
116
|
-
request.csr = "<csr_string>"
|
117
|
-
request.approver_first_name = "FirstName"
|
118
|
-
request.approver_last_name = "LastName"
|
119
|
-
request.approver_phone = "+1234567890"
|
120
|
-
request.approver_email = "email@domain.com"
|
121
|
-
request.subject_alternative_names = ["test1.domain.com", "test2.domain.com"]
|
122
|
-
request.dcv_type = "FILE"
|
123
|
-
response = client.request.sendEE(request)
|
124
|
-
```
|
125
|
-
|
126
|
-
### Certificate
|
127
|
-
|
128
|
-
#### Certificates list and expirations
|
129
|
-
|
130
|
-
```ruby
|
131
|
-
certificates = client.certificate.all
|
132
|
-
certificates.each do |certificate|
|
133
|
-
puts certificate.id, certificate.expired?
|
134
|
-
end
|
135
|
-
```
|
136
|
-
|
137
|
-
#### Download certificate
|
138
|
-
|
139
|
-
```ruby
|
140
|
-
certificate = client.certificate.download(960000031, Xolphin::Api::FormatType::CRT)
|
141
|
-
File.write('crt.crt', certificate)
|
142
|
-
```
|
143
|
-
|
144
|
-
### Support
|
145
|
-
|
146
|
-
#### Products list
|
147
|
-
|
148
|
-
```ruby
|
149
|
-
products = client.support.products
|
150
|
-
products.each do |product|
|
151
|
-
puts product.id, product.brand
|
152
|
-
end
|
153
|
-
```
|
154
|
-
|
155
|
-
#### Decode CSR
|
156
|
-
|
157
|
-
```ruby
|
158
|
-
data = client.support.decode_csr('csr string')
|
159
|
-
puts data.type, data.size
|
160
|
-
```
|
161
|
-
|
162
|
-
## Contributing
|
163
|
-
|
164
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/xolphin/xolphin-api-ruby.
|
165
|
-
|
166
|
-
|
167
|
-
## License
|
168
|
-
|
169
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
1
|
+
# Xolphin API gem for Ruby
|
2
|
+
xolphin-api-ruby is a library which allows quick integration of the [Xolphin REST API](https://api.xolphin.com) in Ruby to automated ordering, issuance and installation of SSL Certificates.
|
3
|
+
|
4
|
+
## About Xolphin
|
5
|
+
[Xolphin](https://www.xolphin.nl/) is the largest supplier of [SSL Certificates](https://www.sslcertificaten.nl) and [Digital Signatures](https://www.digitalehandtekeningen.nl) in the Netherlands. Xolphin has
|
6
|
+
a professional team providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands such as Sectigo (formely Comodo), GeoTrust, GlobalSign, Thawte and Symantec.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem 'xolphin-api'
|
14
|
+
```
|
15
|
+
|
16
|
+
And then execute:
|
17
|
+
|
18
|
+
$ bundle
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
$ gem install xolphin-api
|
23
|
+
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
### Client initialization
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'xolphin/api'
|
30
|
+
|
31
|
+
client = Xolphin::Api::Client.new('<username>', '<password>')
|
32
|
+
```
|
33
|
+
|
34
|
+
### Requests
|
35
|
+
|
36
|
+
#### Getting list of requests
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
requests = client.request.all
|
40
|
+
requests.each do |request|
|
41
|
+
puts request.id, request.product.id
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
#### Getting request by ID
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
request = client.request.get(960000024)
|
49
|
+
puts request.product.brand
|
50
|
+
```
|
51
|
+
|
52
|
+
#### Requesting certificate
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
ccr = client.request.create(24, 1, 'csr string', Xolphin::Api::DcvType::EMAIL)
|
56
|
+
ccr.address = 'Address'
|
57
|
+
ccr.approver_first_name = 'FirstName'
|
58
|
+
ccr.approver_last_name = 'LastName'
|
59
|
+
ccr.approver_phone = '+12345678901'
|
60
|
+
ccr.approver_email = 'email@domain.com'
|
61
|
+
ccr.zipcode = '123456'
|
62
|
+
ccr.city = 'City'
|
63
|
+
ccr.company = 'Company'
|
64
|
+
ccr.subject_alternative_names = ['test1.domain.com', 'test2.domain.com']
|
65
|
+
ccr.dcv = [{
|
66
|
+
'domain' => 'test1.domain.com',
|
67
|
+
'dcvType' => Xolphin::Api::DcvType::EMAIL,
|
68
|
+
'approverEmail' => 'email@domain.com'
|
69
|
+
}]
|
70
|
+
|
71
|
+
request = client.request.send(ccr)
|
72
|
+
puts request.id
|
73
|
+
```
|
74
|
+
|
75
|
+
#### Reissue certificate
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
certificate = client.certificate.get(<certificate_id>);
|
79
|
+
request = Xolphin::Api::CertificateRequests::ReissueCertificateRequest.new(<csr_string>,"EMAIL")
|
80
|
+
client.certificate.reissue(certificate.id, request)
|
81
|
+
```
|
82
|
+
|
83
|
+
#### Renew certificate
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
certificate = client.certificate.get(<certificate_id>);
|
87
|
+
request = Xolphin::Api::CertificateRequests::RenewCertificateRequest.new(certificate.product.id, <years>, <csr_string>, 'FILE')
|
88
|
+
client.certificate.renew(certificate.id, request)
|
89
|
+
```
|
90
|
+
|
91
|
+
#### Create a note
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
result = client.request.sendNote(1234, 'message')
|
95
|
+
```
|
96
|
+
|
97
|
+
#### Get list of notes
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
result = client.request.getNotes(1234)
|
101
|
+
result.notes.each do |note|
|
102
|
+
puts note.message_body, note.created_at
|
103
|
+
end
|
104
|
+
```
|
105
|
+
|
106
|
+
#### Send a "Comodo Subscriber Agreement" email
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
# currently available languages: en, de, fr, nl
|
110
|
+
result = client.request.sendComodoSAEmail(1234, 'email@example.com', '<language>');
|
111
|
+
```
|
112
|
+
|
113
|
+
#### Request an "Encryption Everywhere" certificate
|
114
|
+
```ruby
|
115
|
+
request = client.request.createEE
|
116
|
+
request.csr = "<csr_string>"
|
117
|
+
request.approver_first_name = "FirstName"
|
118
|
+
request.approver_last_name = "LastName"
|
119
|
+
request.approver_phone = "+1234567890"
|
120
|
+
request.approver_email = "email@domain.com"
|
121
|
+
request.subject_alternative_names = ["test1.domain.com", "test2.domain.com"]
|
122
|
+
request.dcv_type = "FILE"
|
123
|
+
response = client.request.sendEE(request)
|
124
|
+
```
|
125
|
+
|
126
|
+
### Certificate
|
127
|
+
|
128
|
+
#### Certificates list and expirations
|
129
|
+
|
130
|
+
```ruby
|
131
|
+
certificates = client.certificate.all
|
132
|
+
certificates.each do |certificate|
|
133
|
+
puts certificate.id, certificate.expired?
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
137
|
+
#### Download certificate
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
certificate = client.certificate.download(960000031, Xolphin::Api::FormatType::CRT)
|
141
|
+
File.write('crt.crt', certificate)
|
142
|
+
```
|
143
|
+
|
144
|
+
### Support
|
145
|
+
|
146
|
+
#### Products list
|
147
|
+
|
148
|
+
```ruby
|
149
|
+
products = client.support.products
|
150
|
+
products.each do |product|
|
151
|
+
puts product.id, product.brand
|
152
|
+
end
|
153
|
+
```
|
154
|
+
|
155
|
+
#### Decode CSR
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
data = client.support.decode_csr('csr string')
|
159
|
+
puts data.type, data.size
|
160
|
+
```
|
161
|
+
|
162
|
+
## Contributing
|
163
|
+
|
164
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/xolphin/xolphin-api-ruby.
|
165
|
+
|
166
|
+
|
167
|
+
## License
|
168
|
+
|
169
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require "bundler/gem_tasks"
|
2
|
-
require "rspec/core/rake_task"
|
3
|
-
require "rubocop/rake_task"
|
4
|
-
|
5
|
-
# Endpoint specs make an actual HTTP requests so we exclude them from CI.
|
6
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
7
|
-
t.rspec_opts = "--tag ~endpoint"
|
8
|
-
end
|
9
|
-
|
10
|
-
RuboCop::RakeTask.new(:rubocop)
|
11
|
-
|
12
|
-
task default: [:spec, :rubocop]
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require "rubocop/rake_task"
|
4
|
+
|
5
|
+
# Endpoint specs make an actual HTTP requests so we exclude them from CI.
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
7
|
+
t.rspec_opts = "--tag ~endpoint"
|
8
|
+
end
|
9
|
+
|
10
|
+
RuboCop::RakeTask.new(:rubocop)
|
11
|
+
|
12
|
+
task default: [:spec, :rubocop]
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "xolphin/api"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "xolphin/api"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -euo pipefail
|
3
|
-
IFS=$'\n\t'
|
4
|
-
set -vx
|
5
|
-
|
6
|
-
bundle install
|
7
|
-
|
8
|
-
# Do any other automated setup that you need to do here
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
bundle install
|
7
|
+
|
8
|
+
# Do any other automated setup that you need to do here
|
data/examples/_credentials.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
class Credentials
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
end
|
1
|
+
class Credentials
|
2
|
+
def self.username
|
3
|
+
'<your-username>'
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.password
|
7
|
+
'<your-super-secure-password>'
|
8
|
+
end
|
9
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require_relative "../lib/xolphin/api"
|
2
|
-
require_relative "credentials"
|
3
|
-
|
4
|
-
client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, true)
|
5
|
-
result = client.certificate.cancel(
|
6
|
-
puts result.inspect
|
1
|
+
require_relative "../lib/xolphin/api"
|
2
|
+
require_relative "credentials"
|
3
|
+
|
4
|
+
client = Xolphin::Api::Client.new(Credentials.username, Credentials.password, true)
|
5
|
+
result = client.certificate.cancel(960_003_013, 'idk', false)
|
6
|
+
puts result.inspect
|