hop.auth¶
-
class
hop.auth.
Auth
(user, password, ssl=True, method=<SASLMethod.SCRAM_SHA_512: 3>, **kwargs)[source]¶ Attach SASL-based authentication to a client.
Returns client-based auth options when called.
- userstr
Username to authenticate with.
- passwordstr
Password to authenticate with.
- sslbool, optional
Whether to enable SSL (enabled by default).
- methodSASLMethod, optional
The SASL method to authenticate, default = SASLMethod.SCRAM_SHA_512. See valid SASL methods in SASLMethod.
- ssl_ca_locationstr, optional
If using SSL via a self-signed cert, a path/location to the certificate.
-
hop.auth.
load_auth
(config_file='/home/docs/.config/hop/config.toml')[source]¶ Configures an Auth instance given a configuration file.
- Args:
- config_file: Path to a configuration file, loading from
the default location if not given.
- Returns:
A configured Auth instance.
- Raises:
KeyError: An error occurred parsing the configuration file.