Infinity.SaslContextSession

Fields

None

Methods

continue_ (retval)

feed (data, func, *user_data)

get_property (prop)

is_processing ()

set_property (prop, value)

Details

class Infinity.SaslContextSession

Infinity.SaslContextSession represents an ongoing authentication session. Create with Infinity.SaslContext.server_start_session() or Infinity.SaslContext.client_start_session().

continue_(retval)
Parameters:

retval (int) – Error code of the operation requested.

When the callback function specified in Infinity.SaslContext.set_callback() is called then self waits for the user to call Infinity.SaslContextSession.continue_(). It should do so once it provided the requested property using Infinity.SaslContextSession.set_property() with retval being %GSASL_OK. If it decides that the property cannot be provided then it should still call this function with retval being a SASL error code specifying the problem.

feed(data, func, *user_data)
Parameters:

This function feeds data from the session’s remote counterpart to self. It should be base64 encoded. This function will, asynchronously, process the data and query for properties it requires to do so. Once it has finished, func is called with output data to send to the remote side to be fed to its session counterpart.

This function must not be called again before func was called.

get_property(prop)
Parameters:

prop (int) – A SASL property.

Returns:

The value of the property, or None. The value is owned by the session and must not be freed.

Return type:

str or None

Returns the value of the property prop in self. If the value does not yet exist then this function returns None. It does not invoke the Infinity.SaslContextCallbackFunc to query it.

is_processing()
Returns:

Whether self is currently processing data asynchronously.

Return type:

bool

Returns whether the session is currently asynchronously processing data fed to it with Infinity.SaslContextSession.feed(). In this case the first call needs to finish before another one is allowed to be made.

set_property(prop, value)
Parameters:
  • prop (int) – A SASL property.

  • value (str or None) – The value to set the property to.

Sets the property prop in self to value.