The keystone.token.controllers Module

class keystone.token.controllers.Auth(*args, **kwargs)

Bases: keystone.common.controller.V2Controller

authenticate(context, auth=None)

Authenticate credentials and return a token.

Accept auth as a dict that looks like:

{
    "auth":{
        "passwordCredentials":{
            "username":"test_user",
            "password":"mypass"
        },
        "tenantName":"customer-x"
    }
}

In this case, tenant is optional, if not provided the token will be considered “unscoped” and can later be used to get a scoped token.

Alternatively, this call accepts auth with only a token and tenant that will return a token that is scoped to that tenant.

ca_cert(context, auth=None)
delete_token(context, token_id)

Delete a token, effectively invalidating it for authz.

endpoints(context, token_id)

Return a list of endpoints available to the token.

classmethod format_authenticate(token_ref, roles_ref, catalog_ref)
classmethod format_catalog(catalog_ref)

Munge catalogs from internal to output format Internal catalogs look like:

{$REGION: {
{$SERVICE: {
$key1: $value1, ... }

}

}

The legacy api wants them to look like

[{‘name’: $SERVICE[name],

‘type’: $SERVICE, ‘endpoints’: [{

‘tenantId’: $tenant_id, ... ‘region’: $REGION, }],

‘endpoints_links’: [],

}]

classmethod format_endpoint_list(catalog_ref)

Formats a list of endpoints according to Identity API v2.

The v2.0 API wants an endpoint list to look like:

{
    'endpoints': [
        {
            'id': $endpoint_id,
            'name': $SERVICE[name],
            'type': $SERVICE,
            'tenantId': $tenant_id,
            'region': $REGION,
        }
    ],
    'endpoints_links': [],
}
classmethod format_token(token_ref, roles_ref, catalog_ref=None)
revocation_list(context, auth=None)
signing_cert(context, auth=None)
validate_token(context, token_id)

Check that a token is valid.

Optionally, also ensure that it is owned by a specific tenant.

Returns metadata about the token along any associated roles.

validate_token_head(context, token_id)

Check that a token is valid.

Optionally, also ensure that it is owned by a specific tenant.

Identical to validate_token, except does not return a response.

exception keystone.token.controllers.ExternalAuthNotApplicable

Bases: exceptions.Exception

External authentication is not applicable

Previous topic

The keystone.token.backends.sql Module

Next topic

The keystone.token.core Module

This Page