security

TLS channel negotiation, credentials, and security exceptions for TekHSI.

TekAuthenticationFailed

TekAuthenticationFailed(host: str, message: str)

Bases: TekSecurityError

flowchart LR tekhsi.security.TekAuthenticationFailed[TekAuthenticationFailed] tekhsi.security.TekSecurityError[TekSecurityError] tekhsi.security.TekSecurityError --> tekhsi.security.TekAuthenticationFailed click tekhsi.security.TekAuthenticationFailed href "" "tekhsi.security.TekAuthenticationFailed" click tekhsi.security.TekSecurityError href "" "tekhsi.security.TekSecurityError"

Password rejected or missing.

TekCertificateMismatch

TekCertificateMismatch(host: str, stored_fingerprint: str, current_fingerprint: str)

Bases: TekSecurityError

flowchart LR tekhsi.security.TekCertificateMismatch[TekCertificateMismatch] tekhsi.security.TekSecurityError[TekSecurityError] tekhsi.security.TekSecurityError --> tekhsi.security.TekCertificateMismatch click tekhsi.security.TekCertificateMismatch href "" "tekhsi.security.TekCertificateMismatch" click tekhsi.security.TekSecurityError href "" "tekhsi.security.TekSecurityError"

Stored fingerprint doesn’t match server certificate.

TekHSICredentials

TekHSICredentials(
    channel_credentials: ChannelCredentials | None = None,
    *,
    _use_store: bool = False,
    _store_mode: str = "tls",
    _tls_server_name: str | None = None
)

User-facing builder for TLS and TLS+Basic channel credentials.

tls staticmethod

tls(ca_cert_path: str | None = None) -> TekHSICredentials

Build credentials for Mode 2 (TLS only).

token staticmethod

token(
    ca_cert_path: str | None = None, token: str | None = None, username: str | None = None
) -> TekHSICredentials

Build credentials for Mode 3 (TLS + HTTP Basic client auth).

TekSecurityError

Bases: Exception

flowchart LR tekhsi.security.TekSecurityError[TekSecurityError] click tekhsi.security.TekSecurityError href "" "tekhsi.security.TekSecurityError"

Base class for all security-related errors.

TekUnknownInstrument

TekUnknownInstrument(host: str, cert_info: CertInfo)

Bases: TekSecurityError

flowchart LR tekhsi.security.TekUnknownInstrument[TekUnknownInstrument] tekhsi.security.TekSecurityError[TekSecurityError] tekhsi.security.TekSecurityError --> tekhsi.security.TekUnknownInstrument click tekhsi.security.TekUnknownInstrument href "" "tekhsi.security.TekUnknownInstrument" click tekhsi.security.TekSecurityError href "" "tekhsi.security.TekSecurityError"

Instrument not in credential store, no callback provided.