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.

Parameters
  • user (str) – Username to authenticate with.

  • password (str) – Password to authenticate with.

  • ssl (bool, optional) – Whether to enable SSL (enabled by default).

  • method (SASLMethod, optional) – The SASL method to authenticate, default = SASLMethod.SCRAM_SHA_512. See valid SASL methods in SASLMethod.

  • ssl_ca_location (str, optional) – If using SSL via a self-signed cert, a path/location to the certificate.

hop.auth.load_auth(config_file=None)[source]

Configures an Auth instance given a configuration file.

Parameters

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.