Bloccs.Effects.HTTP.Allowlist (bloccs v0.1.0)

Copy Markdown View Source

Shared host/method allowlist enforcement for HTTP backends.

Both the mock and the real (Req) backend run this before any I/O, so the capability guarantee — a node can only reach hosts/methods it declared in [effects].http — holds identically regardless of backend.

Summary

Functions

Check a method + url against the declared allow hosts and methods. Returns :ok or {:deny, detail} with a human-readable reason.

Functions

check(allow, methods, method, url)

@spec check([String.t()], [String.t()], String.t(), String.t()) ::
  :ok | {:deny, String.t()}

Check a method + url against the declared allow hosts and methods. Returns :ok or {:deny, detail} with a human-readable reason.