Public entry point for validating SAML 2.0 metadata documents.
validate/2 parses an XML document (raw binary) and returns a structured
report of structural / spec-conformance violations. It is intended to be
called at system boundaries — for example, before persisting IdP metadata
uploaded through an administration form, or before publishing SP metadata
to a partner.
This module currently implements spec-conformance rules only — every
finding is an :error. Best-practice rules (warnings, strict mode,
certificate linting) are added in subsequent releases.
Example
iex> ExSaml.Metadata.validate(xml)
{:ok, %ExSaml.Metadata.ValidationResult{errors: [], warnings: []}}Options
:ignore— list of violation codes to silence. Matching violations are removed from botherrorsandwarningsbefore the result is returned.
Return semantics
{:ok, %ValidationResult{errors: [], warnings: _}}when no error-level violation remains after:ignoreis applied.{:error, %ValidationResult{errors: errors, warnings: _}}otherwise.
See ExSaml.Metadata.ValidationResult for the shape of the returned struct.
Summary
Types
Functions
@spec validate(binary()) :: {:ok, ExSaml.Metadata.ValidationResult.t()} | {:error, ExSaml.Metadata.ValidationResult.t()}
@spec validate(binary(), opts()) :: {:ok, ExSaml.Metadata.ValidationResult.t()} | {:error, ExSaml.Metadata.ValidationResult.t()}