Module ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias identifier Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Assign NameStore BinOpMult BinOpMult BinOpMult Num Num Num Num FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad If BoolOpAnd NameLoad CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Delete SubscriptDel NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Str If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Dict Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body If CompareNotIn SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Raise Call NameLoad Num Str AttributeLoad NameLoad attr Assign NameStore Yield Call SubscriptLoad AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Str NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If CompareEq Call NameLoad BinOpSub Call NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad SubscriptLoad NameLoad Index Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Num Str AttributeLoad NameLoad attr If CompareNotIn Str NameLoad body Raise Call NameLoad Num Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str Dict Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Yield Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If BoolOpAnd NameLoad CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore 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 NameLoad Assign SubscriptStore Call AttributeLoad NameLoad attr Str Dict Index NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr Str Dict attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If BoolOpOr CompareNotIn Str NameLoad CompareNotIn Str NameLoad body Raise Call NameLoad Num Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign TupleStore NameStore NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body Assign NameStore SubscriptLoad NameLoad Index Str handlers ExceptHandler type NameLoad body Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Dict Str Str Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIn Str NameLoad SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Yield Call NameLoad If CompareNotIn Str NameLoad body Raise Call NameLoad Num Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Yield Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Return Dict Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Dict For NameStore NameLoad body For NameStore NameLoad body If BoolOpAnd CompareIn NameLoad NameLoad CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call SubscriptLoad NameLoad Index NameLoad Return Dict Str Str Str SubscriptLoad NameLoad Index Str ListComp Dict Str NameLoad comprehension NameStore NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareNotIn NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad If UnaryOpNot NameLoad body While BoolOpOr CompareIs NameLoad NameLoad CompareIn NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict Str NameLoad Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body TryExcept body Expr Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Call AttributeLoad NameLoad attr Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore BoolOpOr NameLoad ListLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore BinOpAdd NameLoad BinOpMult BinOpMult Num Num Num Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr Num Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore BinOpAdd NameLoad BinOpMult BinOpMult Num Num Num Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad Return Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr keyword Str keyword AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Str For NameStore AttributeLoad NameLoad attr body If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return SubscriptLoad AttributeLoad NameLoad attr Slice Call NameLoad NameLoad Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore IfExp NameLoad ListLoad AttributeLoad NameLoad attr ListLoad Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Yield Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Assign SubscriptStore AttributeLoad NameLoad attr Index SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Num If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr If CompareLt NameLoad BinOpSub NameLoad AttributeLoad NameLoad attr body Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list
N/A twisted.internet defer _base BaseHandler synapse.api.constants LoginType synapse.types UserID synapse.api.errors AuthError LoginError Codes synapse.util.async run_on_reactor twisted.web.client PartialDownloadError N/A logging N/A bcrypt N/A pymacaroons N/A simplejson N/A synapse.util.stringutils stringutils N/A logger N/A N/A logging getLogger __name__ AuthHandler N/A BaseHandler N/A N/A SESSION_EXPIRE_MS N/A N/A N/A 48 60 60 1000 __init__ N/A N/A self hs N/A N/A N/A N/A N/A N/A super AuthHandler self __init__ hs N/A N/A self checkers N/A N/A LoginType PASSWORD N/A LoginType RECAPTCHA N/A LoginType EMAIL_IDENTITY N/A LoginType DUMMY N/A self _check_password_auth N/A self _check_recaptcha N/A self _check_email_identity N/A self _check_dummy_auth N/A N/A self bcrypt_rounds N/A N/A hs config bcrypt_rounds N/A N/A self sessions N/A N/A N/A self INVALID_TOKEN_HTTP_STATUS 401 N/A check_auth N/A N/A self flows clientdict clientip N/A N/A N/A 
        Takes a dictionary sent by the client in the login / registration
        protocol and handles the login flow.

        As a side effect, this function fills in the 'creds' key on the user's
        session with a map, which maps each auth-type (str) to the relevant
        identity authenticated by that auth-type (mostly str, but for captcha, bool).

        Args:
            flows (list): A list of login flows. Each flow is an ordered list of
                          strings representing auth-types. At least one full
                          flow must be completed in order for auth to be successful.
            clientdict: The dictionary from the client root level, not the
                        'auth' key: this method prompts for auth if none is sent.
            clientip (str): The IP address of the client.
        Returns:
            A tuple of (authed, dict, dict, session_id) where authed is true if
            the client has successfully completed an auth flow. If it is true
            the first dict contains the authenticated credentials of each stage.

            If authed is false, the first dictionary is the server response to
            the login request and should be passed back to the client.

            In either case, the second dict contains the parameters for this
            request (which may have been given only in a previous call).

            session_id is the ID of this session, either passed in by the client
            or assigned by the call to check_auth
         N/A authdict None N/A sid None N/A N/A clientdict N/A auth clientdict N/A N/A authdict N/A clientdict N/A auth N/A N/A clientdict N/A auth N/A N/A session authdict N/A N/A sid N/A authdict N/A session N/A session N/A N/A self _get_session_info sid N/A N/A N/A len clientdict 0 N/A N/A N/A session N/A clientdict clientdict N/A N/A N/A self _save_session session N/A N/A N/A clientdict session N/A N/A clientdict N/A session N/A clientdict N/A N/A authdict N/A N/A N/A N/A defer returnValue N/A False N/A N/A self _auth_dict_for_flows flows session clientdict N/A session N/A id N/A N/A creds session N/A N/A N/A session N/A creds N/A N/A creds N/A session N/A creds N/A N/A type authdict N/A N/A N/A N/A authdict N/A type N/A self checkers N/A N/A N/A LoginError 400 N/A Codes UNRECOGNIZED N/A result N/A N/A N/A N/A self checkers N/A N/A authdict N/A type authdict clientip N/A result N/A N/A N/A creds N/A N/A authdict N/A type result N/A N/A N/A self _save_session session N/A f flows N/A N/A N/A N/A len N/A N/A set f N/A set N/A N/A creds keys 0 N/A N/A N/A N/A logger info Auth completed with creds: %r creds N/A N/A N/A defer returnValue N/A True creds clientdict N/A session N/A id N/A ret N/A N/A self _auth_dict_for_flows flows session N/A N/A ret N/A completed N/A N/A creds keys N/A N/A N/A defer returnValue N/A False ret clientdict N/A session N/A id N/A N/A defer inlineCallbacks add_oob_auth N/A N/A self stagetype authdict clientip N/A N/A N/A 
        Adds the result of out-of-band authentication into an existing auth
        session. Currently used for adding the result of fallback auth.
         N/A N/A stagetype N/A self checkers N/A N/A N/A LoginError 400 N/A Codes MISSING_PARAM N/A N/A session authdict N/A N/A N/A LoginError 400 N/A Codes MISSING_PARAM N/A sess N/A N/A self _get_session_info N/A authdict N/A session N/A N/A creds sess N/A N/A N/A sess N/A creds N/A N/A creds N/A sess N/A creds N/A result N/A N/A N/A N/A self checkers N/A stagetype authdict clientip N/A result N/A N/A N/A creds N/A stagetype result N/A N/A N/A self _save_session sess N/A N/A N/A defer returnValue True N/A N/A N/A defer returnValue False N/A N/A defer inlineCallbacks get_session_id N/A N/A self clientdict N/A N/A N/A 
        Gets the session ID for a client given the client dictionary
        :param clientdict: The dictionary sent by the client in the request
        :return: The string session ID the client sent. If the client did not
                 send a session ID, returns None.
         N/A sid None N/A N/A clientdict N/A auth clientdict N/A N/A authdict N/A clientdict N/A auth N/A N/A session authdict N/A N/A sid N/A authdict N/A session N/A sid N/A set_session_data N/A N/A self session_id key value N/A N/A N/A 
        Store a key-value pair into the sessions data associated with this
        request. This data is stored server-side and cannot be modified by
        the client.
        :param session_id: (string) The ID of this session as returned from check_auth
        :param key: (string) The key to store the data under
        :param value: (any) The data to store
         N/A sess N/A N/A self _get_session_info session_id N/A N/A N/A N/A sess setdefault serverdict N/A N/A key value N/A N/A N/A self _save_session sess N/A get_session_data N/A N/A self session_id key default N/A None N/A N/A 
        Retrieve data stored with set_session_data
        :param session_id: (string) The ID of this session as returned from check_auth
        :param key: (string) The key to store the data under
        :param default: (any) Value to return if the key has not been set
         N/A sess N/A N/A self _get_session_info session_id N/A N/A N/A N/A N/A sess setdefault serverdict N/A get key default N/A _check_password_auth N/A N/A self authdict _ N/A N/A N/A N/A N/A user authdict N/A password authdict N/A N/A N/A LoginError 400 N/A Codes MISSING_PARAM N/A user_id N/A authdict N/A user N/A password N/A authdict N/A password N/A N/A N/A N/A user_id startswith @ N/A N/A user_id N/A N/A N/A N/A UserID create user_id N/A N/A self hs hostname to_string N/A N/A user_id password_hash N/A N/A N/A self _find_user_id_and_pwd_hash user_id N/A N/A N/A self _check_password user_id password password_hash N/A N/A N/A defer returnValue user_id N/A N/A defer inlineCallbacks _check_recaptcha N/A N/A self authdict clientip N/A N/A N/A N/A N/A user_response N/A authdict N/A response N/A N/A N/A KeyError N/A N/A N/A LoginError 400 Captcha response is required errcode N/A Codes CAPTCHA_NEEDED N/A N/A N/A logger info Submitting recaptcha response %s with remoteip %s user_response clientip N/A N/A N/A client N/A N/A N/A self hs get_simple_http_client N/A resp_body N/A N/A N/A client post_urlencoded_get_json N/A N/A N/A self hs config recaptcha_siteverify_api args N/A secret response remoteip N/A N/A N/A self hs config recaptcha_private_key user_response clientip N/A N/A N/A PartialDownloadError N/A pde N/A N/A data N/A pde response N/A resp_body N/A N/A simplejson loads data N/A N/A N/A success resp_body N/A resp_body N/A success N/A N/A N/A N/A defer returnValue True N/A N/A LoginError 401 errcode N/A Codes UNAUTHORIZED N/A N/A defer inlineCallbacks _check_email_identity N/A N/A self authdict _ N/A N/A N/A N/A N/A run_on_reactor N/A N/A threepid_creds authdict N/A N/A N/A LoginError 400 Missing threepid_creds N/A Codes MISSING_PARAM N/A threepid_creds N/A authdict N/A threepid_creds N/A identity_handler N/A N/A N/A N/A self hs get_handlers identity_handler N/A N/A N/A logger info N/A Getting validated threepid. threepidcreds: %r N/A threepid_creds N/A threepid N/A N/A N/A identity_handler threepid_from_creds threepid_creds N/A N/A threepid N/A N/A N/A LoginError 401 errcode N/A Codes UNAUTHORIZED N/A N/A threepid N/A threepid_creds N/A authdict N/A threepid_creds N/A N/A N/A defer returnValue threepid N/A N/A defer inlineCallbacks _check_dummy_auth N/A N/A self authdict _ N/A N/A N/A N/A N/A run_on_reactor N/A N/A N/A defer returnValue True N/A N/A defer inlineCallbacks _get_params_recaptcha N/A N/A self N/A N/A N/A N/A public_key N/A N/A N/A self hs config recaptcha_public_key N/A _auth_dict_for_flows N/A N/A self flows session N/A N/A N/A public_flows N/A N/A f flows N/A N/A N/A N/A public_flows append f N/A get_params N/A N/A LoginType RECAPTCHA N/A self _get_params_recaptcha N/A params N/A N/A f public_flows N/A N/A stage f N/A N/A N/A N/A stage get_params N/A stage params N/A N/A N/A params N/A stage N/A N/A get_params N/A stage N/A N/A session flows params N/A session N/A id N/A N/A stages f N/A f public_flows params N/A _get_session_info N/A N/A self session_id N/A N/A N/A N/A session_id N/A self sessions N/A N/A session_id None N/A N/A session_id N/A N/A N/A N/A session_id None N/A session_id N/A self sessions N/A N/A session_id N/A N/A stringutils random_string 24 N/A N/A N/A self sessions N/A session_id N/A id session_id N/A N/A N/A self sessions N/A session_id N/A login_with_password N/A N/A self user_id password N/A N/A N/A 
        Authenticates the user with their username and password.

        Used only by the v1 login API.

        Args:
            user_id (str): User ID
            password (str): Password
        Returns:
            A tuple of:
              The user's ID.
              The access token for the user's session.
              The refresh token for the user's session.
        Raises:
            StoreError if there was a problem storing the token.
            LoginError if there was an authentication problem.
         N/A N/A user_id password_hash N/A N/A N/A self _find_user_id_and_pwd_hash user_id N/A N/A N/A self _check_password user_id password password_hash N/A N/A N/A logger info Logging in user %s user_id N/A access_token N/A N/A N/A self issue_access_token user_id N/A refresh_token N/A N/A N/A self issue_refresh_token user_id N/A N/A N/A defer returnValue N/A user_id access_token refresh_token N/A N/A defer inlineCallbacks get_login_tuple_for_user_id N/A N/A self user_id N/A N/A N/A 
        Gets login tuple for the user with the given user ID.
        The user is assumed to have been authenticated by some other
        machanism (e.g. CAS)

        Args:
            user_id (str): User ID
        Returns:
            A tuple of:
              The user's ID.
              The access token for the user's session.
              The refresh token for the user's session.
        Raises:
            StoreError if there was a problem storing the token.
            LoginError if there was an authentication problem.
         N/A N/A user_id ignored N/A N/A N/A self _find_user_id_and_pwd_hash user_id N/A N/A N/A logger info Logging in user %s user_id N/A access_token N/A N/A N/A self issue_access_token user_id N/A refresh_token N/A N/A N/A self issue_refresh_token user_id N/A N/A N/A defer returnValue N/A user_id access_token refresh_token N/A N/A defer inlineCallbacks does_user_exist N/A N/A self user_id N/A N/A N/A N/A N/A N/A N/A N/A self _find_user_id_and_pwd_hash user_id N/A N/A N/A defer returnValue True N/A N/A N/A LoginError N/A N/A N/A N/A defer returnValue False N/A N/A defer inlineCallbacks _find_user_id_and_pwd_hash N/A N/A self user_id N/A N/A N/A Checks to see if a user with the given id exists. Will check case
        insensitively, but will throw if there are multiple inexact matches.

        Returns:
            tuple: A 2-tuple of `(canonical_user_id, password_hash)`
         N/A user_infos N/A N/A N/A N/A self store get_users_by_id_case_insensitive user_id N/A N/A user_infos N/A N/A N/A N/A logger warn Attempted to login as %s but they do not exist user_id N/A N/A LoginError 403 errcode N/A Codes FORBIDDEN N/A N/A N/A len user_infos 1 N/A N/A N/A user_id user_infos N/A N/A N/A N/A logger warn Attempted to login as %s but it matches more than one user inexactly: %r user_id N/A N/A user_infos keys N/A N/A LoginError 403 errcode N/A Codes FORBIDDEN N/A N/A N/A defer returnValue N/A user_id N/A user_infos N/A user_id N/A N/A N/A N/A defer returnValue N/A N/A user_infos popitem N/A N/A defer inlineCallbacks _check_password N/A N/A self user_id password stored_hash N/A N/A N/A Checks that user_id has passed password, raises LoginError if not. N/A N/A N/A N/A self validate_hash password stored_hash N/A N/A N/A N/A logger warn Failed password login for user %s user_id N/A N/A LoginError 403 errcode N/A Codes FORBIDDEN N/A issue_access_token N/A N/A self user_id N/A N/A N/A access_token N/A N/A self generate_access_token user_id N/A N/A N/A N/A N/A self store add_access_token_to_user user_id access_token N/A N/A N/A defer returnValue access_token N/A N/A defer inlineCallbacks issue_refresh_token N/A N/A self user_id N/A N/A N/A refresh_token N/A N/A self generate_refresh_token user_id N/A N/A N/A N/A N/A self store add_refresh_token_to_user user_id refresh_token N/A N/A N/A defer returnValue refresh_token N/A N/A defer inlineCallbacks generate_access_token N/A N/A self user_id extra_caveats N/A None N/A N/A extra_caveats N/A extra_caveats N/A N/A macaroon N/A N/A self _generate_base_macaroon user_id N/A N/A N/A macaroon add_first_party_caveat type = access N/A now N/A N/A N/A N/A N/A self hs get_clock time_msec N/A expiry N/A now N/A N/A 60 60 1000 N/A N/A N/A macaroon add_first_party_caveat N/A time < %d N/A expiry N/A caveat extra_caveats N/A N/A N/A N/A macaroon add_first_party_caveat caveat N/A N/A N/A macaroon serialize N/A generate_refresh_token N/A N/A self user_id N/A N/A N/A m N/A N/A self _generate_base_macaroon user_id N/A N/A N/A m add_first_party_caveat type = refresh N/A N/A N/A m add_first_party_caveat N/A nonce = %s N/A N/A N/A stringutils random_string_with_symbols 16 N/A N/A N/A m serialize N/A generate_short_term_login_token N/A N/A self user_id N/A N/A N/A macaroon N/A N/A self _generate_base_macaroon user_id N/A N/A N/A macaroon add_first_party_caveat type = login N/A now N/A N/A N/A N/A N/A self hs get_clock time_msec N/A expiry N/A now N/A N/A 2 60 1000 N/A N/A N/A macaroon add_first_party_caveat N/A time < %d N/A expiry N/A N/A N/A macaroon serialize N/A validate_short_term_login_token_and_get_user_id N/A N/A self login_token N/A N/A N/A N/A N/A macaroon N/A N/A N/A pymacaroons Macaroon deserialize login_token N/A auth_api N/A N/A N/A self hs get_auth N/A N/A N/A auth_api validate_macaroon macaroon login True N/A N/A N/A self get_user_from_macaroon macaroon N/A N/A N/A N/A N/A N/A pymacaroons exceptions MacaroonException TypeError ValueError N/A N/A N/A AuthError 401 Invalid token errcode N/A Codes UNKNOWN_TOKEN N/A _generate_base_macaroon N/A N/A self user_id N/A N/A N/A macaroon N/A N/A pymacaroons Macaroon location N/A N/A N/A self hs config server_name identifier key key N/A N/A N/A self hs config macaroon_secret_key N/A N/A N/A macaroon add_first_party_caveat gen = 1 N/A N/A N/A macaroon add_first_party_caveat N/A user_id = %s N/A user_id N/A macaroon N/A get_user_from_macaroon N/A N/A self macaroon N/A N/A N/A user_prefix user_id =  N/A caveat N/A macaroon caveats N/A N/A N/A N/A N/A caveat caveat_id startswith user_prefix N/A N/A N/A N/A caveat caveat_id N/A N/A len user_prefix N/A N/A AuthError N/A self INVALID_TOKEN_HTTP_STATUS No user_id found in token errcode N/A Codes UNKNOWN_TOKEN N/A set_password N/A N/A self user_id newpassword requester N/A None N/A N/A password_hash N/A N/A self hash newpassword N/A except_access_token_ids N/A requester N/A N/A requester access_token_id N/A N/A N/A N/A N/A N/A self store user_set_password_hash user_id password_hash N/A N/A N/A N/A N/A self store user_delete_access_tokens user_id except_access_token_ids N/A N/A N/A N/A N/A N/A N/A self hs get_pusherpool remove_pushers_by_user user_id except_access_token_ids N/A N/A defer inlineCallbacks add_threepid N/A N/A self user_id medium address validated_at N/A N/A N/A N/A N/A N/A N/A self store user_add_threepid user_id medium address validated_at N/A N/A N/A N/A N/A self hs get_clock time_msec N/A N/A defer inlineCallbacks _save_session N/A N/A self session N/A N/A N/A N/A N/A logger debug Saving session %s session N/A N/A session N/A last_used N/A N/A N/A N/A N/A self hs get_clock time_msec N/A N/A N/A self sessions N/A N/A session N/A id session N/A N/A N/A self _prune_sessions N/A _prune_sessions N/A N/A self N/A N/A N/A N/A sid sess N/A N/A N/A self sessions items N/A N/A last_used 0 N/A N/A last_used sess N/A N/A last_used N/A sess N/A last_used N/A now N/A N/A N/A N/A N/A self hs get_clock time_msec N/A N/A last_used N/A now N/A AuthHandler SESSION_EXPIRE_MS N/A N/A N/A N/A self sessions N/A sid N/A hash N/A N/A self password N/A N/A N/A Computes a secure hash of password.

        Args:
            password (str): Password to hash.

        Returns:
            Hashed password (str).
         N/A N/A N/A bcrypt hashpw password N/A N/A bcrypt gensalt N/A self bcrypt_rounds N/A validate_hash N/A N/A self password stored_hash N/A N/A N/A Validates that self.hash(password) == stored_hash.

        Args:
            password (str): Password to hash.
            stored_hash (str): Expected hash value.

        Returns:
            Whether self.hash(password) == stored_hash (bool).
         N/A N/A N/A N/A bcrypt hashpw password stored_hash stored_hash N/A N/A