# `ExUtcp.Auth`
[🔗](https://github.com/universal-tool-calling-protocol/elixir-utcp/blob/main/lib/ex_utcp/auth.ex#L1)

Authentication mechanisms for UTCP providers.

This module handles various authentication types including API key, Basic Auth, and OAuth2.

# `apply_api_key_auth`

```elixir
@spec apply_api_key_auth(ExUtcp.Types.api_key_auth(), map()) :: map()
```

Applies API key authentication to headers.

# `apply_basic_auth`

```elixir
@spec apply_basic_auth(ExUtcp.Types.basic_auth(), map()) :: map()
```

Applies Basic authentication to headers.

# `apply_to_headers`

```elixir
@spec apply_to_headers(ExUtcp.Types.auth(), map()) :: map()
```

Applies authentication to HTTP headers based on the auth configuration.

# `new_api_key_auth`

```elixir
@spec new_api_key_auth(keyword()) :: ExUtcp.Types.api_key_auth()
```

Creates a new API key authentication configuration.

# `new_basic_auth`

```elixir
@spec new_basic_auth(keyword()) :: ExUtcp.Types.basic_auth()
```

Creates a new Basic authentication configuration.

# `new_oauth2_auth`

```elixir
@spec new_oauth2_auth(keyword()) :: ExUtcp.Types.oauth2_auth()
```

Creates a new OAuth2 authentication configuration.

# `validate_auth`

```elixir
@spec validate_auth(ExUtcp.Types.auth()) :: :ok | {:error, String.t()}
```

Validates an authentication configuration.

---

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