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

NameTypeDescription
idstrThe account's profile reference, such as Patient/123.
profileOvokReferenceThe account's profile.
projectOvokReferenceThe project the account signed in to.
activeboolWhether it is the account signed in now.
expiredboolWhether 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

NameTypeDescription
sessionSessionThe account's last session; its tokens are empty once it expired.
expiredboolWhether the session ended.

account_id

account_id: str

The account's profile reference.

SavedAccountsStore

SavedAccountsStore(storage: OvokStorage, key: str)

Keeps saved accounts as JSON in the TypeScript SDK's shape, newest first.

Parameters

NameTypeDefaultDescription
storageOvokStorageWhere the accounts are kept.
keystrStorage key of the accounts.

for_tenant()

for_tenant(storage: OvokStorage, tenant_code: str) -> SavedAccountsStore

One 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 | None

Return the saved account account_id, or None.

save()

save(session: Session) -> None

Save session as a live account, replacing the same account or adding it first.

mark_expired()

mark_expired(account_id: str) -> None

Forget the tokens of account_id and mark it expired.

remove()

remove(account_id: str) -> None

Forget account_id.

Last updated on

On this page