# `AttestoPhoenix.ClientIdMetadata.Logo`
[🔗](https://github.com/XukuLLC/attesto_phoenix/blob/v5.0.0/lib/attesto_phoenix/client_id_metadata/logo.ex#L2)

SSRF-guarded `logo_uri` prefetch and image validation (`draft-ietf-oauth-client-id-metadata-document-03` §10.9).

Authorization servers that wish to display a CIMD client's `logo_uri` to an
end-user MUST prefetch the image and serve it from a trusted origin rather
than linking directly to the client's `logo_uri`, and MUST verify that the
downloaded bytes are a valid image.

Supports raster formats (`image/png`, `image/jpeg`, `image/gif`,
`image/webp`), verifying both the HTTP `Content-Type` header and the leading
magic bytes of the fetched payload under `HostPolicy`, `FlowControl`, and
`Fetcher.Req`'s SSRF guard and byte cap. SVG is intentionally excluded by
default to avoid active script/entity risks when re-served.

# `logo_result`

```elixir
@type logo_result() :: %{
  body: binary(),
  content_type: String.t(),
  cache_control: keyword()
}
```

# `prefetch`

```elixir
@spec prefetch(
  String.t() | map() | AttestoPhoenix.ClientIdMetadata.Client.t(),
  AttestoPhoenix.Config.t(),
  keyword()
) :: {:ok, logo_result()} | {:error, term()}
```

Prefetch and validate the `logo_uri` from a CIMD client map, `%Client{}`, or URL string.

---

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