@@ -39,9 +39,9 @@ def __init__(self, client, endpoint, api_version="v1"):
3939 super ().__init__ (client = client , endpoint = endpoint , api_version = api_version )
4040
4141 # Set to None initially. Will be filled in by methods later.
42- self .__cert_types = None
43- self .__custom_fields = None
44- self .__reason_maxlen = 512
42+ self ._cert_types = None
43+ self ._custom_fields = None
44+ self ._reason_maxlen = 512
4545
4646 @property
4747 def types (self ):
@@ -51,19 +51,19 @@ def types(self):
5151 """
5252 # Only go to the API if we haven't done the API call yet, or if someone
5353 # specifically wants to refresh the internal cache
54- if not self .__cert_types :
54+ if not self ._cert_types :
5555 url = self ._url ("/types" )
5656 result = self ._client .get (url )
5757
5858 # Build a dictionary instead of a flat list of dictionaries
59- self .__cert_types = {}
59+ self ._cert_types = {}
6060 for res in result .json ():
6161 name = res ["name" ]
62- self .__cert_types [name ] = {}
63- self .__cert_types [name ]["id" ] = res ["id" ]
64- self .__cert_types [name ]["terms" ] = res ["terms" ]
62+ self ._cert_types [name ] = {}
63+ self ._cert_types [name ]["id" ] = res ["id" ]
64+ self ._cert_types [name ]["terms" ] = res ["terms" ]
6565
66- return self .__cert_types
66+ return self ._cert_types
6767
6868 @property
6969 def custom_fields (self ):
@@ -73,13 +73,13 @@ def custom_fields(self):
7373 """
7474 # Only go to the API if we haven't done the API call yet, or if someone
7575 # specifically wants to refresh the internal cache
76- if not self .__custom_fields :
76+ if not self ._custom_fields :
7777 url = self ._url ("/customFields" )
7878 result = self ._client .get (url )
7979
80- self .__custom_fields = result .json ()
80+ self ._custom_fields = result .json ()
8181
82- return self .__custom_fields
82+ return self ._custom_fields
8383
8484 def _validate_custom_fields (self , custom_fields ):
8585 """Check the structure and contents of a list of custom fields dicts. Raise exceptions if validation fails.
@@ -230,8 +230,8 @@ def revoke(self, cert_id, reason=""):
230230 url = self ._url (f"/revoke/{ cert_id } " )
231231
232232 # Sectigo has a 512 character limit on the "reason" message, so catch that here.
233- if not reason or len (reason ) >= self .__reason_maxlen :
234- raise ValueError (f"Sectigo limit: reason must be > 0 character and < { self .__reason_maxlen } characters" )
233+ if not reason or len (reason ) >= self ._reason_maxlen :
234+ raise ValueError (f"Sectigo limit: reason must be > 0 character and < { self ._reason_maxlen } characters" )
235235
236236 data = {"reason" : reason }
237237
0 commit comments