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.
Summary
Functions
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
@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.