vortex.sasl — PyVortex SASL module: SASL authentication functions

This modules includes all functions required to authenticate a BEEP connection.

Module API

vortex.sasl.init(ctx)

Allows to init SASL module on the provided vortex.Ctx reference. This is required before any SASL operation is done.

Parameters:ctx (vortex.Ctx) – vortex context where SASL module will be initialized
Return type:True it initialization was completed, otherwise False is returned.
vortex.sasl.is_authenticated(conn)

Allows to check if the provided connection is authenticated using SASL methods.

Parameters:conn (vortex.Connection) – the connection to check for its authentication status.
vortex.sasl.start_auth(conn, profile[, auth_notify][, auth_notify_data][, auth_id][, authorization_id][, password][, realm][, anonymous_token])

Allows to start a SASL authentication process using the provided SASL mech (profile) on the provided connection.

The rest of optional arguments are used to either set parameters required by the SASL mechanism or to receive async authentication termination status (auth_notify). See vortex library manual to know which attributes you must provide for each mechanism:

http://www.aspl.es/fact/files/af-arch/vortex-1.1/html/starting_to_program.html#vortex_manual_sasl_for_client_side

Parameters:
  • conn (vortex.Connection) – The connection where the SASL process will take place.
  • profile (string) – SASL mechanism to use.
  • auth_notify (SASL auth notification) – User defined handler that will be used to notify SASL termination status.
  • auth_notify_data (object) – User defined data that will notified along with corresponding data at auth notify handler.
  • auth_id (string) – This is the user identification id.
  • authorization_id (string) – This is the user authorization id.
  • password (string) – This is the user password
  • realm (string) – This is the authentication domain.
  • anonymous_token (string) – This is the anonymous token used by ANONYMOUS SASL mechanism.
vortex.sasl.method_used(conn)

Allows to get the SASL mechanism that was used to authenticate the connection.

vortex.sasl.auth_id(conn)

Allows to get the SASL auth_id value used during the authentication process (only in the case a SASL mechanism requiring it was used).

vortex.sasl.accept_mech(ctx, profile, auth_handler[, auth_handler_data])

Server side SASL authentication support. This function allows to configure a handler that will be called to complete the authentication process for the provided SASL mechanism.

Parameters:
  • ctx (vortex.Ctx) – The context where the SASL handling will be configured.
  • profile (string) – The SASL mechanism that will be accepted and managed by the handler provided.
  • auth_handler (SASL common auth handler) – This is the SASL auth handler used to complete the operation.
  • auth_handler_data (object) – User defined data to be passed to auth_handler along with corresponding handler parameters.