10.2.1. Abstract Base Class for all Authentication Methods

class pytan3.auth_methods.AuthMethod[source]

Bases: object

Abstract base class for all AuthMethods.

classmethod get_name()[source]

Get the ref name of this class for use by load().

Returns:str
classmethod get_version_req()[source]

Get the min, max, and eq version requirements of this class.

Notes

Dict can specify keys: “vmin”, “vmax”, “veq”.

This class method gets called by pytan3.utils.versions.version_check_obj_req() to perform version checks.

Returns:dict
classmethod get_args()[source]

Get all arguments used by this class.

Returns:list
classmethod get_args_required()[source]

Get all arguments used by this class that are required.

Returns:list
classmethod get_args_secure()[source]

Get all arguments used by this class that need their prompt input hidden.

Returns:list
classmethod from_store(store, **kwargs)[source]

Create an instance of this class from an pytan3.auth_store.AuthStore.

Parameters:store (pytan3.auth_store.AuthStore) – AuthStore to get AuthMethod arguments from.
Returns:AuthMethod
http_client

Get the HTTP Client for this object.

Returns:pytan3.http_client.HttpClient
token

Get or set a token.

Notes

If no token received, login() to get one.

If token expired, login() to get a new one.

If token has been received, validate() to validate token.

If token fails validation, login() to get a new one.

Returns:str
token_headers

Get dict with token for use in headers.

Returns:dict
uid

Get user ID for token if a token has been received.

Returns:str
logged_in

Check if a token has been received.

Returns:bool
login(**kwargs)[source]

Send a login request to receive a token.

Raises:exceptions.LoginError – If status code in response is not 200.
Returns:str
logout(**kwargs)[source]

Send a logout request to revoke a token.

Raises:
Returns:

None

logout_all(**kwargs)[source]

Send a logout request to revoke all tokens associated with this token.

Raises:
Returns:

None

validate(**kwargs)[source]

Send a validate request to check that token is still valid.

Raises:
Returns:

str

create_store(**kwargs)[source]

Create an instance of pytan3.auth_store.AuthStore from this object.

Returns:pytan3.auth_store.AuthStore
_abc_impl = <_abc_data object>