SlyAPI.auth#

Classes

Auth()

Implement for any authentication scheme.

HeaderApiKey(param_name, secret)

Header with a secret to authorize requests.

NoAuth()

Does nothing.

UrlApiKey(param_name, secret)

URL parameter with a secret to authorize requests.

class SlyAPI.auth.Auth[source]#

Bases: ABC

Implement for any authentication scheme.

abstractmethod await sign(client, request)[source]#
Parameters:
  • client (ClientSession) –

  • request (Request) –

Return type:

Request

staticmethod none()[source]#
Return type:

NoAuth

class SlyAPI.auth.UrlApiKey(param_name, secret)[source]#

Bases: Auth

URL parameter with a secret to authorize requests.

Parameters:
  • param_name (str) –

  • secret (str) –

params: dict[str, str]#
await sign(client, request)[source]#
Parameters:
  • client (ClientSession) –

  • request (Request) –

Return type:

Request

class SlyAPI.auth.HeaderApiKey(param_name, secret)[source]#

Bases: Auth

Header with a secret to authorize requests.

Parameters:
  • param_name (str) –

  • secret (str) –

headers: dict[str, str]#
await sign(client, request)[source]#
Parameters:
  • client (ClientSession) –

  • request (Request) –

Return type:

Request

class SlyAPI.auth.NoAuth[source]#

Bases: Auth

Does nothing.

await sign(client, request)[source]#
Parameters:
  • client (ClientSession) –

  • request (Request) –

Return type:

Request