ExScimPhoenix.ErrorResponse (ex_scim_phoenix v0.2.2)

Copy Markdown View Source

SCIM error response functions for Phoenix controllers.

This module bridges core SCIM error logic from ExScim.Error with Phoenix HTTP responses, providing functions that controllers can import to send RFC 7644 compliant error responses.

Summary

Functions

Sends a SCIM-compliant error response using core ExScim.Error logic.

Sends a SCIM error response based on HTTP status code using core ExScim.Error logic.

Sends a SCIM validation error list response using core ExScim.Error logic.

Functions

send_scim_error(conn, status, scim_type, detail)

@spec send_scim_error(Plug.Conn.t(), atom() | integer(), atom(), String.t()) ::
  Plug.Conn.t()

Sends a SCIM-compliant error response using core ExScim.Error logic.

  • status - can be an atom (:bad_request) or integer (400)
  • scim_type - SCIM error type atom from ExScim.Error.scim_type()
  • detail - human-readable error description

send_scim_error_from_status(conn, status)

@spec send_scim_error_from_status(Plug.Conn.t(), atom() | integer()) :: Plug.Conn.t()

Sends a SCIM error response based on HTTP status code using core ExScim.Error logic.

send_validation_errors(conn, errors)

@spec send_validation_errors(Plug.Conn.t(), [map()]) :: Plug.Conn.t()

Sends a SCIM validation error list response using core ExScim.Error logic.

Each error must be a map with:

  • "path" - the SCIM attribute path
  • "message" - the error message