ovok_sdk.config

Client options, checked once when the client is constructed.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

Client options, checked once when the client is constructed.

MachineClient

MachineClient(client_id: str, client_secret: str)

A machine client's OAuth credentials.

Attributes

NameTypeDescription
client_idstrThe client's ID.
client_secretstrThe client's secret; never shown in repr.

UnauthenticatedReason

UnauthenticatedReason(status: int, type: str = REFRESH_REJECTED)

Why the user was signed out; passed to the on_unauthenticated callback.

Attributes

NameTypeDescription
statusintHTTP status of the refused token refresh.
typestrKind of sign-out; always "refresh-rejected" today.

OvokSettings

OvokSettings(
    base_url: str,
    tenant_code: str,
    fhir_path: str,
    storage: OvokStorage,
    transport: Transport,
    timeout: float,
    max_network_retries: int,
    client_id: str | None,
    machine_client: MachineClient | None,
    on_unauthenticated: OnUnauthenticated,
)

The client's checked options; see Ovok for what each one means.

Attributes

NameTypeDescription
base_urlstrAPI base URL, ending in /.
tenant_codestrTenant every request is scoped to.
fhir_pathstrPath of the FHIR API under base_url, without slashes at either end.
storageOvokStorageWhere the session is kept.
transportTransportSends the HTTP requests.
timeoutfloatRequest timeout in seconds.
max_network_retriesintRetries for safe requests that fail on the network.
client_idstr | NoneApp client ID, if one was given.
machine_clientMachineClient | NoneMachine credentials, when a client secret was given.
on_unauthenticatedOnUnauthenticatedCalled when the user is signed out.

read_settings()

read_settings(
    base_url: str,
    tenant_code: str,
    *,
    fhir_path: str = DEFAULT_FHIR_PATH,
    storage: OvokStorage | None = None,
    client_id: str | None = None,
    client_secret: str | None = None,
    transport: Transport | None = None,
    timeout: float = DEFAULT_TIMEOUT_SECONDS,
    max_network_retries: int = DEFAULT_MAX_NETWORK_RETRIES,
    on_unauthenticated: OnUnauthenticated | None = None,
) -> OvokSettings

Checks every option up front, so a bad one fails at construction, not on the first request.

Takes the same arguments as Ovok.

Returns

  • OvokSettings: The checked settings, with defaults filled in.

Raises

  • OvokConfigError: An option is missing or invalid.

Last updated on

On this page