Thalweg · API reference ← Main docs

Module auth

Module auth 

Source
Expand description

OAuth2 client-credentials authentication against Unity Catalog, with expiry-aware token caching.

The clock is injected (Clock) so the cache is deterministically testable; SystemClock is the production implementation. A cached token is reused until it is within Authenticator’s refresh skew of expiry.

Structs§

Authenticator
Acquires and caches an OAuth2 client-credentials bearer token for Unity Catalog. Cheap to share; the token cache is internally synchronised.
SystemClock
Production Clock reading the system wall clock.

Enums§

AuthError
Authentication failure while acquiring a token.

Traits§

Clock
A monotonic wall-clock source in UTC epoch seconds. Injected so token-cache expiry is testable without sleeping.