Replies: 1 comment
|
Thanks for the detailed example. I traced the current workaround through the resolver and found two concrete issues:
I opened #771 to fix both behaviors. Successful fallback under the effective This is deliberately a focused fix for the existing schema. The native ordered AI-assisted — Tool: Codex; model: unavailable; version: unavailable. |
Uh oh!
There was an error while loading. Please reload this page.
Two Age providers grant different capabilities:
One profile prefers read/write and falls back to read-only:
The different results are intentional. The read-only identity receives the read-only token; the admin identity receives the read/write token. For the read-only identity, failure to decrypt the preferred value is normal control flow, but fnox prints a warning every time the program runs (twice in this example).
The same pattern applies to
OPENAI_API_KEY. Many programs and scripts can use that variable, but unrelated programs should not see it. It may also resolve to a different key for each developer so usage can be monitored, limited, rotated, or revoked independently. An ordered set of permission-scoped candidates could select Jane's key for Jane, John's key for John, and a shared restricted key for CI. Failed candidates are expected; warning for each rejected candidate makes a successful, intended resolution look unhealthy.Workaround
We can suppress the current warning globally:
This is a dirty workaround. It changes logging for the whole resolver, is easy to omit at a call site, and can hide warnings from unrelated secrets whose fallback was not intended.
Possible solution 1: configurable fallback log filter
Allow
fnox.tomlto configure fallback logging with the same target-aware directive syntax asRUST_LOG, rather than only accepting a smalloff/level enum:Possible solution 2: native ordered fallback sources
Represent the intent directly instead of using an internal secret and string interpolation:
The same schema could express several developer-specific
OPENAI_API_KEYcandidates followed by a restricted CI key. Only the resolved value should be exported, and failure should never appear in logs. A final failure withif_missing = "error"should remain a visible error.For Age providers, fnox can often avoid the expected failed decryption entirely. Derive the public recipient for the effective identity, inspect ordered provider candidates, and silently skip a candidate when that recipient is not in the provider's configured
recipientslist.All reactions