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

Copy Markdown View Source

The writable fields of a source, as submitted to PUT/POST.

sinks is required and must be non-empty — the server validates the spec exactly as it validates the YAML config. verify is optional; absent means the server's default ({"type": "none"}), because omitting it is not the same as re-sending a secret the API never returns.

%Ankusa.SDK.Sources.Spec{
  sinks: [%{"type" => "log"}],
  verify: %{"type" => "hmac", "secret" => "s3cr3t", "signature_header" => "X-Sig"},
  on_verify_failure: "reject"
}

Summary

Functions

The JSON body for a create/update, omitting unset (nil) fields.

Types

t()

@type t() :: %Ankusa.SDK.Sources.Spec{
  on_verify_failure: String.t() | nil,
  sinks: [map()] | nil,
  verify: map() | nil
}

Functions

to_json(spec)

@spec to_json(t()) :: map()

The JSON body for a create/update, omitting unset (nil) fields.