View Source Lightning.Credentials.OauthClient (Lightning v2.10.4)

Defines the Ecto schema for an OAuth client. This schema is responsible for representing OAuth client data in the database, including details such as client ID, client secret, and endpoints necessary for OAuth operations. It also links to associated users and projects through relational fields.

Summary

Functions

Builds a changeset for an OAuth client based on the provided attributes.

Types

@type t() :: %Lightning.Credentials.OauthClient{
  __meta__: Ecto.Schema.Metadata.t(),
  authorization_endpoint: term(),
  client_id: term(),
  client_secret: term(),
  credentials: term(),
  global: term(),
  id: Ecto.UUID.t() | nil,
  inserted_at: term(),
  introspection_endpoint: term(),
  mandatory_scopes: term(),
  name: String.t(),
  optional_scopes: term(),
  project_oauth_clients: term(),
  projects: term(),
  revocation_endpoint: term(),
  scopes_doc_url: term(),
  token_endpoint: term(),
  updated_at: term(),
  user: term(),
  user_id: term(),
  userinfo_endpoint: term()
}

Functions

Link to this function

changeset(oauth_client, attrs)

View Source

Builds a changeset for an OAuth client based on the provided attributes.

Parameters

  • oauth_client: The existing %OauthClient{} struct (or a new struct for creation).
  • attrs: A map of attributes to set on the OAuth client.

Returns

  • An %Ecto.Changeset{} that can be used to create or update an OAuth client.

This function validates the presence of essential fields, ensures that URLs are valid, and handles associations with projects through nested changesets.