Policy configuration hard cut and manual migration
This guide is the breaking-change and manual migration contract from the
removed auth.policy configuration to the production namespace-owned policy
model. It is deliberately field-complete: each old concept has one new owner,
one decode path, one validation path, and one canonical dump path.
Top-level policy is the sole production configuration and runtime authority
for authentication, identity-provider, backchannel, Policy HTTP, and Policy
gRPC decisions. Production FileSettings owns that top-level field and does
not read auth.policy. Old-root and mixed-root inputs are rejected before
candidate preparation.
No runtime, startup, library, supported converter, or offline translator from
auth.policy to top-level policy exists. Operators must author the new
configuration directly from this guide. The former configuration-converter
surface has been removed and is not replaced. The repository may retain frozen
old inputs and independently authored new inputs as test-only rejection and
parity oracles, but those fixtures are not a decoder, converter, or migration
API.
Field-complete mapping
The following seventeen rows are the complete B001-C2 mapping. Paths beginning
with auth.policy describe removed input. Paths beginning with policy are the
sole production representation.
| Mapping family | Removed path | New owner and exact path | Default or identity | Validation contract |
|---|---|---|---|---|
| Mode | auth.policy.mode | policy.targets[].mode on every activated target with namespace: authn | Default enforce; copy the old value to every migrated authn target. | Only enforce and observe are valid authn target modes. |
| Default policy | auth.policy.default_policy | policy.targets[].default_policy on every activated authn target | The only builtin fallback identity is authn/standard_auth. | The unqualified standard_auth spelling is rejected. |
| Localization catalogs | auth.policy.localization.catalogs | policy.namespaces.authn.localization.catalogs | Default empty; the translation namespace remains distinct from authn. | Every catalog requires a namespace, language, and entries map. |
| Network condition sets | auth.policy.sets.networks | policy.namespaces.authn.condition_sets.networks | Default empty; @network.<name> references retain their meaning. | Network sets remain namespace-owned operands of the compiled source policy set. |
| String condition sets | auth.policy.sets.strings | policy.namespaces.authn.condition_sets.strings | Default empty; @string.<name> references retain their meaning. | String sets remain namespace-owned operands of the compiled source policy set. |
| Time-window condition sets | auth.policy.sets.time_windows | policy.namespaces.authn.condition_sets.time_windows | Default empty; @time_window.<name> references retain their meaning. | Each configured interval requires non-empty start and end values. |
| Scheduler guards | auth.policy.scheduler_guards | policy.namespaces.authn.domain_plans.<plan>.scheduler_guards | Default empty; guards are visible only inside their exact domain plan. | on_missing_attribute is omitted or exactly run, preserving the legacy compiler contract. |
| Report settings | auth.policy.report | policy.targets[].report on each activated authn target | Defaults are enabled: false, include_fsm: true, include_checks: true, and include_attributes: false. | Authn-only report detail fields are rejected on non-authn targets. |
| Lua environment providers | auth.policy.attribute_sources.lua.environment | policy.namespaces.authn.providers.lua_environment_<old-name> | The exact provider identity is authn/lua_environment_<old-name>. | The provider kind is lua_environment; strict production decoding accepts only the canonical script_path field, which production validation requires to be non-empty; file/source resolvability belongs to candidate compilation. |
| Lua subject providers | auth.policy.attribute_sources.lua.subject | policy.namespaces.authn.providers.lua_subject_<old-name> | The exact provider identity is authn/lua_subject_<old-name>. | The provider kind is lua_subject; strict production decoding accepts only the canonical script_path field, which production validation requires to be non-empty; file/source resolvability belongs to candidate compilation. |
| Lua action effects | auth.policy.obligation_targets.lua.actions | policy.namespaces.authn.effects.lua_action_<old-name> | The exact effect identity is authn/lua_action_<old-name>, with mandatory execution. | post requires host_post_action; all other retained Lua action types require host_sync. |
| Lua registry scripts | auth.policy.registry_scripts | policy.namespaces.authn.schema_contributions.lua.registry_scripts | Default empty; scripts contribute bounded authn-owned fact definitions only during candidate compilation. | Every configured registry-script path is non-empty. |
| HTTP header fact sources | auth.policy.request_headers | policy.namespaces.authn.fact_sources.http_headers | Default empty; source, fact, normalization, visibility, and bounds retain their meaning. | Each entry requires a non-empty header and a canonical fact identity. |
| gRPC metadata fact sources | auth.policy.request_metadata | policy.namespaces.authn.fact_sources.grpc_metadata | Default empty; source, fact, normalization, visibility, and bounds retain their meaning. | Each entry requires a non-empty metadata key and a canonical fact identity. |
| Backend attribute fact sources | auth.policy.attribute_exports | policy.namespaces.authn.fact_sources.backend_attributes | Default empty; backend name, fact, type, and sensitivity retain their meaning. | Each entry requires a name, canonical fact identity, exact value kind, and supported sensitivity. |
| Checks | auth.policy.checks | policy.namespaces.authn.domain_plans.<plan>.checkpoints.<checkpoint>.providers[] | Check type plus config_ref becomes one deterministic exact use identity. | The containing checkpoint owns the removed check stage, and use must be exact. |
| Rules | auth.policy.policies | policy.namespaces.authn.policy_sets.configured.rules[] | Default empty; migrated rules are authored once in private authn/configured. | Every imported rule is validated against its exact target action and checkpoint. |
The old Lua provider name is appended to the reserved
lua_environment_ or lua_subject_ prefix. The old Lua action name is
appended to lua_action_; its old type becomes action_type, and
script_path remains script_path. The retained action types
brute_force, rbl, tls_encryption, relay_domains, and lua use
host_sync; only post uses host_post_action. Operator configuration does
not add an internal effect-provider binding. Builtin standard-auth effect
descriptors and host bindings remain immutable catalog contributions.
For Lua actions too, strict decoding accepts only the canonical script_path
field and production validation requires a non-empty value. Opening the file,
resolving the configured source, and binding its host implementation belong to
candidate compilation. None of these checks translates an old configuration.
Native and plugin provider definitions have no additional legacy storage in the
new model. Configured definitions belong below
policy.namespaces.<namespace>.providers.<name>. Loaded descriptors contribute
the real binding and exact output schemas; the matching configured definition
declares the module, target actions, and execution modes. Neither side silently
synthesizes the other. A provider instance references the resulting exact
identity with use and never stores a Viper path.
Target timeouts have no removed auth.policy source. Generic targets must
provide positive timeouts.evaluation and timeouts.provider_default values;
authn continues to use its host-owned timeout sources. This is a new generic
target requirement, not a migrated eighteenth row.
Generic Lua provider configuration
Generic Lua providers likewise have no removed auth.policy source and do not
add a mapping row. They use the production namespace-owned kind: lua path and
are activated only when their target, schema, provider, and effect bindings all
pass candidate-generation validation. They must not be represented as
lua_environment, lua_subject, or lua_action: those kinds preserve the
existing implicit authn behavior only.
policy:
namespaces:
dkim2:
schema_contributions:
static:
sign-message:
versions:
v1:
facts:
- attribute: lua.reputation.risk_score
category: environment
type: integer
allowed_sources: [lua]
providers:
risk:
kind: lua
module: reputation
script_path: /etc/nauthilus/lua/reputation.lua
targets: [{action: sign-message}]
produced_facts: [lua.reputation.risk_score]
executions: [host_sync]
requires: []
failure: indeterminate
timeout: 100ms
diagnostics: {public_id: reputation}
effects:
record-audit:
kind: obligation
provider: dkim2/risk
targets: [{action: sign-message}]
execution: host_sync
parameters:
message:
type: string
max_length: 32
non_empty: true
required: true
module is the canonical lowercase Lua authority. The example's authored provider key resolves to the immutable
internal identity dkim2/lua.reputation.risk, and the callback returns local risk_score for the host-qualified fact
lua.reputation.risk_score. Configuration always references the provider by its authored key: domain-plan entries
use use: dkim2/risk and effects use provider: dkim2/risk. The internal identity is not a reference form, and
use: dkim2/lua.reputation.risk is rejected as not an exact qualified provider identity.
Every produced fact must exist with identical category, type, and bounds in every exact
target schema and must allow source lua. Explicit targets are used as written; when omitted, target-aware preparation
derives them only from exact plan and effect bindings.
failure is mandatory and is exactly indeterminate or compiler-safe continue. The shared scheduler handles
dependencies and skipped_dependency; Lua cannot return an auth-style abort or reorder the plan. Contract violations
such as undeclared facts, source/authority mismatch, wrong type or bounds, or fact collisions always fail closed as
indeterminate regardless of continue.
Generic scripts register _G["policy.facts.collect"] and, when the provider owns selected host effects,
_G["policy.effects.execute"]. Only selected host_sync and host_post_action obligations execute. Advice and
return_only effects never call Lua. Post-actions require host-supervisor acceptance before response finalization, and
Lua receives neither the finalization gate nor detached-work authority. The generic contract has no automatic retry,
replay, idempotency, or deduplication fields, and every Lua effect is treated as replay-unsafe. The exact Lua tables and strict typed-value encodings are documented in
server/lua-plugins.d/policy/README.md.