pytan3.auth_methods.
AuthMethod
[source]¶Bases: object
Abstract base class for all AuthMethods.
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 |
---|
get_args_required
()[source]¶Get all arguments used by this class that are required.
Returns: | list |
---|
get_args_secure
()[source]¶Get all arguments used by this class that need their prompt input hidden.
Returns: | list |
---|
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 |
---|
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: |
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>¶