# `KeenAuth.Helpers.InputValidator`
[🔗](https://github.com/KeenMate/keen_auth/blob/main/lib/helpers/input_validator.ex#L1)

Validates input parameters to prevent abuse and ensure security.

This module provides validation for common input fields like provider names
and redirect URLs. It helps prevent denial of service through oversized inputs
and other input-based attacks.

# `validate_provider`

```elixir
@spec validate_provider(binary()) :: {:ok, binary()} | {:error, :invalid_provider}
```

Validates a provider name.

Returns `{:ok, provider}` if valid, or `{:error, reason}` if invalid.

Validation rules:
- Must not exceed 64 characters
- Must only contain alphanumeric characters, hyphens, and underscores

# `validate_redirect_length`

```elixir
@spec validate_redirect_length(binary() | nil) ::
  {:ok, binary() | nil} | {:error, :redirect_too_long}
```

Validates a redirect URL length.

Returns `{:ok, url}` if valid, or `{:error, reason}` if too long.

---

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