[ English | 中文 (简体, 中国) | русский | português (Brasil) | नेपाली | 한국어 (대한민국) | Indonesia | français | español | esperanto | English (United Kingdom) | Deutsch ]
The Backend Module¶
Module defining the Django auth backend class for the Keystone API.
- class openstack_auth.backend.KeystoneBackend[código fonte]¶
Django authentication backend for use with
django.contrib.auth
.- authenticate(request, auth_url=None, **kwargs)[código fonte]¶
Authenticates a user via the Keystone Identity API.
- get_all_permissions(user, obj=None)[código fonte]¶
Returns a set of permission strings that the user has.
This permission available to the user is derived from the user’s Keystone “roles”.
The permissions are returned as
"openstack.{{ role.name }}"
.
- get_group_permissions(user, obj=None)[código fonte]¶
Returns an empty set since Keystone doesn’t support “groups”.
- get_user(user_id)[código fonte]¶
Returns the current user from the session data.
If authenticated, this return the user object based on the user ID and session data.
Nota
This required monkey-patching the
contrib.auth
middleware to make therequest
object available to the auth backend class.
- has_module_perms(user, app_label)[código fonte]¶
Returns True if user has any permissions in the given app_label.
Currently this matches for the app_label
"openstack"
.
- has_perm(user, perm, obj=None)[código fonte]¶
Returns True if the given user has the specified permission.