4.7.2.1. Authenticating

Authentication via API key and API secret.

class axonius_api_client.auth.api_key.ApiKey(http, key, secret, **kwargs)[source]

Bases: Mixins

Authentication method using API key & API secret.

Parameters
__init__(http, key, secret, **kwargs)[source]

Authenticate using API key & API secret.

Parameters
  • http (axonius_api_client.http.Http) – HTTP client to use to send requests

  • key (str) – API key to use in credentials

  • secret (str) – API secret to use in credentials

login()[source]

Login to API.

logout()[source]

Logout from API.

_logout()[source]

Logout from API.

__repr__()

Show object info.

Return type

str

__str__()

Show object info.

Return type

str

_check_http_lock()

Check HTTP client not already used by another Auth.

Raises

AuthError – When the HTTP client supplied is already being used by another Auth method.

_get_api_keys(**http_args)

Direct API method to get the API keys for the current user.

Return type

dict

_set_http_lock()

Set HTTP Client auth lock.

_validate()

Validate credentials.

check_login()

Check if login has been called.

Raises

NotLoggedIn – When login has not been called before trying to make a call with this Auth model.

property endpoints: ApiEndpoints(groups=['instances', 'central_core', 'system_settings', 'remote_support', 'system_users', 'system_roles', 'lifecycle', 'adapters', 'signup', 'password_reset', 'audit_logs', 'enforcements', 'saved_queries', 'assets', 'openapi', 'data_scopes', 'dashboard_spaces', 'folders_queries', 'folders_enforcements', 'account'])

Get the endpoint group for this module.

get_api_keys()

Get the API key and secret for the current user.

Return type

dict

property http: Http

Get HttpClient object.

property is_logged_in: bool

Check if login has been called.

LOG: logging.Logger

Logger for this object.