MythicAuth
- class hostedpi.auth.MythicAuth(*, settings: Settings | None = None, auth_session: Session | None = None, api_session: Session | None = None)[source]
This class handles authentication with the Mythic Beasts Hosted Pi API.
It manages the access token used to authenticate requests to the API, and automatically refreshes it when it expires.
- Parameters:
settings (
Settingsor None) – The settings used to configure the API. If not provided, defaults to a new instance ofSettings.auth_session (
requests.Sessionor None) – The session used to make authentication requests. If not provided, defaults to a newrequests.Session.api_session (
requests.Sessionor None) – The session used to make API requests. If not provided, defaults to a newrequests.Session.
Warning
This is for advanced use only. Most users should not need to interact with the authentication system directly, as it is handled automatically by
PiCloud.- Raises:
pydantic_core.ValidationError – If the provided settings are invalid or missing required fields.