The keystone.identity.core Module

Main entry point into the Identity service.

class keystone.identity.core.Driver

Bases: object

Interface description for an Identity driver.

add_role_to_user_and_project(user_id, tenant_id, role_id)

Add a role to a user within given tenant.

Raises :keystone.exception.UserNotFound, keystone.exception.ProjectNotFound, keystone.exception.RoleNotFound
add_user_to_group(user_id, group_id)

Adds a user to a group.

Raises :keystone.exception.UserNotFound, keystone.exception.GroupNotFound
add_user_to_project(tenant_id, user_id)

Add user to a tenant by creating a default role relationship.

Raises :keystone.exception.ProjectNotFound, keystone.exception.UserNotFound
authenticate(user_id=None, tenant_id=None, password=None)

Authenticate a given user, tenant and password.

Returns:(user_ref, tenant_ref, metadata_ref)
Raises :AssertionError
check_user_in_group(user_id, group_id)

Checks if a user is a member of a group.

Raises :keystone.exception.UserNotFound, keystone.exception.GroupNotFound
create_credential(credential_id, credential)

Creates a new credential.

Raises :keystone.exception.Conflict
create_domain(domain_id, domain)

Creates a new domain.

Raises :keystone.exception.Conflict
create_group(group_id, group)

Creates a new group.

Raises :keystone.exception.Conflict
create_metadata(user_id, tenant_id, metadata, domain_id=None, group_id=None)

Creates the metadata for the specified user/group on project/domain.

Returns:metadata created
create_project(project_id, project)

Creates a new project.

Raises :keystone.exception.Conflict
create_role(role_id, role)

Creates a new role.

Raises :keystone.exception.Conflict
create_user(user_id, user)

Creates a new user.

Raises :keystone.exception.Conflict
delete_credential(credential_id)

Deletes an existing credential.

Raises :keystone.exception.CredentialNotFound
delete_domain(domain_id)

Deletes an existing domain.

Raises :keystone.exception.DomainNotFound
delete_group(group_id)

Deletes an existing group.

Raises :keystone.exception.GroupNotFound
delete_project(project_id)

Deletes an existing project.

Raises :keystone.exception.ProjectNotFound
delete_role(role_id)

Deletes an existing role.

Raises :keystone.exception.RoleNotFound
delete_user(user_id)

Deletes an existing user.

Raises :keystone.exception.UserNotFound
get_credential(credential_id)

Get a credential by ID.

Returns:credential_ref
Raises :keystone.exception.CredentialNotFound
get_domain(domain_id)

Get a domain by ID.

Returns:domain_ref
Raises :keystone.exception.DomainNotFound
get_domain_by_name(domain_name)

Get a domain by name.

Returns:domain_ref
Raises :keystone.exception.DomainNotFound
get_group(group_id)

Get a group by ID.

Returns:group_ref
Raises :keystone.exception.GroupNotFound
get_metadata(user_id=None, tenant_id=None, domain_id=None, group_id=None)

Gets the metadata for the specified user/group on project/domain.

Raises :keystone.exception.MetadataNotFound
Returns:metadata
get_project()

Get a project by ID.

Returns:user_ref
Raises :keystone.exception.ProjectNotFound
get_project_by_name(tenant_name, domain_id)

Get a tenant by name.

Returns:tenant_ref
Raises :keystone.exception.ProjectNotFound
get_project_users(tenant_id)

Lists all users with a relationship to the specified project.

Returns:a list of user_refs or an empty set.
Raises :keystone.exception.ProjectNotFound
get_projects_for_user(user_id)

Get the tenants associated with a given user.

Returns:a list of tenant_id’s.
Raises :keystone.exception.UserNotFound
get_role(role_id)

Get a role by ID.

Returns:role_ref
Raises :keystone.exception.RoleNotFound
get_roles_for_user_and_domain(user_id, domain_id)

Get the roles associated with a user within given domain.

This includes roles directly assigned to the user on the domain, as well as those by virtue of group membership.

Returns:a list of role ids.
Raises :keystone.exception.UserNotFound, keystone.exception.DomainNotFound
get_roles_for_user_and_project(user_id, tenant_id)

Get the roles associated with a user within given tenant.

This includes roles directly assigned to the user on the project, as well as those by virtue of group membership.

Returns:a list of role ids.
Raises :keystone.exception.UserNotFound, keystone.exception.ProjectNotFound
get_user(user_id)

Get a user by ID.

Returns:user_ref
Raises :keystone.exception.UserNotFound
get_user_by_name(user_name, domain_id)

Get a user by name.

Returns:user_ref
Raises :keystone.exception.UserNotFound
list_credentials()

List all credentials in the system.

Returns:a list of credential_refs or an empty list.
list_domains()

List all domains in the system.

Returns:a list of domain_refs or an empty list.
list_groups()

List all groups in the system.

Returns:a list of group_refs or an empty list.
list_groups_for_user(user_id)

List all groups a user is in

Returns:a list of group_refs or an empty list.
list_projects()

List all projects in the system.

Returns:a list of project_refs or an empty list.
list_roles()

List all roles in the system.

Returns:a list of role_refs or an empty list.
list_user_projects(user_id)

List all projects associated with a given user.

Returns:a list of project_refs or an empty list.
list_users()

List all users in the system.

Returns:a list of user_refs or an empty list.
list_users_in_group(group_id)

List all users in a group.

Returns:a list of user_refs or an empty list.
remove_role_from_user_and_project(user_id, tenant_id, role_id)

Remove a role from a user within given tenant.

Raises :keystone.exception.UserNotFound, keystone.exception.ProjectNotFound, keystone.exception.RoleNotFound
remove_user_from_group(user_id, group_id)

Removes a user from a group.

Raises :keystone.exception.NotFound
remove_user_from_project(tenant_id, user_id)

Remove user from a tenant

Raises :keystone.exception.ProjectNotFound, keystone.exception.UserNotFound
update_credential(credential_id, credential)

Updates an existing credential.

Raises :keystone.exception.CredentialNotFound, keystone.exception.Conflict
update_domain(domain_id, domain)

Updates an existing domain.

Raises :keystone.exception.DomainNotFound, keystone.exception.Conflict
update_group(group_id, group)

Updates an existing group.

Raises :keystone.exceptionGroupNotFound, keystone.exception.Conflict
update_metadata(user_id, tenant_id, metadata, domain_id=None, group_id=None)

Updates the metadata for the specified user/group on project/domain.

Returns:metadata updated
update_project(project_id, project)

Updates an existing project.

Raises :keystone.exception.ProjectNotFound, keystone.exception.Conflict
update_role(role_id, role)

Updates an existing role.

Raises :keystone.exception.RoleNotFound, keystone.exception.Conflict
update_user(user_id, user)

Updates an existing user.

Raises :keystone.exception.UserNotFound, keystone.exception.Conflict
class keystone.identity.core.Manager(*args, **kwargs)

Bases: keystone.common.manager.Manager

Default pivot point for the Identity backend.

See keystone.common.manager.Manager for more details on how this dynamically calls the backend.

create_group(context, group_id, group_ref)
create_project(context, tenant_id, tenant_ref)
create_user(context, user_id, user_ref)
keystone.identity.core.filter_user(user_ref)

Filter out private items in a user dict.

‘password’, ‘tenants’ and ‘groups’ are never returned.

Returns:user_ref

Previous topic

The keystone.identity.controllers Module

Next topic

The keystone.identity.routers Module

This Page