module documentation

This module defines the web user interface for the ACME CSE.

Class ACMERequestHandler Own request handler to redirect some logging of the http server.
Class WebUI The web user interface for the ACME CSE.
Function getOAuthToken Retrieve and return a oauth2 token. If there is a provided token that is still valid, then that token is returned.
Function runServer Run the web server.
Type Alias FlaskHandler Type definition for flask handler.
Variable console The ACME console for logging.
Variable doLogging Whether to do logging.
Variable doOauth Whether to use OAuth2.
Variable Token Named tuple for a token.
Variable _expirationLeeway Leeway for token expiration.
def getOAuthToken(token: Token | None = None, kind: str | None = 'keycloak') -> Token | None:

Retrieve and return a oauth2 token. If there is a provided token that is still valid, then that token is returned.

This function returns a new named tuple Token(token, expiration), or None in case of an error. The expiration is in epoch seconds.

Parameters
token:Token | NoneThe token to check. If None, a new token is retrieved.
kind:str | NoneThe kind of token to retrieve. Currently only 'keycloak' is supported.
Returns
Token | NoneThe token, or None in case of an error.
def runServer(flaskApp: Flask, host: str, port: int, useTLS: bool, certFile: str | None = None, privateKey: str | None = None):

Run the web server.

Parameters
flaskApp:FlaskThe flask app to run.
host:strThe host to bind to.
port:intThe port to bind to.
useTLS:boolWhether to use TLS.
certFile:str | NoneThe certificate file.
privateKey:str | NoneThe private key file.
FlaskHandler =

Type definition for flask handler.

Value
Callable[[str], Response]
console: Console =

The ACME console for logging.

doLogging: bool =

Whether to do logging.

doOauth: bool =

Whether to use OAuth2.

Token =

Named tuple for a token.

_expirationLeeway: float =

Leeway for token expiration.