ExSaml.Metadata.ValidationResult (ex_saml v1.1.0)

Copy Markdown View Source

Result of a call to ExSaml.Metadata.validate/1 or ExSaml.Metadata.validate/2.

The struct holds two lists of findings: errors (severity :error) and warnings (severity :warning). See violation/0 for the shape of an individual entry.

Convention used by ExSaml.Metadata.validate/2:

  • {:ok, %__MODULE__{errors: [], warnings: warnings}} when no error-level violation is found (warnings may still be present).
  • {:error, %__MODULE__{errors: errors, warnings: warnings}} when at least one error-level violation is found.
  • Any code listed in :ignore is removed from both lists.

Summary

Types

t()

A single validation finding.

Types

t()

@type t() :: %ExSaml.Metadata.ValidationResult{
  errors: [violation()],
  warnings: [violation()]
}

violation()

@type violation() :: %{
  code: atom(),
  severity: :error | :warning,
  message: String.t(),
  path: String.t() | nil,
  spec_reference: String.t() | nil
}

A single validation finding.

  • :code — stable atom identifier for the rule (e.g. :invalid_acs_binding).
  • :severity:error for spec violations (and some always-error defaults), :warning for best-practice findings that are not hard failures by default.
  • :message — human-readable description of the violation.
  • :path — XPath-like pointer to the offending node, or nil for document-level violations (e.g. :invalid_xml, :invalid_root_element) that have no meaningful location.
  • :spec_reference — free-form reference to the SAML / OASIS section that justifies the rule, or nil when none applies.