SlyAPI.oauth1#

Implemenation of OAuth1.0a as the Auth interface https://datatracker.ietf.org/doc/html/rfc5849

Functions

command_line_oauth1(app, redirect_host, ...)

paramString(params)

percentEncode(s)

Classes

OAuth1(app, user)

Provides the Auth interface implementation for OAuth1

OAuth1App(key, secret, request_uri, ...)

OAuth1User(key, secret)

SlyAPI.oauth1.percentEncode(s)[source]#
Parameters:

s (str) –

SlyAPI.oauth1.paramString(params)[source]#
Parameters:

params (dict[str, Any]) –

Return type:

str

class SlyAPI.oauth1.OAuth1User(key: str, secret: str)[source]#

Bases: object

Parameters:
  • key (str) –

  • secret (str) –

key: str#
secret: str#
classmethod from_json_obj(obj)[source]#

Read an app from a JSON object

Parameters:

obj (dict[str, str]) –

Return type:

OAuth1User

classmethod from_json_file(path)[source]#

Read an app from a JSON file path

Parameters:

path (str) –

Return type:

OAuth1User

class SlyAPI.oauth1.OAuth1App(key: str, secret: str, request_uri: str, authorize_uri: str, access_uri: str)[source]#

Bases: object

Parameters:
  • key (str) –

  • secret (str) –

  • request_uri (str) –

  • authorize_uri (str) –

  • access_uri (str) –

key: str#
secret: str#
request_uri: str#
authorize_uri: str#
access_uri: str#
classmethod from_json_obj(obj)[source]#

Read an app from a JSON object

Parameters:

obj (dict[str, str]) –

Return type:

OAuth1App

classmethod from_json_file(path)[source]#

Read an app from a JSON file path

Parameters:

path (str) –

Return type:

OAuth1App

sign(request, user=None)[source]#
Parameters:
Return type:

Request

class SlyAPI.oauth1.OAuth1(app, user)[source]#

Bases: Auth

Provides the Auth interface implementation for OAuth1

Load an OAuth1 app and user from JSON files or existing objects.

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

  • request (Request) –

Return type:

Request

await SlyAPI.oauth1.command_line_oauth1(app, redirect_host, redirect_port, usePin)[source]#
Parameters:
Return type:

OAuth1User