allura.lib.phone

class allura.lib.phone.PhoneService(config)

Defines the phone verification service interface and provides a default no-op implementation.

check(request_id, pin)

Given the :param pin: code user entered and :param request_id: (obtained by verify), verify that :param pin: is valid.

Returns dict with following keys: status, error. status is either ‘ok’ or ‘error’.

If status is ‘ok’ then verification was successful otherwise ‘error’ is an error message.

classmethod get(config, entry_points)

Return an instance of PhoneService implementation based on config. :rtype: PhoneService

verify(number)

Generate PIN and send it to phone number :param number:

Returns dict with following keys: status, request_id, error. status is either ‘ok’ or ‘error’.

If status is ‘ok’ then request_id is present (used later to verify PIN) otherwise ‘error’ is an error message.