SCIM error handling and standardization per RFC 7644 Section 3.12.
This module provides SCIM error types, standardization functions, and error response formatting that maintains proper separation between core SCIM logic and web concerns.
Summary
Types
Standard SCIM error response structure.
SCIM error types as defined in RFC 7644 Section 3.12.
Individual validation error for multi-error responses.
Functions
Creates a standardized error response from an HTTP status code.
Creates a standard SCIM error response structure.
Creates a SCIM validation error response with multiple errors.
Maps HTTP status codes to appropriate SCIM error types and default messages.
Converts SCIM error types to their string representation.
Types
@type error_response() :: %{ required(String.t()) => [String.t()], required(String.t()) => String.t(), required(String.t()) => String.t(), optional(String.t()) => String.t(), optional(String.t()) => [validation_error()] }
Standard SCIM error response structure.
Contains string keys: "schemas", "status", "scimType", "detail", "errors". Generic String.t() keys used due to Elixir type system limitations.
@type scim_type() ::
:invalid_filter
| :invalid_path
| :invalid_syntax
| :invalid_target
| :invalid_value
| :invalid_version
| :mutability
| :no_authn
| :no_target
| :not_found
| :sensitive
| :too_large
| :too_many
| :uniqueness
| :forbidden
| :insufficient_rights
| :insufficient_scope
| :invalid_credentials
| :internal_error
| :unknown
SCIM error types as defined in RFC 7644 Section 3.12.
@type validation_error() :: %{ required(String.t()) => String.t(), required(String.t()) => String.t() }
Individual validation error for multi-error responses.
Contains string keys: "path", "message".
Functions
@spec build_error_from_status(integer()) :: error_response()
Creates a standardized error response from an HTTP status code.
@spec build_error_response(integer(), scim_type(), String.t()) :: error_response()
Creates a standard SCIM error response structure.
@spec build_validation_error_response([validation_error()]) :: error_response()
Creates a SCIM validation error response with multiple errors.
Maps HTTP status codes to appropriate SCIM error types and default messages.
Converts SCIM error types to their string representation.