Lightning.Credentials.CredentialBody (Lightning v2.15.16)

View Source

Per-environment credential body storage.

Each credential can have multiple environment variants (e.g., "main", "staging", "prod") with different configuration values.

Summary

Functions

Validates that a credential body does not exceed the maximum allowed sensitive values.

Types

t()

@type t() :: %Lightning.Credentials.CredentialBody{
  __meta__: Ecto.Schema.Metadata.t(),
  body: map() | nil,
  credential:
    Lightning.Credentials.Credential.t() | Ecto.Association.NotLoaded.t(),
  credential_id: Ecto.UUID.t(),
  id: Ecto.UUID.t() | nil,
  inserted_at: DateTime.t() | nil,
  name: String.t(),
  updated_at: DateTime.t() | nil
}

Functions

changeset(credential_body, attrs)

validate_sensitive_values_count(body)

Validates that a credential body does not exceed the maximum allowed sensitive values.

Returns :ok if valid, or {:error, message} if the body contains too many sensitive values.

Examples

iex> validate_sensitive_values_count(%{"password" => "secret"})
:ok

iex> validate_sensitive_values_count(body_with_many_secrets)
{:error, "contains too many sensitive keys (250). Max allowed is 50"}