Session Module

sessions.tc_session

ThreatConnect Requests Session

class tcex.sessions.tc_session.HmacAuth(access_id, secret_key)[source]

Bases: requests.auth.AuthBase

ThreatConnect HMAC Authorization

__call__(r)[source]

Override of parent __call__ method.

class tcex.sessions.tc_session.TcSession(tcex)[source]

Bases: requests.sessions.Session

ThreatConnect REST API Requests Session

_configure_auth()[source]

Return Auth property for session.

request(method, url, **kwargs)[source]

Override request method disabling verify on token renewal if disabled on session.

retry(retries=3, backoff_factor=0.3, status_forcelist=(500, 502, 504))[source]

Add retry to Requests Session

https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.retry.Retry

class tcex.sessions.tc_session.TokenAuth(token)[source]

Bases: requests.auth.AuthBase

ThreatConnect Token Authorization

__call__(r)[source]

Override of parent __call__ method.