Atex.Config (atex v0.10.0)

View Source

Library-wide configuration for Atex.

Configuration

The following keys are supported under config :atex:

config :atex,
  plc_directory_url: "https://plc.directory",
  service_did: "did:web:my-service.example",
  user_agent: "my-app/1.0.0"
  • :plc_directory_url - Base URL for the did:plc directory server. Defaults to "https://plc.directory".
  • :service_did - The DID of this service, used as the expected aud claim when validating incoming inter-service auth JWTs via Atex.XRPC.Router. Required when using Atex.XRPC.Router with auth enabled.
  • :user_agent - Custom User-Agent prefix for outgoing XRPC requests. When set, the User-Agent header becomes "<user_agent> (atex/<version>)". Defaults to "atex/<version>".

Summary

Functions

Returns the configured base URL for the did:plc directory server.

Returns the configured service DID to be used for validation service auth tokens.

Returns the User-Agent header value for outgoing XRPC requests.

Functions

directory_url()

@spec directory_url() :: String.t()

Returns the configured base URL for the did:plc directory server.

Reads :plc_directory_url from the :atex application environment. Defaults to "https://plc.directory".

service_did()

@spec service_did() :: String.t() | nil

Returns the configured service DID to be used for validation service auth tokens.

Reads :service_did from the `:atex application environment.

user_agent()

@spec user_agent() :: String.t()

Returns the User-Agent header value for outgoing XRPC requests.

Reads :user_agent from the :atex application environment. When set, the atex library version is appended in parentheses. When unset, returns only the atex version.

Examples

# Default (no :user_agent configured):
# => "atex/<version>"

# With `config :atex, user_agent: "my-app/1.0.0"`:
# => "my-app/1.0.0 (atex/<version>)"