Skip to content

Auth#

BasicAuth #

A custom basic authentication class for requests, that takes into account the organisation header

__init__(self, username, password, organisation=None) special #

Constructor

Parameters:

Name Type Description Default
username str

The username to use for the authentication.

required
password str

The password to use for the authentication.

required
organisation str

The organisation to use.

None
Source code in thehive4py/auth.py
12
13
14
15
16
17
18
19
20
21
22
23
def __init__(self, username, password, organisation=None):
    """
    Constructor

    Arguments:
        username (str): The username to use for the authentication.
        password (str): The password to use for the authentication.
        organisation (str): The organisation to use.
    """
    self.username = username
    self.password = password
    self.organisation = organisation

BearerAuth #

A custom authentication class for requests, relying on API key (Bearer authorization header), and taking into account the organisation header

__init__(self, api_key, organisation=None) special #

Constructor

Parameters:

Name Type Description Default
api_key str

The API Key to use for the authentication

required
organisation str

The organisation to use.

None
Source code in thehive4py/auth.py
39
40
41
42
43
44
45
46
47
48
def __init__(self, api_key, organisation=None):
    """
    Constructor

    Arguments:
        api_key (str): The API Key to use for the authentication
        organisation (str): The organisation to use.
    """  
self.api_key = api_key self.organisation = organisation

Last update: May 29, 2020 15:27:12