Detach callback values before publishing configuration
This commit is contained in:
@@ -34,7 +34,10 @@ root `T` must satisfy the application schema contract below. With no options it
|
||||
starts from the Go zero value. A `Definition[T].Defaults` factory, when supplied,
|
||||
runs exactly once after successful source parsing, schema construction, optional
|
||||
schema-version checking, and selected-profile loading. Its result is detached before
|
||||
input is applied.
|
||||
input is applied. Resolver-provided mutable values are detached before secret lookup
|
||||
and validation, and a final detached copy prevents equal-valued aliases introduced
|
||||
by validators from escaping into the returned configuration. The publication copy
|
||||
preserves already validated secret state without rereading the environment.
|
||||
|
||||
The current lifecycle is:
|
||||
|
||||
|
||||
@@ -76,6 +76,11 @@ regular-file, permitted symlink, containment, and permission tests passing.
|
||||
|
||||
## 3. P1 — Detach mutable values introduced by resolution before publication
|
||||
|
||||
Status: complete. Added post-resolution and publication ownership copies; the latter
|
||||
preserves already validated secret state. Regressions cover nested maps/slices,
|
||||
pointers, direct/helper assignments, validator aliases, and one lookup per load.
|
||||
Full tests pass with the issue-8 TMPDIR workaround; vet, build and whitespace pass.
|
||||
|
||||
Evidence: [resolution.go](../../resolution.go), `Default`/`Normalize`, directly
|
||||
assign supplied values; `runResolution` projects them but does not clone the typed
|
||||
object. [load.go](../../load.go) publishes that same object in `Result.Config`.
|
||||
|
||||
Reference in New Issue
Block a user