reviewboard.accounts.backends.registry¶
Authentication backend registry.
-
class
AuthBackendRegistry
[source]¶ Bases:
reviewboard.registries.registry.EntryPointRegistry
A registry for managing authentication backends.
-
errors
= {u'already_registered': _(u'"%(item)r" is already a registered authentication backend.'), u'load_entry_point': _(u'Error loading authentication backend %(entry_point)s: %(error)s'), u'not_registered': _(u'No authentication backend registered with %(attr_name)s = %(attr_value)s.'), u'unregister': _(u'"%(item)r is not a registered authentication backend.')}[source]¶
-
process_value_from_entry_point
(entry_point)[source]¶ Load the class from the entry point.
If the class lacks a value for
backend_id
, it will be set as the entry point’s name.Parameters: entry_point (pkg_resources.EntryPoint) – The entry point. Returns: The BaseAuthBackend
subclass.Return type: type
-
get_defaults
()[source]¶ Yield the authentication backends.
This will make sure the standard authentication backend is always registered and returned first.
Yields: type – The BaseAuthBackend
subclasses.
-
unregister
(backend_class)[source]¶ Unregister the requested authentication backend.
Parameters: backend_class (type) – The class of the backend to unregister. This must be a subclass of BaseAuthBackend
.Raises: djblets.registries.errors.ItemLookupError
– Raised when the class cannot be found.
-
get_auth_backend
(auth_backend_id)[source]¶ Return the requested authentication backend, if it exists.
Parameters: auth_backend_id (unicode) – The unique ID of the BaseAuthBackend
class.Returns: The BaseAuthBackend
subclass, orNone
if it is not registered.Return type: type
-
-
get_enabled_auth_backends
()[source]¶ Return all authentication backends being used by Review Board.
The returned list contains every authentication backend that Review Board will try, in order.
Returns: The list of registered BaseAuthBackend
subclasses.Return type: list of type