Auth¶
Runnable example
python/examples/auth_status.py — read the current Resonite cloud auth state (signed-in user / session expiry), read-only.
resoio.auth.AuthClient ¶
Bases: _BaseClient[AuthStub]
Async client for the Resonite IO Auth service over a UDS.
Use as an async context manager so the gRPC channel closes deterministically.
The password passed to :meth:login is a plaintext secret and is never
logged. remember_me=True asks the engine to persist the session; this
client itself stores nothing on disk.
Source code in src/resoio/_client.py
login
async
¶
login(
credential: str, password: str, *, totp: str | None = None, remember_me: bool = True
) -> AuthStatus
Sign in to Resonite cloud and return the resulting status.
credential is a username, email, or user ID (U-xxx);
password is the plaintext secret (never logged). Pass totp for
2FA-enabled accounts; omitting it on such an account makes the server
return gRPC FailedPrecondition. Bad credentials return
Unauthenticated. remember_me=True delegates session
persistence to the engine.
Source code in src/resoio/auth.py
logout
async
¶
Log out of the current session; returns the updated status.
Idempotent: returns logged_in=False even if no session was active.
Source code in src/resoio/auth.py
status
async
¶
Return the current authentication status without modifying it.
resoio.auth.AuthStatus
dataclass
¶
Snapshot of the Resonite cloud authentication state.
user_id / user_name are empty and session_expires_unix_nanos
is 0 when not logged in.
session_expires
property
¶
Session expiry as a timezone-aware UTC :class:~datetime.datetime.
None when not logged in or the expiry is unknown
(session_expires_unix_nanos is 0). Resolution is microseconds;
use session_expires_unix_nanos for the exact nanosecond value.