Ankusa.SDK.Sources.Source (ankusa_sdk v0.6.0)

Copy Markdown View Source

A stored source as the admin API reports it: identity fields plus the redacted spec.

Every value here is redacted (secret, password, token, HTTP header values, URL userinfo passwords, ...), so a Source read back through Ankusa.SDK.Sources.get_source/3 is never useful for editing: resending its verify map is not the same as resending the stored secret. Callers that hold the secret supply it through Ankusa.SDK.Sources.Spec.

Summary

Functions

Build a source from a decoded API object.

Types

t()

@type t() :: %Ankusa.SDK.Sources.Source{
  ingest_path: String.t(),
  name: String.t(),
  on_verify_failure: String.t() | nil,
  sinks: [map()],
  source_id: String.t(),
  tenant: String.t(),
  verify: map()
}

Functions

from_json(data)

@spec from_json(term()) :: {:ok, t()} | :error

Build a source from a decoded API object.

tenant, name, source_id and ingest_path are required binaries; verify defaults to %{"type" => "none"} and sinks to [] when the body omits them. Returns :error when a required field is missing or malformed.