Add registration and extension support for custom auth backends.
Review Request #5534 — Created Feb. 23, 2014 and submitted
The auth backend code now follows the same registration pattern used
throughout the codebase. Auth backends can be registered, unregistered,
iterated through, and looked up.A new requirement is that auth backends must have an ID. For
compatibility purposes, we assign an ID if one is not set when scanning
entry points, but all registrations going straight through the new
functions will require an ID set directly on the class.There's also a new
AuthBackendHook
for extensions, which will handle the
registration and unregistration for the extension.Documentation has been added for the new hooks, and the guide on writing
an auth backend has been updated as well.
Made use of this in an extension. When I enabled the extension, the auth
backend appeared in the list, and could be used. I was able to authenticate
with it. Disabling the extension removed it from the list.Built the docs.
Checked that the right backends were loading and being provided to templates.
- Change Summary:
-
- Added a
versionadded
. - Removed an excess blank line.
- Added a
- Commit:
-
039960f0659be74cdfd3a4864d309f888ec65fdd144c8add4e44499fe975976c81273caf0112f823
- Diff:
-
Revision 2 (+245 -44)