ApiKeyManager

class cloudpassage.ApiKeyManager(**kwargs)

Retrieves API keys from file or environment.

If instantiated with no arguments, it will return credentials from environment variables. If there are no credentials set in environment variables, it will look to /etc/cloudpassage.yaml.

If there is no api_hostname specified in the selected configuration source, it defaults to api.cloudpassage.com.

Environment variables::

HALO_API_KEY

HALO_API_SECRET_KEY

HALO_API_HOSTNAME

HALO_API_PORT

Yaml file structure::

defaults:

key_id:

secret_key:

api_hostname:

api_port:

Keyword Arguments:
 
  • config_file (str) – full path to yaml config file
  • use_config (boolean) – set True is hoping to use config_file
api_hostname

Hostname of api endpoint. Defaults to api.cloudpassage.com

api_port

API port. Defaults to 443

key_id

API key ID

secret_key

API key secret

classmethod env_vars_are_set(env_vars)

Determine if environment vars are correctly set

get_config_from_env()

Return config information from environment vars

get_config_from_file(config_file)

Return config from file

set_config_variables(config_variables)

Set configuration vars for object