Skip to content

Commit 5424012

Browse files
committed
Updated TlsOptions api documentation
1 parent 6fa2643 commit 5424012

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/coherence/client.py

+40
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,22 @@ def on_truncated(name: str) -> None:
764764

765765

766766
class TlsOptions:
767+
"""
768+
Options specific to the configuration of TLS.
769+
"""
770+
767771
ENV_CA_CERT = "COHERENCE_TLS_CERTS_PATH"
772+
"""
773+
Environment variable to configure the path to CA certificates
774+
"""
768775
ENV_CLIENT_CERT = "COHERENCE_TLS_CLIENT_CERT"
776+
"""
777+
Environment variable to configure the path to client certificates
778+
"""
769779
ENV_CLIENT_KEY = "COHERENCE_TLS_CLIENT_KEY"
780+
"""
781+
Environment variable to configure the path to client key
782+
"""
770783

771784
def __init__(
772785
self,
@@ -776,6 +789,18 @@ def __init__(
776789
client_cert_path: str | None = None,
777790
client_key_path: str | None = None,
778791
) -> None:
792+
"""
793+
Construct a new :func:`coherence.client.TlsOptions`
794+
795+
:param locked: If `true`, prevents further mutations to the options.
796+
:param enabled: Enable/disable TLS support.
797+
:param ca_cert_path: the path to the CA certificate. If not specified then its configured using the
798+
environment variable COHERENCE_TLS_CERTS_PATH
799+
:param client_cert_path: the path to the client certificate. If not specified then its configured using the
800+
environment variable COHERENCE_TLS_CLIENT_CERT
801+
:param client_key_path: the path to the client certificate key. If not specified then its configured using the
802+
environment variable COHERENCE_TLS_CLIENT_KEY
803+
"""
779804
self._locked = locked
780805
self._enabled = enabled
781806

@@ -787,6 +812,9 @@ def __init__(
787812

788813
@property
789814
def enabled(self) -> bool:
815+
"""
816+
Property to set/get the boolean state if TLS is enabled(true) or disabled(false)
817+
"""
790818
return self._enabled
791819

792820
@enabled.setter
@@ -798,6 +826,9 @@ def enabled(self, enabled: bool) -> None:
798826

799827
@property
800828
def ca_cert_path(self) -> Optional[str]:
829+
"""
830+
Property to set/get the path to the CA certificate
831+
"""
801832
return self._ca_cert_path
802833

803834
@ca_cert_path.setter
@@ -809,6 +840,9 @@ def ca_cert_path(self, ca_cert_path: str) -> None:
809840

810841
@property
811842
def client_cert_path(self) -> Optional[str]:
843+
"""
844+
Property to set/get the path to the client certificate.
845+
"""
812846
return self._client_cert_path
813847

814848
@client_cert_path.setter
@@ -820,6 +854,9 @@ def client_cert_path(self, client_cert_path: str) -> None:
820854

821855
@property
822856
def client_key_path(self) -> Optional[str]:
857+
"""
858+
Property to set/get the path to the client certificate key.
859+
"""
823860
return self._client_key_path
824861

825862
@client_key_path.setter
@@ -830,6 +867,9 @@ def client_key_path(self, client_key_path: str) -> None:
830867
self._client_key_path = client_key_path
831868

832869
def locked(self) -> None:
870+
"""
871+
Once called, no further mutations can be made.
872+
"""
833873
self._locked = True
834874

835875
def is_locked(self) -> bool:

0 commit comments

Comments
 (0)