quartzbio.auth module

class quartzbio.auth.QuartzBioTokenAuth(token=None, token_type='Bearer')

Bases: AuthBase

Custom auth handler for QuartzBio API token authentication

quartzbio.auth.authenticate(host: str, token: str, token_type: Literal['Bearer', 'Token'], *, raise_on_missing: bool = True, debug: bool = False) Tuple[str, QuartzBioTokenAuth]

Sets login credentials for QuartzBio API authentication.

Parameters:
  • host (str) – API host url

  • token (str) – API access token or API key

  • token_type (str) – API token type. Bearer is used for access tokens, while Token is used for API Keys.

  • raise_on_missing (bool) – Raise an exception if no credentials are available.

quartzbio.auth.validate_api_host_url(url)

Validate QuartzBio API host url.

Valid urls must not be empty and must contain either HTTP or HTTPS scheme.