argo.configuration

Argo

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501

The version of the OpenAPI document: v2.5.2 Generated by: https://openapi-generator.tech

Module Contents

class argo.configuration.Configuration(host='http://localhost', api_key=None, api_key_prefix=None, username=None, password=None, signing_info=None)

Bases: object

NOTE: This class is auto generated by OpenAPI Generator

Ref: https://openapi-generator.tech Do not edit the class manually.

Parameters
  • host – Base url

  • api_key – Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. The dict value is the API key secret.

  • api_key_prefix – Dict to store API prefix (e.g. Bearer) The dict key is the name of the security scheme in the OAS specification. The dict value is an API key prefix when generating the auth data.

  • username – Username for HTTP basic authentication

  • password – Password for HTTP basic authentication

  • signing_info – Configuration parameters for HTTP signature. Must be an instance of argo.signing.HttpSigningConfiguration

Example

Given the following security scheme in the OpenAPI specification:
components:
securitySchemes:
cookieAuth: # name for the security scheme

type: apiKey in: cookie name: JSESSIONID # cookie name

You can programmatically set the cookie:
conf = argo.Configuration(

api_key={‘cookieAuth’: ‘abc123’} api_key_prefix={‘cookieAuth’: ‘JSESSIONID’}

)

The following cookie will be added to the HTTP request:

Cookie: JSESSIONID abc123

Configure API client with HTTP basic authentication:
conf = argo.Configuration(

username=’the-user’, password=’the-password’,

)

Configure API client with HTTP signature authentication. Use the ‘hs2019’ signature scheme, sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time of the signature to 5 minutes after the signature has been created. Note you can use the constants defined in the argo.signing module, and you can also specify arbitrary HTTP headers to be included in the HTTP signature, except for the ‘Authorization’ header, which is used to carry the signature.

One may be tempted to sign all headers by default, but in practice it rarely works. This is beccause explicit proxies, transparent proxies, TLS termination endpoints or load balancers may add/modify/remove headers. Include the HTTP headers that you know are not going to be modified in transit.

conf = argo.Configuration(
signing_info = argo.signing.HttpSigningConfiguration(

key_id = ‘my-key-id’, private_key_path = ‘rsa.pem’, signing_scheme = signing.SCHEME_HS2019, signing_algorithm = signing.ALGORITHM_RSASSA_PSS, signed_headers = [signing.HEADER_REQUEST_TARGET,

signing.HEADER_CREATED, signing.HEADER_EXPIRES, signing.HEADER_HOST, signing.HEADER_DATE, signing.HEADER_DIGEST, ‘Content-Type’, ‘Content-Length’, ‘User-Agent’

],

signature_max_validity = datetime.timedelta(minutes=5)

)

)

Constructor

host

Default Base url

temp_folder_path

Temp file folder for downloading files

refresh_api_key_hook

function hook to refresh API key if expired

username

Username for HTTP basic authentication

password

Password for HTTP basic authentication

signing_info

The HTTP signing configuration

logger

Logging Settings

logger_format = %(asctime)s %(levelname)s %(message)s

Log format

logger_stream_handler

Log stream handler

logger_file_handler

Log file handler

logger_file

Debug file location

debug = False

Debug switch

verify_ssl = True

SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server.

ssl_ca_cert

Set this to customize the certificate file to verify the peer.

cert_file

client certificate file

key_file

client key file

assert_hostname

Set this to True/False to enable/disable SSL hostname verification.

connection_pool_maxsize

urllib3 connection pool’s maximum number of connections saved per pool. urllib3 uses 1 connection as default value, but this is not the best value when you are making a lot of possibly parallel requests to the same host, which is often the case here. cpu_count * 5 is used as default value to increase performance.

proxy

Proxy URL

proxy_headers

Proxy headers

safe_chars_for_path_param =

Safe chars for path_param

retries

Adding retries to override urllib3 default value 3

property logger_file(self)

The logger file.

If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler.

Parameters

value – The logger_file path.

Type

str

property debug(self)

Debug status

Parameters

value – The debug status, True or False.

Type

bool

property logger_format(self)

The logger format.

The logger_formatter will be updated when sets logger_format.

Parameters

value – The format string.

Type

str

get_api_key_with_prefix(self, identifier)

Gets API key (with prefix if set).

Parameters

identifier – The identifier of apiKey.

Returns

The token for api key authentication.

get_basic_auth_token(self)

Gets HTTP basic authentication header (string).

Returns

The token for basic HTTP authentication.

auth_settings(self)

Gets Auth Settings dict for api client.

Returns

The Auth Settings information dict.

to_debug_report(self)

Gets the essential information for debugging.

Returns

The report for debugging.

get_host_settings(self)

Gets an array of host settings

Returns

An array of host settings

get_host_from_settings(self, index, variables=None)

Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value :return: URL based on host settings