Problem
The Spin CLI validates typed app-config secret values as lowercase ^[a-z][a-z0-9_]*$ names and lowercases before collision detection. That does not match the runtime contract used by downstream apps that encode a (store, key) into a Spin variable name.
For example, Trusted Server accepts lower-case-leading keys and encodes uppercase characters and -, _, ., and : with a v_ prefix plus hexadecimal escapes. The current EdgeZero validator rejects several keys the runtime supports, can accept/reject a different collision set, and rejects repeated references to the same physical secret even though they resolve unambiguously to one variable.
This makes config validate / config push disagree with deployed Spin behavior. It may also make a non-Spin target fail due to a declared Spin adapter's portability validation.
Proposed direction
- Define one canonical Spin secret-variable encoder for
(store, key) and use it for both runtime lookup and CLI validation.
- Validate the encoded variable name rather than applying a separate lowercase-only rule to the raw secret key.
- Deduplicate identical physical references. Reject only when two distinct
(store, key) pairs encode to the same variable name.
- Scope adapter-specific portability validation to the selected target adapter, or expose an explicit all-adapters portability mode.
Acceptance criteria
Downstream impact
Trusted Server currently pins EdgeZero at bb4411625856472b1279a3db49aeeac5e8b1507e. Once fixed, it should update that pin and add a regression test around its Spin secret references.
Problem
The Spin CLI validates typed app-config secret values as lowercase
^[a-z][a-z0-9_]*$names and lowercases before collision detection. That does not match the runtime contract used by downstream apps that encode a(store, key)into a Spin variable name.For example, Trusted Server accepts lower-case-leading keys and encodes uppercase characters and
-,_,., and:with av_prefix plus hexadecimal escapes. The current EdgeZero validator rejects several keys the runtime supports, can accept/reject a different collision set, and rejects repeated references to the same physical secret even though they resolve unambiguously to one variable.This makes
config validate/config pushdisagree with deployed Spin behavior. It may also make a non-Spin target fail due to a declared Spin adapter's portability validation.Proposed direction
(store, key)and use it for both runtime lookup and CLI validation.(store, key)pairs encode to the same variable name.Acceptance criteria
Downstream impact
Trusted Server currently pins EdgeZero at
bb4411625856472b1279a3db49aeeac5e8b1507e. Once fixed, it should update that pin and add a regression test around its Spin secret references.