API configuration

API configuration

Sources and precedence

Later sources override earlier ones.

OrderSourceScope
1appsettings.jsonCommitted defaults — src/Ignis.Api/appsettings.json
2appsettings.local.jsonDevelopment only, gitignored — example
3dotnet user-secretsDevelopment only
4Environment variablesRecommended for production
5Command-line argumentsAd-hoc overrides

JSON → env var translation

Replace : with __ (double underscore); array indices are their own segment.

JSON pathEnv var
AllowedHostsAllowedHosts
StoreSettings:ConnectionStringStoreSettings__ConnectionString
AuthSettings:Clients:0:ClientIdAuthSettings__Clients__0__ClientId
ForwardedHeaders:KnownProxies:0ForwardedHeaders__KnownProxies__0

AllowedHosts

Host-header allow-list. The committed appsettings.json ships localhost; HostFilteringExtensions.cs raises MissingConfigurationException if a deploy overrides it to empty (the ASP.NET implicit fallback to "*" is deliberately disabled).

KeyRequiredDefaultFormat / notes
AllowedHostsyeslocalhostSemicolon-separated hostnames. Use "*" to opt out explicitly.

StoreSettings

MongoDB connection for the FHIR store (resources, history).

KeyRequiredDefaultNotes
StoreSettings:ConnectionStringyesmongodb://localhost:27017/ignisMongoDB URI with database name

AuthSettings

OAuth 2.0 / OIDC authorization server (OpenIddict). May share or split the MongoDB database with StoreSettings. See Ignis.Auth README and Authentication.

KeyRequiredNotes
AuthSettings:ConnectionStringyesMongoDB URI for OpenIddict state (clients, tokens, authorizations)
AuthSettings:IssuerprodAbsolute public URL in OIDC discovery. Set when behind a TLS-terminating proxy.
AuthSettings:RefreshTokenLifetimeSecondsoptionalAbsolute refresh token lifetime before re-login; default 28800 (8 h).
AuthSettings:Clients[]yesRegistered OAuth clients — Ignis.Auth → Configuration
AuthSettings:ExternalProviders[]for loginExternal identity providers — Authenticate with GitHub
AuthSettings:Users[]optionalPer-user scope assignments — subject format and scope semantics in Scopes
AuthSettings:Certificates:*prodSigning + encryption PFX — Ignis.Auth → Certificates
AuthSettings:Endpoints:LoginPathoptionalOverride the login challenge path (default connect/login)

[!NOTE] ExternalProviders[].Type accepts GitHub or OIDC — but OIDC is unimplemented and throws NotSupportedException at startup.

ForwardedHeaders

Trusted-proxy allow-list for X-Forwarded-For / X-Forwarded-Proto. Required when behind a reverse proxy, load balancer, or ingress. Middleware only registers when at least one proxy or network is configured; invalid values fail fast with InvalidConfigurationException.

KeyTypeExampleNotes
ForwardedHeaders:KnownProxieslist of IP strings["10.0.0.1"]Individual IPv4/IPv6 proxy addresses
ForwardedHeaders:KnownNetworkslist of CIDR strings["10.0.0.0/8"]Trusted proxy networks
HeaderTrusted?Reason
X-Forwarded-ForyesRestores client IP
X-Forwarded-ProtoyesRestores scheme behind TLS terminators
X-Forwarded-HostneverWith permissive AllowedHosts it would enable host-header injection

FeatureManagement

Boolean gates for endpoints that are off by default. Defense-in-depth on top of the corresponding maintenance/* scopes.

KeyDefaultWhen trueWhen false
FeatureManagement:AllowClearStorefalse$clear-store is reachable (still requires destructive)$clear-store → 404
FeatureManagement:AllowImportfalse$archive-import is reachable$archive-import → 503
FeatureManagement:AllowAnonymousValidationfalse$validate and StructureDefinition/$profiles accept unauthenticated callsBoth require a token, like every other endpoint

Anonymous validation

$validate reads only the posted body, never the store, so a demo server can offer it without accounts. The flag opens exactly two endpoints — $validate (type and instance level) and StructureDefinition/$profiles, which a validator UI needs for the profile list and which exposes no canonical /fhir/metadata does not already advertise.

The Web app gates the same thing with IGNIS_WEB_FEATURES_VALIDATION_ANONYMOUS — both sides must be set, see web-configuration.md.

SparkSettings

Spark FHIR engine. Defaults in appsettings.json are usually fine.

KeyNotes
SparkSettings:EndpointBase URL Spark embeds in resource fullUrl / Bundle.link. Match the public API URL.
SparkSettings:FhirReleaseR4 (only release currently used)

ProfileValidationSettings

FHIR conformance packages the structural profile validator loads for $validate. The directory is scanned (non-recursively) for *.tgz packages; empty uses the build-staged fhir-packages folder, and a relative value resolves under the app base directory. Dependencies are not fetched at run time — every transitive package must already be present. In Kubernetes, add packages without rebuilding the image via app.api.fhirPackages.packages (an init container downloads them), or set this directly to an air-gapped mount; see the validation guide. Point it at an empty directory to turn validation off (no packages load; $validate resolves nothing).

KeyRequiredDefaultNotes
ProfileValidationSettings:PackageDirectorynoemptyPVC mount in Kubernetes.

CapabilityStatementSettings

What /fhir/metadata says this deployment is, as CapabilityStatement.implementation.description. The default warns against personal data and deliberately claims nothing about retention or visibility, since those differ per deployment — a server holding real data has to describe itself.

KeyRequiredDefaultNotes
CapabilityStatementSettings:ImplementationDescriptionnotest-server noticeEmpty leaves Spark's own description alone.

Serilog

Console logging. Defaults emit human-readable output; switch to compact JSON for log aggregators.

Env varValue
Serilog__WriteTo__0__NameConsole
Serilog__WriteTo__0__Args__formatterSerilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact

See also root README → Structured JSON logging.

Edit this page