WeaviateEx.Auth.OIDC.TokenResponse (WeaviateEx v0.7.4)

View Source

OIDC token response from token endpoint.

Summary

Functions

Check if the token is expired.

Calculate the expiration timestamp from issued_at and expires_in.

Check if the token will expire within the given buffer time (in seconds). Default buffer is 60 seconds.

Types

t()

@type t() :: %WeaviateEx.Auth.OIDC.TokenResponse{
  access_token: String.t() | nil,
  expires_in: non_neg_integer() | nil,
  id_token: String.t() | nil,
  issued_at: DateTime.t() | nil,
  refresh_token: String.t() | nil,
  scope: String.t() | nil,
  token_type: String.t() | nil
}

Functions

expired?(token)

@spec expired?(t()) :: boolean()

Check if the token is expired.

expires_at(token_response)

@spec expires_at(t()) :: DateTime.t() | nil

Calculate the expiration timestamp from issued_at and expires_in.

expiring_soon?(token, buffer_seconds \\ 60)

@spec expiring_soon?(t(), non_neg_integer()) :: boolean()

Check if the token will expire within the given buffer time (in seconds). Default buffer is 60 seconds.