Module Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Str ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body If CompareNotIn Str AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str If CompareEq NameLoad Str body AugAssignAdd NameStore BinOpAdd Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str BinOpMod Str TupleLoad NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Return NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr Str Assign NameStore BoolOpOr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad Return AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If UnaryOpNot NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMod NameLoad Call NameLoad Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpAnd CompareGt Call NameLoad NameLoad Num CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore SubscriptLoad NameLoad Index Num TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr If CompareNotIn NameLoad ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad body Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr orelse TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad NameLoad Str Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMod NameLoad Call NameLoad Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Return CompareIn Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad NameLoad decorator_list TryExcept body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Str handlers ExceptHandler type NameLoad name NameStore body Assign NameStore BinOpMod Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If BoolOpAnd NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str NameLoad Return NameLoad orelse Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad If NameLoad body Assign NameStore BinOpSub Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If CompareGtE AttributeLoad NameLoad attr Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad NameLoad Index Str orelse Return SubscriptLoad NameLoad Index Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Raise Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Assign NameStore NameLoad If BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr attr Assign NameStore Dict Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Str Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Str body AugAssignAdd SubscriptStore NameLoad Index Str BinOpAdd Str NameLoad Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Return TupleLoad NameLoad NameLoad orelse If BoolOpAnd NameLoad CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpMod Call NameLoad Str Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A hashlib N/A time N/A webob.exc N/A webob.dec nova auth nova context nova exception nova flags nova log logging nova utils nova wsgi nova.api.openstack common nova.api.openstack faults N/A LOG N/A N/A logging getLogger nova.api.openstack N/A FLAGS N/A flags FLAGS N/A N/A N/A flags DECLARE use_forwarded_for nova.api.auth NoAuthMiddleware N/A N/A wsgi Middleware N/A N/A Return a fake token if one isn't specified. __call__ N/A N/A self req N/A N/A N/A N/A X-Auth-Token N/A req headers N/A N/A os_url N/A req url N/A version N/A N/A common get_version_from_href os_url N/A user_id N/A N/A N/A req headers get X-Auth-User admin N/A project_id N/A N/A N/A req headers get X-Auth-Project-Id admin N/A N/A version 1.1 N/A N/A os_url N/A / project_id N/A res N/A N/A webob Response N/A N/A N/A res headers N/A X-Auth-Token N/A %s:%s N/A user_id project_id N/A N/A N/A res headers N/A X-Server-Management-Url os_url N/A N/A N/A res headers N/A X-Storage-Url N/A N/A N/A res headers N/A X-CDN-Management-Url N/A N/A res content_type text/plain N/A N/A res status 204 N/A res N/A token N/A N/A req headers N/A X-Auth-Token N/A N/A user_id _sep project_id N/A N/A token partition : N/A project_id N/A project_id user_id N/A remote_address N/A getattr req remote_address 127.0.0.1 N/A N/A FLAGS use_forwarded_for N/A N/A remote_address N/A N/A N/A req headers get X-Forwarded-For remote_address N/A ctx N/A N/A context RequestContext user_id project_id is_admin True remote_address remote_address N/A N/A N/A req environ N/A nova.context ctx N/A N/A self application N/A N/A N/A N/A webob dec wsgify RequestClass N/A wsgi Request N/A AuthMiddleware N/A N/A wsgi Middleware N/A N/A Authorize the openstack API request or return an HTTP Forbidden. __init__ N/A N/A self application db_driver N/A None N/A N/A N/A db_driver N/A N/A db_driver N/A FLAGS db_driver N/A N/A self db N/A N/A utils import_object db_driver N/A N/A self auth N/A N/A N/A auth manager AuthManager N/A N/A N/A N/A super AuthMiddleware self __init__ application N/A __call__ N/A N/A self req N/A N/A N/A N/A N/A N/A self has_authentication req N/A N/A N/A N/A self authenticate req N/A user_id N/A N/A self get_user_by_authentication req N/A N/A user_id N/A N/A token N/A N/A req headers N/A X-Auth-Token N/A msg N/A _ %(user_id)s could not be found with token '%(token)s' N/A N/A N/A LOG warn N/A msg N/A locals N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A projects N/A N/A N/A self auth get_projects user_id N/A N/A projects N/A N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A project_id N/A path_parts N/A N/A N/A req path split / N/A N/A N/A N/A len path_parts 1 N/A N/A path_parts N/A 1 v1.1 N/A N/A project_id N/A path_parts N/A 2 N/A N/A N/A project N/A N/A N/A self auth get_project project_id N/A N/A N/A N/A exception ProjectNotFound N/A N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A N/A project_id N/A N/A p id N/A p projects N/A N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A N/A N/A N/A project_id N/A N/A req headers N/A X-Auth-Project-Id N/A N/A N/A KeyError N/A N/A project_id N/A N/A projects N/A 0 id N/A is_admin N/A N/A N/A self auth is_admin user_id N/A remote_address N/A getattr req remote_address 127.0.0.1 N/A N/A FLAGS use_forwarded_for N/A N/A remote_address N/A N/A N/A req headers get X-Forwarded-For remote_address N/A ctx N/A N/A context RequestContext user_id project_id is_admin is_admin remote_address remote_address N/A N/A N/A req environ N/A nova.context ctx N/A N/A N/A is_admin N/A N/A N/A N/A self auth is_project_member user_id project_id N/A N/A msg N/A _ %(user_id)s must be an admin or a member of %(project_id)s N/A N/A N/A LOG warn N/A msg N/A locals N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A N/A self application N/A N/A N/A N/A webob dec wsgify RequestClass N/A wsgi Request has_authentication N/A N/A self req N/A N/A N/A N/A X-Auth-Token N/A req headers N/A get_user_by_authentication N/A N/A self req N/A N/A N/A N/A N/A self authorize_token N/A N/A req headers N/A X-Auth-Token N/A authenticate N/A N/A self req N/A N/A N/A path_info N/A req path_info N/A N/A N/A len path_info 1 N/A N/A msg N/A _ Authentication requests must be made against a version root (e.g. /v1.0 or /v1.1). N/A N/A N/A LOG warn msg N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized explanation msg _get_auth_header N/A N/A key N/A N/A N/A Ensures that the KeyError returned is meaningful. N/A N/A N/A N/A N/A req headers N/A key N/A N/A N/A KeyError N/A ex N/A N/A N/A KeyError key N/A N/A N/A N/A username N/A _get_auth_header X-Auth-User N/A key N/A _get_auth_header X-Auth-Key N/A N/A N/A KeyError N/A ex N/A N/A msg N/A N/A _ Could not find %s in request. ex N/A N/A N/A LOG warn msg N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized explanation msg N/A N/A token user N/A N/A self _authorize_user username key req N/A N/A user token N/A N/A res N/A N/A webob Response N/A N/A N/A res headers N/A X-Auth-Token N/A token N/A token_hash N/A N/A N/A res headers N/A X-Server-Management-Url N/A token N/A server_management_url N/A N/A N/A res headers N/A X-Storage-Url N/A token N/A storage_url N/A N/A N/A res headers N/A X-CDN-Management-Url N/A token N/A cdn_management_url N/A N/A res content_type text/plain N/A N/A res status 204 N/A N/A N/A LOG debug N/A N/A _ Successfully authenticated '%s' username N/A res N/A N/A N/A N/A faults Fault N/A N/A N/A webob exc HTTPUnauthorized N/A authorize_token N/A N/A self token_hash N/A N/A N/A  retrieves user information from the datastore given a token

        If the token has expired, returns None
        If the token is not found, returns None
        Otherwise returns dict(id=(the authorized user's id))

        This method will also remove the token if the timestamp is older than
        2 days ago.
         N/A ctxt N/A N/A context get_admin_context N/A N/A N/A token N/A N/A N/A self db auth_token_get ctxt token_hash N/A N/A N/A N/A exception NotFound N/A N/A None N/A token N/A N/A delta N/A N/A N/A utils utcnow N/A token N/A created_at N/A N/A N/A delta days 2 N/A N/A N/A N/A N/A self db auth_token_destroy ctxt N/A token N/A token_hash N/A N/A N/A token N/A user_id N/A None N/A _authorize_user N/A N/A self username key req N/A N/A N/A Generates a new token and assigns it to a user.

        username - string
        key - string API key
        req - wsgi.Request object
         N/A ctxt N/A N/A context get_admin_context N/A project_id N/A N/A N/A req headers get X-Auth-Project-Id N/A N/A project_id None N/A N/A user N/A N/A N/A self auth get_user_from_access_key key N/A projects N/A N/A N/A self auth get_projects N/A user id N/A N/A projects N/A N/A N/A N/A N/A webob exc HTTPUnauthorized N/A project_id N/A N/A projects N/A 0 id N/A N/A N/A user N/A N/A N/A self auth get_user_from_access_key key N/A N/A N/A N/A exception NotFound N/A N/A N/A N/A LOG warn N/A _ User not found with provided API key. N/A user None N/A N/A user N/A N/A user name username N/A N/A token_hash N/A N/A N/A N/A hashlib sha1 N/A %s%s%f N/A username key N/A N/A time time hexdigest N/A token_dict N/A N/A N/A token_dict N/A token_hash token_hash N/A N/A token_dict N/A cdn_management_url N/A os_url N/A req url N/A N/A token_dict N/A server_management_url N/A N/A os_url strip / N/A version N/A N/A common get_version_from_href os_url N/A N/A version 1.1 N/A N/A N/A token_dict N/A server_management_url N/A / project_id N/A N/A token_dict N/A storage_url N/A N/A token_dict N/A user_id N/A user id N/A token N/A N/A N/A self db auth_token_create ctxt token_dict N/A N/A token user N/A N/A N/A user N/A N/A user name username N/A N/A msg N/A N/A _ Provided API key is valid, but not for user '%(username)s' N/A locals N/A N/A N/A LOG warn msg N/A N/A None None N/A N/A