Relyra.Security.XML behaviour (relyra v1.1.0)

Copy Markdown View Source

Hardened XML seam contract for trust-sensitive SAML handling.

Summary

Types

xml_error_type()

@type xml_error_type() ::
  :doctype_forbidden
  | :entity_expansion_forbidden
  | :external_reference_forbidden
  | :payload_too_large
  | :malformed_xml
  | :missing_protocol_field
  | :duplicate_xml_id
  | :missing_signature
  | :invalid_signature
  | :signature_wrapping_suspected
  | :canonicalization_failed
  | :untrusted_certificate
  | :unsigned_or_partial_signature

Callbacks

canonicalize(signed_node_handle, keyword)

@callback canonicalize(
  signed_node_handle :: term(),
  keyword()
) ::
  {:ok, binary()}
  | {:error, %Relyra.Error{details: term(), message: term(), type: term()}}

parse_safely(binary, keyword)

@callback parse_safely(
  binary(),
  keyword()
) ::
  {:ok, term()}
  | {:error, %Relyra.Error{details: term(), message: term(), type: term()}}

select_signed_node(parsed_doc, keyword)

@callback select_signed_node(
  parsed_doc :: term(),
  keyword()
) ::
  {:ok, term()}
  | {:error, %Relyra.Error{details: term(), message: term(), type: term()}}