The runtime of one Arc application: discovery, configuration and the processes that serve observable queries.
defmodule MyApp.Arc do
use Arc.Application, otp_app: :my_app
endStart it in your supervision tree, after the Chronicle client:
children = [
{Chronicle.Client, ...},
MyApp.Arc
]There is no global configuration. Everything is scoped to the application module, so tests and several Arc applications in one VM stay isolated.
Options
Options are given to use and merged over config :my_app, MyApp.Arc, [...].
:otp_app- (required) the OTP application whose modules are scanned for commands and read models (anything defining__arc__/0):artifacts- an explicit list of modules instead of scanning:otp_app:route_prefix- default"api":segments_to_skip- leading module-name segments dropped from routes, slice locations and proxy folders; default1(the application name):chronicle- options given to every Chronicle call, for example[client: MyApp.Chronicle]:authentication- a list ofArc.Authenticationhandler modules, run in order:policies-[name: PolicyModule]forArc.Policy:filters-Arc.Filtermodules: cross-cutting rules that run for every command and query:tenant_header- default"x-cratis-tenant-id"; the header the:headertenancy resolver reads, and the fallback of the:subdomainone:tenancy- how the tenant is resolved, seeArc.Tenancy:resolver(:header,:query,:claim,:subdomain,:fixed,:developmentor a module),header,query_parameter,claim_type,base_domainandtenant_id. A named tenant also selects the Chronicle namespace of every call made through the context:correlation_header- default"x-correlation-id":max_body_bytes- request body limit; default1_000_000:introspection- who may read the discovery routes (/.cratis/commands,/.cratis/queries,/.cratis/identity-details/schema,/.cratis/users,/.cratis/tenants)::authenticated(default),:anonymousorfalseto remove them./.cratis/meis not affected:expose_exceptions- include exception messages and stack traces in results; defaultfalse, which replaces them with a generic message (the detail is always logged):identity_details- theArc.Identity.Providermodule to use; by default the single provider found in:otp_app. Without a provider/.cratis/meis not served:trust_forwarded_identity_headers- letArc.Authentication.MicrosoftIdentityPlatformaccept thex-ms-client-principal*headers; defaultfalse. Enable only behind an ingress that authenticates callers and strips client-supplied identity headers:forwarded_identity- signed forwarded identity, seeArc.Identity.SignedForwarding:enabled,audience,keys: [[key_id:, secret_base64:]]:on_behalf_of- acting on behalf of a user, seeArc.Identity.OnBehalfOf:enabled,issuer,audience,service,clock_skew(seconds),signing_keys: [[key_id:, public_key_pem:]]
Summary
Functions
The artifact descriptors of an application: %{commands: [...], read_models: [...]}.
Functions
@spec artifacts(module()) :: %{ commands: [Arc.Descriptor.t()], read_models: [Arc.Descriptor.t()] }
The artifact descriptors of an application: %{commands: [...], read_models: [...]}.