class documentation

class OAuthCallbackHttpServer(HTTPServer):

Constructor: OAuthCallbackHttpServer(port)

View In Hierarchy

Simplistic HTTP Server to provide local callback URL for oauth2 provider

Method __init__ Undocumented
Method get_code This method should only be called after the request was done and might be None when no token is given.
Method wait_for_code Wait for the server to open the callback page containing the code query parameter.
Property callback_url Callback URL for the HTTP-Server
Instance Variable _code Undocumented
def __init__(self, port):

Undocumented

def get_code(self) -> str|None:

This method should only be called after the request was done and might be None when no token is given.

Returns
str|NoneAuthorization code or None if the request was not performed yet
def wait_for_code(self, attempts: int = 3, timeout_per_attempt=10) -> Optional[str]:

Wait for the server to open the callback page containing the code query parameter.

It tries for #attempts with a timeout of #timeout_per_attempts for each attempt. This prevents the CLI from getting stuck by unsolved callback URls

Parameters
attempts:intAmount of attempts
timeout_per_attemptTimeout for each attempt to be successful
Returns
Optional[str]Code from callback page or None if the callback page is not called successfully
@property
callback_url: str =

Callback URL for the HTTP-Server

_code: str|None =

Undocumented