H.HTTP.SecurityPlug (H v0.3.0)

Copy Markdown View Source

HTTP security boundary:

  • Rejects DNS rebinding via strict Host allowlist (421).
  • Handles POST /api/v1/auth/session owner-token to HttpOnly; SameSite=Strict cookie exchange.
  • Enforces Bearer token or cookie + Origin + application/json auth on /api/v1/*.
  • Parses bounded JSON bodies (4_000_000 bytes) via Plug.Parsers.

Summary

Functions

Returns true when the request arrived over a local Unix domain socket (or :unix_socket is explicitly set in opts).

Functions

unix_socket_conn?(conn, opts \\ [])

@spec unix_socket_conn?(Plug.Conn.t(), keyword()) :: boolean()

Returns true when the request arrived over a local Unix domain socket (or :unix_socket is explicitly set in opts).