random, and json when it builds, have no subject and start at options.
One bare address
Only in url and json. url($X, host) reads, url($X, host=replica.internal.test) writes; a call never does both.
Options
Every other argument is name=value, in any order. A repeated or unknown option is a validation failure naming the function and the option.
Filters
${KEY | name(args)} is the function with its subject implied; filters chain left to right. A default cannot hold a |.
Failures
Name the key and the part, path or option, never the value.
Taint
A result is sensitive when any input is: the subject, a written value or a key=. A key read only to decide (eq, startsWith) taints nothing. Only the public lists declassify, and only a stored value.
A part the URL lacks is empty; fallback(url($X, port), 5432) supplies one.
A URL naming several hosts fails host and port. A value that is not a URL fails every part.
Writable: scheme, host, port, path, user, password, query.NAME. A password= value is a reference to another key, never a literal. A written URL is sensitive when its source is.
path is sensitive because a webhook URL carries its secret there. Opt in with [url] public.
# @assert(if(forEnv(production), true, not(eq(url($DATABASE_URL, host), url(penv(production/DATABASE_URL), host)))), "DATABASE_URL points at the production host")
Paths are a.b[0]; ["a.b"] names a key containing a dot. No word is reserved: a field called get is json(get=1).
Reading returns a string as is, a number or boolean as text, an array or object as compact JSON. A missing or null field fails; use fallback(). A duplicate key keeps the last value and warns, naming the key.
Writing types a bare number, true or false; anything else is a string, and quotes force one (maxUploadMb='25'). Strings are escaped; key order is kept.
SESSION_SECRET=random(length=32) # letters and digitsCOOKIE_KEY=random(kind=hex, length=32)INSTANCE_UUID=random(kind=uuid) # a version-4 UUID
Option
Values
Default
kind
alnum, hex, base64url, uuid
alnum
length
8 to 512; required, except uuid takes none
none
Characters come from the operating system's generator.
penv run generates the value once and keeps it in .env.local (.env.test.local for test). check, ls and scan never write it; check notes it as pending. penv push never sends it. Each machine has its own.
random(32) is a validation failure that says to write length=32.