# `ExSaml.Metadata`
[🔗](https://github.com/docJerem/ex_saml/blob/main/lib/ex_saml/metadata.ex#L1)

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 both `errors` and `warnings` before the result is
    returned.

## Return semantics

  * `{:ok, %ValidationResult{errors: [], warnings: _}}` when no
    error-level violation remains after `:ignore` is applied.
  * `{:error, %ValidationResult{errors: errors, warnings: _}}` otherwise.

See `ExSaml.Metadata.ValidationResult` for the shape of the returned struct.

# `option`

```elixir
@type option() :: {:ignore, [atom()]}
```

# `opts`

```elixir
@type opts() :: [option()]
```

# `validate`

```elixir
@spec validate(binary()) ::
  {:ok, ExSaml.Metadata.ValidationResult.t()}
  | {:error, ExSaml.Metadata.ValidationResult.t()}
```

# `validate`

```elixir
@spec validate(binary(), opts()) ::
  {:ok, ExSaml.Metadata.ValidationResult.t()}
  | {:error, ExSaml.Metadata.ValidationResult.t()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
