tiled.client.context.Context¶
- class tiled.client.context.Context(client, *, username=None, auth_provider=None, api_key=None, cache=None, offline=False, token_cache='/home/runner/.config/tiled/tokens', prompt_for_reauthentication=PromptForReauthentication.AT_INIT, app=None)[source]¶
Wrap an httpx.Client with an optional cache and authentication functionality.
- __init__(client, *, username=None, auth_provider=None, api_key=None, cache=None, offline=False, token_cache='/home/runner/.config/tiled/tokens', prompt_for_reauthentication=PromptForReauthentication.AT_INIT, app=None)[source]¶
Methods
__init__
(client, *[, username, ...])authenticate
([provider])Authenticate.
create_api_key
([scopes, expires_in, note])Generate a new API for the currently-authenticated user.
delete_content
(path, content[, headers])disable_cache
([allow_read, allow_write])get_content
(path[, accept, stream, revalidate])get_json
(path[, stream])logout
()Clear the access token and the cached refresh token.
post_json
(path, content)put_content
(path, content[, headers])reauthenticate
([prompt])Refresh authentication.
revalidation
(revalidate)Temporarily change the 'revalidate' property in a context.
revoke_api_key
(first_eight)revoke_session
(session_id)Revoke a Session so it cannot be refreshed.
which_api_key
()A 'who am I' for API keys
whoami
()Return information about the currently-authenticated user or service.
Attributes
api_key
app
cache
event_hooks
httpx.Client event hooks.
revalidate
This controls how aggressively to check whether cache entries are out of date.
A view of the current access and refresh tokens.