Tecton Base Request Handler

class q2_sdk.core.http_handlers.tecton_base_handler.Q2TectonBaseRequestHandler(application, request, **kwargs)[source]

Bases: Q2OnlineRequestHandler

RequestHandler meant to be used for all Tecton related requests

async prepare()[source]

Fires before any request handling code

By default, will check any Rate Limiter instances in self.rate_limiters and disallow further processing if any are over their specified limit

async q2_post(*args, **kwargs)[source]

Overridable method. Should be defined in the extension inheriting this class. Called from the housekeeping Q2 specific POST method after the incoming message is parsed and broken into objects

validate_mfa_token()[source]

Checks if the MFA key is within cache

consume_mfa_token()[source]

Deletes the cached MFA validation token, forcing re-validation on the next request.

async mfa_exit()[source]

Re-dispatches to the extension route that initiated an MFA prompt after the user cancelled the flow or was locked out.

UUX POSTs to this route on promptForMFA rejection, supplying the originating routing_key as mfa_exit_routing_key and an mfa_exit_type of LOCKED_OUT or EXITED. The corresponding q2_mfa_* form field is set on the request so the decorator on the target method sees the exit condition and invokes its error_handler.

async set_external_mfa_token(token)[source]

Sets an external MFA token with HQ and accounts for possible pre-auth token

Return type:

Union[Success, InternalServerError, NotFound]