2016-03-13

Openstack code study of keystone auth and catalog

Here we study the keystone functional units: auth and catalog.
The auth takes  care of oauth1,password,saml2 and token.
The catalog handles kvs and sql back end drivers for the functions create/update/delete/list of the data by region, service and endpoint.

The classes and methods of auth and catalog are listed as follows:(Click the def link can see the detailed python code on the CubicPower.)

\OpenStack\keystone-2014.1\keystone\auth\controllers.py

def load_auth_methods():
def get_auth_method(method_name):
class AuthInfo(object):
    def create(context, auth=None):
    def __init__(self, context, auth=None):
    def _assert_project_is_enabled(self, project_ref):
    def _assert_domain_is_enabled(self, domain_ref):
    def _lookup_domain(self, domain_info):
    def _lookup_project(self, project_info):
    def _lookup_trust(self, trust_info):
    def _validate_and_normalize_scope_data(self):
    def _validate_auth_methods(self):
    def _validate_and_normalize_auth_data(self):
    def get_method_names(self):
    def get_method_data(self, method):
    def get_scope(self):
    def set_scope(self, domain_id=None, project_id=None, trust=None):
class Auth(controller.V3Controller):
    def __init__(self, *args, **kw):
    def authenticate_for_token(self, context, auth=None):
    def _check_and_set_default_scoping(self, auth_info, auth_context):
    def authenticate(self, context, auth_info, auth_context):
    def check_token(self, context):
    def revoke_token(self, context):
    def validate_token(self, context):
    def revocation_list(self, context, auth=None):
def render_token_data_response(token_id, token_data, created=False):

\OpenStack\keystone-2014.1\keystone\auth\core.py

class AuthMethodHandler(object):
    def __init__(self):
    def authenticate(self, context, auth_payload, auth_context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\external.py

class Base(auth.AuthMethodHandler):
    def authenticate(self, context, auth_info, auth_context):
    def _authenticate(self, remote_user, context):
class DefaultDomain(Base):
    def _authenticate(self, remote_user, context):
class Domain(Base):
    def _authenticate(self, remote_user, context):
class ExternalDefault(DefaultDomain):
    def __init__(self):
class ExternalDomain(Domain):
    def __init__(self):
class LegacyDefaultDomain(Base):
    def __init__(self):
    def _authenticate(self, remote_user, context):
class LegacyDomain(Base):
    def __init__(self):
    def _authenticate(self, remote_user, context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\oauth1.py

class OAuth(auth.AuthMethodHandler):
    def authenticate(self, context, auth_info, auth_context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\password.py

class UserAuthInfo(object):
    def create(auth_payload):
    def __init__(self):
    def _assert_domain_is_enabled(self, domain_ref):
    def _assert_user_is_enabled(self, user_ref):
    def _lookup_domain(self, domain_info):
    def _validate_and_normalize_auth_data(self, auth_payload):
class Password(auth.AuthMethodHandler):
    def authenticate(self, context, auth_payload, user_context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\saml2.py

class Saml2(auth.AuthMethodHandler):
    def authenticate(self, context, auth_payload, auth_context):
    def _handle_scoped_token(self, auth_payload):
    def _handle_unscoped_token(self, context, auth_payload):
    def _validate_expiration(self, token_ref):
    def _validate_groups(self, group_ids, mapping_id):
    def _get_assertion_params_from_env(self, context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\token.py

class Token(auth.AuthMethodHandler):
    def __init__(self):
    def authenticate(self, context, auth_payload, user_context):

\OpenStack\keystone-2014.1\keystone\auth\plugins\__init__.py

\OpenStack\keystone-2014.1\keystone\auth\routers.py

def append_v3_routers(mapper, routers):

\OpenStack\keystone-2014.1\keystone\auth\__init__.py

\OpenStack\keystone-2014.1\keystone\catalog\backends\kvs.py

class Catalog(kvs.Base, catalog.Driver):
    def get_catalog(self, user_id, tenant_id, metadata=None):
    def _delete_child_regions(self, region_id):
    def _check_parent_region(self, region_ref):
    def create_region(self, region):
    def list_regions(self):
    def get_region(self, region_id):
    def update_region(self, region_id, region):
    def delete_region(self, region_id):
    def create_service(self, service_id, service):
    def list_services(self, hints):
    def get_service(self, service_id):
    def update_service(self, service_id, service):
    def delete_service(self, service_id):
    def create_endpoint(self, endpoint_id, endpoint):
    def list_endpoints(self, hints):
    def get_endpoint(self, endpoint_id):
    def update_endpoint(self, endpoint_id, endpoint):
    def delete_endpoint(self, endpoint_id):
    def _create_catalog(self, user_id, tenant_id, data):
    def get_v3_catalog(self, user_id, tenant_id, metadata=None):

\OpenStack\keystone-2014.1\keystone\catalog\backends\sql.py

class Region(sql.ModelBase, sql.DictBase):
class Service(sql.ModelBase, sql.DictBase):
class Endpoint(sql.ModelBase, sql.DictBase):
class Catalog(catalog.Driver):
    def db_sync(self, version=None):
    def list_regions(self):
    def _get_region(self, session, region_id):
    def _delete_child_regions(self, session, region_id):
    def _check_parent_region(self, session, region_ref):
    def get_region(self, region_id):
    def delete_region(self, region_id):
    def create_region(self, region_ref):
    def update_region(self, region_id, region_ref):
    def list_services(self, hints):
    def _get_service(self, session, service_id):
    def get_service(self, service_id):
    def delete_service(self, service_id):
    def create_service(self, service_id, service_ref):
    def update_service(self, service_id, service_ref):
    def create_endpoint(self, endpoint_id, endpoint_ref):
    def delete_endpoint(self, endpoint_id):
    def _get_endpoint(self, session, endpoint_id):
    def get_endpoint(self, endpoint_id):
    def list_endpoints(self, hints):
    def update_endpoint(self, endpoint_id, endpoint_ref):
    def get_catalog(self, user_id, tenant_id, metadata=None):
    def get_v3_catalog(self, user_id, tenant_id, metadata=None):
        def make_v3_endpoint(endpoint):

\OpenStack\keystone-2014.1\keystone\catalog\backends\templated.py

def parse_templates(template_lines):
class Catalog(kvs.Catalog):
    def __init__(self, templates=None):
    def _load_templates(self, template_file):
    def get_catalog(self, user_id, tenant_id, metadata=None):
    def get_v3_catalog(self, user_id, tenant_id, metadata=None):
class TemplatedCatalog(Catalog):

\OpenStack\keystone-2014.1\keystone\catalog\backends\__init__.py

\OpenStack\keystone-2014.1\keystone\catalog\controllers.py

class Service(controller.V2Controller):
    def get_services(self, context):
    def get_service(self, context, service_id):
    def delete_service(self, context, service_id):
    def create_service(self, context, OS_KSADM_service):
class Endpoint(controller.V2Controller):
    def get_endpoints(self, context):
    def create_endpoint(self, context, endpoint):
    def delete_endpoint(self, context, endpoint_id):
class RegionV3(controller.V3Controller):
    def create_region_with_id(self, context, region_id, region):
    def create_region(self, context, region):
    def list_regions(self, context):
    def get_region(self, context, region_id):
    def update_region(self, context, region_id, region):
    def delete_region(self, context, region_id):
class ServiceV3(controller.V3Controller):
    def __init__(self):
    def _validate_service(self, service):
    def create_service(self, context, service):
    def list_services(self, context, filters):
    def get_service(self, context, service_id):
    def update_service(self, context, service_id, service):
    def delete_service(self, context, service_id):
class EndpointV3(controller.V3Controller):
    def __init__(self):
    def filter_endpoint(cls, ref):
    def wrap_member(cls, context, ref):
    def _validate_endpoint(self, endpoint):
    def create_endpoint(self, context, endpoint):
    def list_endpoints(self, context, filters):
    def get_endpoint(self, context, endpoint_id):
    def update_endpoint(self, context, endpoint_id, endpoint):
    def delete_endpoint(self, context, endpoint_id):

\OpenStack\keystone-2014.1\keystone\catalog\core.py

def format_url(url, data):
class Manager(manager.Manager):
    def __init__(self):
    def create_region(self, region_ref):
    def get_region(self, region_id):
    def delete_region(self, region_id):
    def create_service(self, service_id, service_ref):
    def get_service(self, service_id):
    def delete_service(self, service_id):
    def list_services(self, hints=None):
    def create_endpoint(self, endpoint_id, endpoint_ref):
    def delete_endpoint(self, endpoint_id):
    def get_endpoint(self, endpoint_id):
    def list_endpoints(self, hints=None):
    def get_catalog(self, user_id, tenant_id, metadata=None):
class Driver(object):
    def _get_list_limit(self):
    def create_region(self, region_ref):
    def list_regions(self):
    def get_region(self, region_id):
    def update_region(self, region_id):
    def delete_region(self, region_id):
    def create_service(self, service_id, service_ref):
    def list_services(self):
    def get_service(self, service_id):
    def update_service(self, service_id):
    def delete_service(self, service_id):
    def create_endpoint(self, endpoint_id, endpoint_ref):
    def get_endpoint(self, endpoint_id):
    def list_endpoints(self):
    def update_endpoint(self, endpoint_id, endpoint_ref):
    def delete_endpoint(self, endpoint_id):
    def get_catalog(self, user_id, tenant_id, metadata=None):
    def get_v3_catalog(self, user_id, tenant_id, metadata=None):

\OpenStack\keystone-2014.1\keystone\catalog\routers.py

def append_v3_routers(mapper, routers):

\OpenStack\keystone-2014.1\keystone\catalog\__init__.py

No comments:

Post a Comment