Bier.CLI.ConfigFile (bier v0.1.0)

Copy Markdown View Source

Parses the PostgREST-compatible config-file subset into a %{kebab_key => raw_value} map: key = value lines, # comments (whole lines or trailing a value, as configurator-pg allows), blank lines, double-quoted strings (with \" escapes and configurator's $$ escape for a literal $), bare integers, and bare true/false. A # inside a quoted string is literal. Raw values are returned untyped; Bier.CLI.Config coerces them per the target key.

The $$ escape matters for jwt-role-claim-key: configurator treats $ in a quoted string as the start of an interpolation, so an RFC 9535 JSON Path is written "$$.role" in a config file and read back as $.role (conformance cases 1707/1726). Interpolation itself ($(key)) is not modelled — PostgREST's own dumps never emit it.

Summary

Functions

Parse config-file contents.

Read and parse a config file. A missing file is a fatal error.

Functions

parse(contents)

@spec parse(String.t()) :: {:ok, map()} | {:error, String.t()}

Parse config-file contents.

read(path)

@spec read(Path.t()) :: {:ok, map()} | {:error, String.t()}

Read and parse a config file. A missing file is a fatal error.