ExFattureincloud.OAuth.Token (ExFattureincloud v0.1.0)

Copy Markdown View Source

OAuth credentials. Inspection hides access/refresh tokens. Times are Unix seconds.

Summary

Types

t()

OAuth credentials. expires_at is a Unix timestamp and expires_in is a lifetime, both in seconds. Restored tokens can omit expires_in and token_type.

Functions

True if the token expires within the given safety margin (default 60 seconds).

Types

t()

@type t() :: %ExFattureincloud.OAuth.Token{
  access_token: String.t(),
  expires_at: integer(),
  expires_in: pos_integer() | nil,
  refresh_token: String.t() | nil,
  token_type: String.t() | nil
}

OAuth credentials. expires_at is a Unix timestamp and expires_in is a lifetime, both in seconds. Restored tokens can omit expires_in and token_type.

Functions

expired?(token, margin \\ 60)

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

True if the token expires within the given safety margin (default 60 seconds).