Skip to content

Commit c5087bb

Browse files
authored
Merge pull request xolphin#10 from xolphin/XRS-228
XRS-228
2 parents 90258b8 + 9943c53 commit c5087bb

17 files changed

+444
-30
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [1.7.0] - 2023-11-23
5+
### Added
6+
- approverRepresentative fields
7+
- added extra schedule_validation_call fields
8+
- added disable_free_san
9+
- added request cancel
10+
411
## [1.6.0] - 2017-07-07
512
### Added
613
- Compatability with Xolphin REST Api v1.6.0

README.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ Send a "Comodo Subscriber Agreement" email
107107
result = client.request().send_ComodoSA(124, 'test@example.com')
108108
print(result.message);
109109
110+
Request Callback (OV and EV certificates)
111+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
.. code:: python
114+
115+
vc = client.request().configure_validation_call(order_id)
116+
vc.date = "2024-01-26"
117+
vc.time = "11:00"
118+
vc.timezone = "Europe Amsterdam"
119+
vc.phoneNumber = "132456789"
120+
request = client.request().send_validation_call(vc);
121+
110122
Certificate
111123
~~~~~~~~~~~
112124

examples/Request_create_EE.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
RLuxVO9QX0YLQ0ew1x2z+eFfBsfSI1+DkF4+5TrfJP6jQyHBR+VDdGYBO2d8rBw7
2121
ITIJC9tt2F4GjaPAI1xY9eoq/QfZxzNoNufMuw==
2222
-----END CERTIFICATE REQUEST-----"""
23-
ccr.approver_first_name = 'FirstName'
24-
ccr.approver_last_name = 'LastName'
25-
ccr.approver_phone = '+12345678901'
26-
ccr.approver_email = 'email@domain.com'
23+
ccr.approver_representative_first_name = 'FirstName'
24+
ccr.approver_representative_last_name = 'LastName'
25+
ccr.approver_representative_phone = '+12345678901'
26+
ccr.approver_representative_email = 'email@domain.com'
27+
ccr.approver_representative_position = 'CTO'
2728
ccr.subject_alternative_names.append('test1.domain.com')
2829
ccr.subject_alternative_names.append('test2.domain.com')
2930
ccr.dcvType = 'DNS'

examples/Request_create_OV_ssl.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import xolphin
2+
client = xolphin.Client('youremail@domain.com', 'YourPassword', True);
3+
4+
product = 147
5+
years = 1
6+
csr = """-----BEGIN CERTIFICATE REQUEST-----
7+
MIICszCCAZsCAQAwbjELMAkGA1UEBhMCR0IxDzANBgNVBAgMBkxvbmRvbjEPMA0G
8+
A1UEBwwGTG9uZG9uMRMwEQYDVQQKDApTU0wyNDcgTHRkMQswCQYDVQQLDAJJVDEb
9+
MBkGA1UEAwwSc3NsMjQ3LXRlc3RpbmcuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC
10+
AQ8AMIIBCgKCAQEAwkpLdjQJohfnqBoNXCMTnsOaXfyz7a4nm3BNZhGF9I4fPdd9
11+
fuOZhOqIdy2tmQUp82rm9OjDtj9NjJHD3YRGLwTUJ2CJfCIaKescGAZYe8iNNyJ8
12+
Fuw/Jc2TD6UKgb/HyD9grqMQEPojD469ZA8ZYjAPax8UsilTdU5a8w0F+U6uF7Q+
13+
IMlo/OZ5pqewQTZ/fqPm/MoGiUYnMEnSzE9aVGUSjMov8nd/s/pEbM3Je7zg4aHX
14+
gFemBN5GY8vFQanZhSvGcIhhjdK3ac7Q5j5Y20sYmaORulvz0YH40ZYoml8KP8GO
15+
PKOlLhpKnade4u+kxo72Ws05cRtm4N78B5JLsQIDAQABoAAwDQYJKoZIhvcNAQEL
16+
BQADggEBADNQWLy+z8HdN3Xz0HJAPK6c5G7ukCAu/P8sYwNkWFnGGBrY7Uvl3XXF
17+
vSBMWS04AzylTn2qqHKuz5dIq68lgi0CTl1tR2Sp8/5vwCFZntJHGG6f/L/DRKcL
18+
Iriu7QW4mi5dQpDX6maJu/lE38XrcX/r2QdCkCWskiOdh+EnpwibdfT7sVqSrvDh
19+
Cgd0E7WtG1ecGB1QTpCsHBHMk604Pj/wDnw5SvNoX01dm8n3PY5/UfMFVrCnx2uT
20+
VDiArcp4X9/aZCiJxrf6UzY/7FH6qXYiP+hlIVqrqZ7Y3qaFQznBO3VWWNvuunXd
21+
1V2zpjfQjv+FuBDHyKUgX0Q4h3M9XTw=
22+
-----END CERTIFICATE REQUEST-----"""
23+
dcv_type = "DNS"
24+
25+
26+
ov_request = client.request().create(product,years,csr,dcv_type)
27+
28+
ov_request.approver_representative_first_name = 'FirstName'
29+
ov_request.approver_representative_last_name = 'LastName'
30+
ov_request.approver_representative_position = 'Position'
31+
ov_request.approver_representative_phone = '+12345678901'
32+
ov_request.approver_representative_email = 'approver@emailaddress.com'
33+
ov_request.city = 'London'
34+
ov_request.zipcode = 'EC1R 0JH'
35+
ov_request.address = '3/11 Pine Street'
36+
ov_request.subject_alternative_names.append('test1.ssl247-testing.com')
37+
ov_request.subject_alternative_names.append('test2.ssl247-testing.com')
38+
ov_request.dcvType = 'DNS'
39+
40+
#print(ov_request.toDict());
41+
42+
request = client.request().send(ov_request)
43+
44+
print(vars(request))

examples/Request_schedule_call.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import xolphin
2+
import json
3+
4+
client = xolphin.Client('youremail@domain.com', 'YourPassword', True);
5+
6+
order_id = 964178685
7+
date = "2024-01-26"
8+
time = "11:00"
9+
timezone = "Europe Amsterdam"
10+
11+
#scheduling automated callback
12+
try:
13+
vc = client.request().configure_validation_call(order_id)
14+
vc.date = date
15+
vc.time = time
16+
vc.timezone = timezone
17+
vc.phoneNumber = "132456789"
18+
#vc.action = "ScheduledCallback" #not mandatory, this is the default action
19+
request = client.request().send_validation_call(vc)
20+
print(vars(request))
21+
except Exception as ex:
22+
print("------- ERROR -------")
23+
print(ex)
24+
25+
#scheduling manual callback
26+
try:
27+
vc = client.request().configure_validation_call(order_id)
28+
vc.date = date
29+
vc.time = time
30+
vc.timezone = timezone
31+
vc.phoneNumber = "132456789"
32+
vc.extensionNumber = "123"
33+
vc.action = "ManualCallback"
34+
vc.commet = "Please ask for Joe"
35+
request = client.request().send_validation_call(vc)
36+
print(vars(request))
37+
except Exception as ex:
38+
print("------- ERROR -------")
39+
print(ex)
40+
41+
42+
#changing callback phone number
43+
try:
44+
vc = client.request().configure_validation_call(order_id)
45+
vc.date = date
46+
vc.time = time
47+
vc.timezone = timezone
48+
vc.phoneNumber = "987654321"
49+
vc.action = "ReplacePhone"
50+
request = client.request().send_validation_call(vc)
51+
except Exception as ex:
52+
print("------- ERROR -------")
53+
print(ex)
54+
55+
#changing callback method from Telephone to Email
56+
try:
57+
vc = client.request().configure_validation_call(order_id)
58+
vc.date = date
59+
vc.time = time
60+
vc.timezone = timezone
61+
vc.action = "replaceEmailAddress"
62+
vc.emailAddress = "youremail@domain.com"
63+
request = client.request().send_validation_call(vc)
64+
print(vars(request))
65+
except Exception as ex:
66+
print("------- ERROR -------")
67+
print(ex)
68+
69+
#request re-sending callback email to customer
70+
try:
71+
vc = client.request().configure_validation_call(order_id)
72+
vc.date = date
73+
vc.time = time
74+
vc.action = "sendCallbackEmail"
75+
request = client.request().send_validation_call(vc)
76+
print(vars(request))
77+
except Exception as ex:
78+
print("------- ERROR -------")
79+
print(ex)
80+

readme.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ print(request.product.brand)
5959
```python
6060
ccr = client.request().create(24, 1, 'csr string', 'EMAIL')
6161
ccr.address = 'Address'
62-
ccr.approver_first_name = 'FirstName'
63-
ccr.approver_last_name = 'LastName'
64-
ccr.approver_phone = '+12345678901'
65-
ccr.approver_email = 'email@domain.com'
62+
ccr.approver_representative_first_name = 'FirstName'
63+
ccr.approver_representative_last_name = 'LastName'
64+
ccr.approver_representative_phone = '+12345678901'
65+
ccr.approver_representative_email = 'approver_email@domain.com'
66+
ccr.approver_representative_position = 'Pos'
67+
ccr.approver_email = 'admin@domain.com'
6668
ccr.zipcode = '123456'
6769
ccr.city = 'City'
6870
ccr.company = 'Company'
@@ -100,10 +102,12 @@ for note in result:
100102
```python
101103
ccr = client.request().create_ee()
102104
ccr.csr = "<csr_string>"
103-
ccr.approver_first_name = 'FirstName'
104-
ccr.approver_last_name = 'LastName'
105-
ccr.approver_phone = '+12345678901'
106-
ccr.approver_email = 'email@domain.com'
105+
ccr.approver_representative_first_name = 'FirstName'
106+
ccr.approver_representative_last_name = 'LastName'
107+
ccr.approver_representative_phone = '+12345678901'
108+
ccr.approver_representative_email = 'approver_email@domain.com'
109+
ccr.approver_representative_position = 'Pos'
110+
ccr.approver_email = 'admin@domain.com'
107111
ccr.subject_alternative_names.append('test1.domain.com')
108112
ccr.subject_alternative_names.append('test2.domain.com')
109113
ccr.dcvType = 'DNS'
@@ -118,7 +122,16 @@ result = client.request().send_ComodoSA(124, 'test@example.com')
118122
print(result.message);
119123
```
120124

125+
#### Request Callback (OV and EV certificates)
121126

127+
```python
128+
vc = client.request().configure_validation_call(order_id)
129+
vc.date = "2024-01-26"
130+
vc.time = "11:00"
131+
vc.timezone = "Europe Amsterdam"
132+
vc.phoneNumber = "132456789"
133+
request = client.request().send_validation_call(vc)
134+
```
122135
### Certificate
123136

124137
#### Certificates list and expirations

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def read(*paths):
1212

1313
setup(
1414
name='xolphin-api',
15-
version='1.6.0',
15+
version='1.7.0',
1616
author='Xolphin',
1717
author_email='info@xolphin.com',
1818
license='MIT',

xolphin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from __future__ import absolute_import
55

66
__author__ = 'Xolphin'
7-
__version__ = '1.6.0'
7+
__version__ = '1.7.0'
88

99
from .client import Client
1010
#from .errors import TwinglyException
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import json
2+
import warnings
3+
4+
class ConfigureValidationCall(object):
5+
def __init__(self, request_id):
6+
self.request_id = request_id
7+
self._action = "ScheduledCallback"
8+
self._emailAddress = ""
9+
self.date = ""
10+
self.time = ""
11+
self.timezone = ""
12+
self.phoneNumber = ""
13+
self.extensionNumber = ""
14+
self.language = "en-us"
15+
self.comments = ""
16+
17+
def toDict(self):
18+
result = {
19+
'request_id':self.request_id,
20+
'action':self.action,
21+
'date':self.date,
22+
'time':self.time,
23+
'timezone':self.timezone,
24+
'phoneNumber':self.phoneNumber,
25+
'extensionNumber':self.extensionNumber,
26+
'emailAddress':self.emailAddress,
27+
'language':self.language,
28+
'comments':self.comments,
29+
}
30+
return result
31+
32+
@property
33+
def action(self):
34+
return self._action
35+
36+
@action.setter
37+
def action(self,value):
38+
actions = [ "ScheduledCallback", "ManualCallback", "ReplacePhone", "replaceEmailAddress","sendCallbackEmail"]
39+
if(value not in actions):
40+
raise Exception("Invalid action! Available actions: ScheduledCallback, ReplacePhone, replaceEmailAddress,sendCallbackEmail")
41+
42+
self._action = value
43+
44+
@property
45+
def language(self):
46+
return self._action
47+
48+
@language.setter
49+
def language(self,value):
50+
languages = ['en-us', 'ru-ru', 'de-de', 'es-es', 'pt-br', 'nl-nl', 'fr-fr']
51+
if(value not in languages):
52+
raise Exception("Invalid languages! Available languages: 'en-us', 'ru-ru', 'de-de', 'es-es', 'pt-br', 'nl-nl', 'fr-fr'")
53+
54+
self._action = value
55+
56+
@property
57+
def emailAddress(self):
58+
return self._emailAddress
59+
60+
@emailAddress.setter
61+
def emailAddress(self,value):
62+
import re
63+
regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
64+
if(re.fullmatch(regex, value) == None):
65+
raise Exception("Invalid e-mail address")
66+
67+
self._emailAddress = value

xolphin/certificate_requests/create_certificate_request.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
import json
2+
import warnings
23

34
class CreateCertificateRequest(object):
45
def __init__(self, product, years, csr, dcv_type):
56
self.product = product
67
self.years = years
78
self.csr = csr
89
self.dcv_type = dcv_type
9-
1010
self.subject_alternative_names = []
1111
self.dcv = []
1212
self.company = ''
1313
self.department = ''
1414
self.address = ''
1515
self.zipcode = ''
1616
self.city = ''
17+
self.province = ''
18+
self.country = ''
19+
self.certenroll_email = ''
1720
self.approver_first_name = ''
1821
self.approver_last_name = ''
1922
self.approver_email = ''
2023
self.approver_phone = ''
24+
self.approver_representative_first_name = ''
25+
self.approver_representative_last_name = ''
26+
self.approver_representative_email = ''
27+
self.approver_representative_phone = ''
28+
self.approver_representative_position = ''
2129
self.kvk = ''
2230
self.reference = ''
2331
self.language = ''
@@ -40,12 +48,49 @@ def toDict(self):
4048
if self.address != '': result['address'] = self.address
4149
if self.zipcode != '': result['zipcode'] = self.zipcode
4250
if self.city != '': result['city'] = self.city
51+
if self.province != '': result['province'] = self.province
52+
if self.country != '': result['country'] = self.country
4353
if self.approver_first_name != '': result['approverFirstName'] = self.approver_first_name
4454
if self.approver_last_name != '': result['approverLastName'] = self.approver_last_name
4555
if self.approver_email != '': result['approverEmail'] = self.approver_email
4656
if self.approver_phone != '': result['approverPhone'] = self.approver_phone
57+
if self.approver_representative_first_name != '': result['approverRepresentativeFirstName'] = self.approver_representative_first_name
58+
if self.approver_representative_last_name != '': result['approverRepresentativeLastName'] = self.approver_representative_last_name
59+
if self.approver_representative_email != '': result['approverRepresentativeEmail'] = self.approver_representative_email
60+
if self.approver_representative_phone != '': result['approverRepresentativePhone'] = self.approver_representative_phone
61+
if self.approver_representative_position != '': result['approverRepresentativePosition'] = self.approver_representative_position
62+
if self.certenroll_email != '': result['certenrollEmail'] = self.certenroll_email
4763
if self.kvk != '': result['kvk'] = self.kvk
4864
if self.reference != '': result['reference'] = self.reference
4965
if self.language != '': result['language'] = self.language
5066

5167
return result
68+
69+
@property
70+
def approver_first_name(self):
71+
return self._approver_first_name
72+
@property
73+
def approver_last_name(self):
74+
return self._approver_last_name
75+
@property
76+
def approver_phone(self):
77+
return self._approver_phone
78+
79+
80+
@approver_first_name.setter
81+
def approver_first_name(self,value):
82+
self._approver_first_name = value
83+
if(value != ''):
84+
warnings.warn("Warning! approverFirstName is deprecated, please use approverRepresentativeFirstName")
85+
86+
@approver_last_name.setter
87+
def approver_last_name(self,value):
88+
self._approver_last_name = value
89+
if(value != ''):
90+
warnings.warn("Warning! approverLastName is deprecated, please use approverRepresentativeLastName")
91+
92+
@approver_phone.setter
93+
def approver_phone(self,value):
94+
self._approver_phone = value
95+
if(value != ''):
96+
warnings.warn("Warning! approverPhone is deprecated, please use approverRepresentativePhone")

0 commit comments

Comments
 (0)