Alternera.Plugin.Provisional.Reads (alternera_plugin_sdk v0.9.0)

Copy Markdown View Source

Provisional: added for Script, and a change to it needs a changelog line but no new major (docs/USER_PLUGINS_DESIGN.md). The namespace has nothing to do with the context's :provisional? key.

What a plugin may read from the proxy beyond templates. Each read goes through Alternera.Plugin.Host.

Summary

Functions

The methods the tenant's pipelines allow for request, as a list.

The error a catch or On error handles (the context's), as a map with string keys.

How long a call may read an upstream's response, for tenant_id or by default for nil.

How many compiled scripts tenant_id may keep, or by default for nil.

The tenant variable name in scope, as a reference of kind reads it. A secret reads as the reference, never its value.

Functions

allowed_methods(request)

@spec allowed_methods(map() | nil) :: [String.t()]

The methods the tenant's pipelines allow for request, as a list.

error_map(error)

@spec error_map(term()) :: %{required(String.t()) => term()}

The error a catch or On error handles (the context's), as a map with string keys.

read_timeout_ms(tenant_id)

@spec read_timeout_ms(String.t() | nil) :: pos_integer()

How long a call may read an upstream's response, for tenant_id or by default for nil.

script_cache_max_entries(tenant_id)

@spec script_cache_max_entries(String.t() | nil) :: pos_integer()

How many compiled scripts tenant_id may keep, or by default for nil.

tenant_var(kind, name, scope, opts \\ [])

@spec tenant_var(:plain | :secret, String.t(), map() | nil, keyword()) ::
  {:ok, String.t()} | {:error, String.t()}

The tenant variable name in scope, as a reference of kind reads it. A secret reads as the reference, never its value.