Holds Yahoo Finance auth state (cookie + CSRF crumb) for the running app.
Yahoo's public API gates calls behind a per-session cookie and a crumb token that must be present on every request. This GenServer owns both, refreshes them when needed, and exposes a lookup function callers use before each HTTP call.
Two strategies for obtaining a valid (cookie, crumb) pair are tried in
order before giving up. Both rely on Req and are stubbable in tests
via Req.Test.
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns {:ok, %Credentials{}} with a fresh-enough session, refreshing
if the cached credentials are missing or expired.
Marks the session as invalid so the next credentials/0 call re-authenticates.
Called after a 401 or auth-error response.
Starts the session GenServer. Started under the package's supervisor at app boot; not typically called directly.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec credentials(GenServer.server()) :: {:ok, YahooFinanceEx.Session.Credentials.t()} | {:error, term()}
Returns {:ok, %Credentials{}} with a fresh-enough session, refreshing
if the cached credentials are missing or expired.
Marks the session as invalid so the next credentials/0 call re-authenticates.
Called after a 401 or auth-error response.
Starts the session GenServer. Started under the package's supervisor at app boot; not typically called directly.