PraugaFlexDoc.HostExecution (prauga_flexdoc v0.4.5)

Copy Markdown View Source

Framework-neutral implementation of FlexDoc's existing API-host execution envelope.

This first native Elixir slice intentionally advertises no host-only capabilities.

Summary

Functions

Validates the marker and executes one canonical FlexDoc request envelope.

Creates a native executor from a non-empty exact HTTP(S) origin allowlist.

Types

result()

@type result() :: %{status: pos_integer(), body: map()}

t()

@type t() :: %PraugaFlexDoc.HostExecution{allowed_origins: MapSet.t(String.t())}

uploaded_file()

@type uploaded_file() :: %{
  filename: String.t(),
  content_type: String.t(),
  data: binary()
}

Functions

capabilities(execution)

handle(execution, marker, envelope, files \\ %{})

@spec handle(t(), String.t() | nil, term(), %{
  optional(non_neg_integer()) => uploaded_file()
}) ::
  result()

Validates the marker and executes one canonical FlexDoc request envelope.

max_request_bytes()

new!(allowed_origins)

@spec new!([String.t()]) :: t()

Creates a native executor from a non-empty exact HTTP(S) origin allowlist.