keystone.identity.mapping_backends.sql module

class keystone.identity.mapping_backends.sql.IDMapping(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, keystone.common.sql.core.ModelDictMixin

domain_id
entity_type
local_id
public_id
class keystone.identity.mapping_backends.sql.Mapping[source]

Bases: keystone.identity.mapping_backends.base.MappingDriverBase

create_id_mapping(local_entity, public_id=None)[source]

Create and store a mapping to a public_id.

Parameters
  • local_entity (dict) – Containing the entity domain, local ID and type (‘user’ or ‘group’).

  • public_id – If specified, this will be the public ID. If this is not specified, a public ID will be generated.

Returns

public ID

delete_id_mapping(public_id)[source]

Delete an entry for the given public_id.

Parameters

public_id – The public ID for the mapping to be deleted.

The method is silent if no mapping is found.

get_domain_mapping_list(domain_id, entity_type=None)[source]

Return mappings for the domain.

Parameters
  • domain_id – Domain ID to get mappings for.

  • entity_type (String, one of mappings defined in keystone.identity.mapping_backends.mapping.EntityType) – Optional entity_type to get mappings for.

Returns

list of mappings.

get_id_mapping(public_id)[source]

Return the local mapping.

Parameters

public_id – The public ID for the mapping required.

Returns dict

Containing the entity domain, local ID and type. If no mapping is found, it returns None.

get_public_id(local_entity)[source]

Return the public ID for the given local entity.

Parameters

local_entity (dict) – Containing the entity domain, local ID and type (‘user’ or ‘group’).

Returns

public ID, or None if no mapping is found.

purge_mappings(purge_filter)[source]

Purge selected identity mappings.

Parameters

purge_filter (dict) – Containing the attributes of the filter that defines which entries to purge. An empty filter means purge all mappings.