Table Of Contents

Previous topic

keystone

Next topic

catalog Package

This Page

keystone Package

cli Module

class keystone.cli.BaseApp(argv=None)

Bases: object

missing_param(param)
run()
class keystone.cli.DbSync(*args, **kw)

Bases: keystone.cli.BaseApp

Sync the database.

main()
name = 'db_sync'
class keystone.cli.ExportLegacyCatalog(*args, **kw)

Bases: keystone.cli.BaseApp

Export the service catalog from a legacy database.

main()
name = 'export_legacy_catalog'
class keystone.cli.ImportLegacy(*args, **kw)

Bases: keystone.cli.BaseApp

Import a legacy database.

main()
name = 'import_legacy'
class keystone.cli.ImportNovaAuth(*args, **kw)

Bases: keystone.cli.BaseApp

Import a dump of nova auth data into keystone.

main()
name = 'import_nova_auth'
keystone.cli.main(argv=None, config_files=None)
keystone.cli.print_commands(cmds)
keystone.cli.run(cmd, args)

config Module

class keystone.config.CommonConfig(**kwargs)

Bases: keystone.config.ConfigMixin, keystone.openstack.common.cfg.CommonConfigOpts

class keystone.config.Config(project=None, prog=None, version=None, usage=None, default_config_files=None)

Bases: keystone.config.ConfigMixin, keystone.openstack.common.cfg.ConfigOpts

class keystone.config.ConfigMixin

Bases: object

set_usage(usage)
keystone.config.register_bool(*args, **kw)
keystone.config.register_cli_bool(*args, **kw)
keystone.config.register_cli_int(*args, **kw)
keystone.config.register_cli_str(*args, **kw)
keystone.config.register_int(*args, **kw)
keystone.config.register_str(*args, **kw)
keystone.config.setup_logging(conf)

Sets up the logging options for a log with supplied name

Parameters:conf – a cfg.ConfOpts object

exception Module

exception keystone.exception.Conflict(message=None, **kwargs)

Bases: keystone.exception.Error

Conflict occurred attempting to store %(type)s.

%(details)s

code = 409
title = 'Conflict'
exception keystone.exception.EndpointNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find endpoint: %(endpoint_id)s

exception keystone.exception.Error(message=None, **kwargs)

Bases: exceptions.StandardError

Base error class.

Child classes should define an HTTP status code, title, and a doc string.

code = None
title = None
exception keystone.exception.Forbidden(message=None, **kwargs)

Bases: keystone.exception.Error

You are not authorized to perform the requested action.

code = 403
title = 'Not Authorized'
exception keystone.exception.ForbiddenAction(message=None, **kwargs)

Bases: keystone.exception.Forbidden

You are not authorized to perform the requested action: %(action)s

exception keystone.exception.NotFound(message=None, **kwargs)

Bases: keystone.exception.Error

Could not find: %(target)s

code = 404
title = 'Not Found'
exception keystone.exception.NotImplemented(message=None, **kwargs)

Bases: keystone.exception.Error

The action you have requested has not been implemented.

action = 'Not Implemented'
code = 501
exception keystone.exception.RoleNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find role: %(role_id)s

exception keystone.exception.ServiceNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find service: %(service_id)s

exception keystone.exception.TenantNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find tenant: %(tenant_id)s

exception keystone.exception.TokenNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find token: %(token_id)s

exception keystone.exception.Unauthorized(message=None, **kwargs)

Bases: keystone.exception.Error

The request you have made requires authentication.

code = 401
title = 'Not Authorized'
exception keystone.exception.UnexpectedError(message=None, **kwargs)

Bases: keystone.exception.Error

An unexpected error prevented the server from fulfilling your request.

%(exception)s

code = 500
title = 'Internal Server Error'
exception keystone.exception.UserNotFound(message=None, **kwargs)

Bases: keystone.exception.NotFound

Could not find user: %(user_id)s

exception keystone.exception.ValidationError(message=None, **kwargs)

Bases: keystone.exception.Error

Expecting to find %(attribute)s in %(target)s.

The server could not comply with the request since it is either malformed or otherwise incorrect.

The client is assumed to be in error.

code = 400
title = 'Bad Request'
exception keystone.exception.ValidationSizeError(message=None, **kwargs)

Bases: keystone.exception.Error

Request attribute %(attribute)s must be less than or equal to %(size)i.

The server could not comply with the request because the attribute size is invalid (too large).

The client is assumed to be in error.

code = 400
title = 'Bad Request'

service Module

class keystone.service.AdminExtensionsController(*args, **kwargs)

Bases: keystone.service.ExtensionsController

class keystone.service.AdminRouter

Bases: keystone.common.wsgi.ComposingRouter

class keystone.service.AdminVersionRouter

Bases: keystone.common.wsgi.ComposingRouter

class keystone.service.ExtensionsController(extensions=None)

Bases: keystone.common.wsgi.Application

Base extensions controller to be extended by public and admin API’s.

get_extension_info(context, extension_alias)
get_extensions_info(context)
class keystone.service.NoopController

Bases: keystone.common.wsgi.Application

noop(context)
class keystone.service.PublicExtensionsController(extensions=None)

Bases: keystone.service.ExtensionsController

class keystone.service.PublicRouter

Bases: keystone.common.wsgi.ComposingRouter

class keystone.service.PublicVersionRouter

Bases: keystone.common.wsgi.ComposingRouter

class keystone.service.TokenController

Bases: keystone.common.wsgi.Application

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.

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.

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.

class keystone.service.VersionController(version_type)

Bases: keystone.common.wsgi.Application

get_version(context)
get_versions(context)
keystone.service.admin_app_factory(*args, **kw)
keystone.service.admin_version_app_factory(*args, **kw)
keystone.service.public_app_factory(*args, **kw)
keystone.service.public_version_app_factory(*args, **kw)

test Module

class keystone.test.TestCase(*args, **kw)

Bases: unittest.case.TestCase

add_path(path)
appconfig(config)
assertDeepEquals(actual, expected)
assertDictEquals(actual, expected)
assertIn(needle, haystack)
assertIsNone(actual)
assertIsNotNone(actual)
assertListEquals(actual, expected)
assertNotIn(needle, haystack)
clear_module(module)
client(app, *args, **kw)
config()
load_backends()

Hacky shortcut to load the backends for data manipulation.

load_fixtures(fixtures)

Hacky basic and naive fixture loading based on a python module.

Expects that the various APIs into the various services are already defined on self.

loadapp(config, name='main')
opt(**kw)
opt_in_group(group, **kw)
reset_opts()
serveapp(config, name=None)
setUp()
tearDown()
class keystone.test.TestClient(app=None, token=None)

Bases: object

get(path, headers=None)
post(path, headers=None, body=None)
put(path, headers=None, body=None)
request(method, path, headers=None, body=None)
keystone.test.checkout_vendor(repo, rev)
keystone.test.etcdir(*p)
keystone.test.rootdir(*p)
keystone.test.testsdir(*p)