tiled.client.context.Context
- class tiled.client.context.Context(uri, *, headers=None, api_key=None, cache=<UNSET>, timeout=None, verify=True, app=None, raise_server_exceptions=True)[source]
Wrap an httpx.Client with an optional cache and authentication functionality.
- __init__(uri, *, headers=None, api_key=None, cache=<UNSET>, timeout=None, verify=True, app=None, raise_server_exceptions=True)[source]
Methods
__init__(uri, *[, headers, api_key, cache, ...])authenticate(*[, remember_me])Log in to a Tiled server.
close()configure_auth(tokens[, remember_me])Configure Tiled client with tokens for refresh flow.
create_api_key([scopes, expires_in, note, ...])Generate a new API key.
Execute refresh flow.
from_any_uri(uri, *[, headers, api_key, ...])Accept a URI to a specific node.
from_app(app, *[, cache, headers, timeout, ...])Construct a Context around a FastAPI app.
login(*[, remember_me])Log in to a Tiled server.
logout()Log out of the current session (if any).
revoke_api_key(first_eight)Revoke an API key.
revoke_session(session_id)Revoke a Session so it cannot be refreshed.
use_cached_tokens()Attempt to reconnect using cached tokens.
which_api_key()A 'who am I' for API keys
whoami()Return information about the currently-authenticated user or service.
Attributes
api_keyappauthenticatedBoolean indicated whether session is authenticated (true) or anonymous (false)
base_urlevent_hookshttpx.Client event hooks.
A view of the current access and refresh tokens.