WARNING: This code is deprecated and will be removed. Keystone is the recommended solution for auth management.
Synaps authentication management
Bases: object
Base class for objects relating to auth
Objects derived from this class should be stupid data objects with an id member. They may optionally contain methods that delegate to AuthManager, but should not implement logic themselves.
Safely get object id.
This method will return the id of the object if the object is of this class, otherwise it will return the original object. This allows methods to accept objects or ids as parameters.
Bases: object
Manager Singleton for dealing with Users, Projects, and Keypairs
Methods accept objects or ids.
AuthManager uses a driver object to make requests to the data backend. See ldapdriver for reference.
AuthManager also manages associated data related to Auth objects that need to be more accessible, such as vpn ips and ports.
Adds role for user
If project is not specified, adds a global role. If project is specified, adds a local role.
The ‘projectmanager’ role is special and can’t be added or removed.
Parameters: |
|
---|
Add user to project
Authenticates AWS request using access key and signature
If the project is not specified, attempts to authenticate to a project with the same name as the user. This way, older tools that have no project knowledge will still work.
Parameters: |
|
---|---|
Return type: | tuple (User, Project) |
Returns: | User and project that the request represents. |
Create a project
Parameters: |
|
---|---|
Param : | Initial project members. The project manager will always be added as a member, even if he isn’t specified in this list. |
Return type: | Project |
Returns: | The new project. |
Creates a user
Parameters: |
|
---|---|
Param : | Whether to create a project for the user with the same name. |
Return type: | User |
Returns: | The new user. |
Deletes a project
Get an access key that includes user and project
Get all active roles for context
Get environment rc for user in project
Get project object by id
Retrieves list of projects, optionally filtered by user
Get list of allowed roles
Retrieves a user by id
Retrieves a user by access key
Get user global or per-project roles
Retrieves a list of all users
Checks existence of role for user
If project is not specified, checks for a global role. If project is specified, checks for the union of the global role and the project role.
Role ‘projectmanager’ only works for projects and simply checks to see if the user is the project_manager of the specified project. It is the same as calling is_project_manager(user, project).
Parameters: |
|
---|---|
Return type: | bool |
Returns: | True if the user has the role. |
Checks for admin status, allowing user to access all projects
Parameters: | user (User or uid) – User to check. |
---|---|
Return type: | bool |
Returns: | True for admin. |
Checks if user is project manager
Checks to see if user is a member of project
Checks for superuser status, allowing user to bypass authorization
Parameters: | user (User or uid) – User to check. |
---|---|
Return type: | bool |
Returns: | True for superuser. |
Modify a project
Parameters: |
|
---|
Modify credentials for a user
Removes a user from a project
Removes role for user
If project is not specified, removes a global role. If project is specified, removes a local role.
The ‘projectmanager’ role is special and can’t be added or removed.
Parameters: |
|
---|
Bases: synaps.auth.manager.AuthBase
Represents a Project returned from the datastore
Bases: synaps.auth.manager.AuthBase
Object representing a user
The following attributes are defined: