API referenceovok_sdk.auth
ovok_sdk.auth.saved_accounts_store
The accounts a user has signed in to on this client, kept in `OvokStorage`.
- Stable unknown
- Release candidate not available
- Development since 0.2.0-dev.34+53a6a64
The accounts a user has signed in to on this client, kept in OvokStorage.
SavedAccount
SavedAccount(
id: str,
profile: OvokReference,
project: OvokReference,
active: bool,
expired: bool,
)An account signed in to on this client, without its tokens.
Attributes
| Name | Type | Description |
|---|---|---|
id | str | The account's profile reference, such as Patient/123. |
profile | OvokReference | The account's profile. |
project | OvokReference | The project the account signed in to. |
active | bool | Whether it is the account signed in now. |
expired | bool | Whether its session ended; signing in again renews it. |
StoredSavedAccount
StoredSavedAccount(session: Session, expired: bool)A saved account's session and whether it has expired.
Attributes
| Name | Type | Description |
|---|---|---|
session | Session | The account's last session; its tokens are empty once it expired. |
expired | bool | Whether the session ended. |
account_id
account_id: strThe account's profile reference.
SavedAccountsStore
SavedAccountsStore(storage: OvokStorage, key: str)Keeps saved accounts as JSON in the TypeScript SDK's shape, newest first.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
storage | OvokStorage | Where the accounts are kept. | |
key | str | Storage key of the accounts. |
for_tenant()
for_tenant(storage: OvokStorage, tenant_code: str) -> SavedAccountsStoreOne key per tenant, next to the tenant's session.
list()
list(active_account_id: str | None) -> list[SavedAccount]List the saved accounts, marking active_account_id active.
get()
get(account_id: str) -> StoredSavedAccount | NoneReturn the saved account account_id, or None.
save()
save(session: Session) -> NoneSave session as a live account, replacing the same account or adding it first.
mark_expired()
mark_expired(account_id: str) -> NoneForget the tokens of account_id and mark it expired.
remove()
remove(account_id: str) -> NoneForget account_id.
Last updated on