Handles outbound credential isolation and exact-origin trust classification.
:trusted_origins entries are exact HTTP(S) origins: scheme, normalized
host, and effective port must all match. The explicitly broader
:trusted_hosts policy exists for loopback compatibility and deployments
that intentionally trust every scheme and port on a host.
Summary
Functions
Removes credential headers unless the target matches the configured trust policy.
Classifies a URL against exact origins or a complete security config.
Extracts a canonical scheme://host:port origin.
Strips sensitive headers from targets outside the trust boundary.
Functions
@spec check_token_passthrough(String.t(), [{String.t(), String.t()}], map()) :: {:ok, [{String.t(), String.t()}]}
Removes credential headers unless the target matches the configured trust policy.
Classifies a URL against exact origins or a complete security config.
Passing a list applies exact-origin semantics. Passing a map additionally
applies its explicitly broad :trusted_hosts entries.
Extracts a canonical scheme://host:port origin.
@spec strip_sensitive_headers([{String.t(), String.t()}], :internal | :external) :: [ {String.t(), String.t()} ]
Strips sensitive headers from targets outside the trust boundary.