Environment variables for StringArray flags (e.g. FGA_CUSTOM_HEADERS, FGA_API_SCOPES) only support a single value. Setting multiple values via env var silently produces one entry containing the entire string, which either fails parsing or is ignored.
Example:
FGA_CUSTOM_HEADERS="X-Foo: bar,X-Baz: qux" fga store list
# Results in one invalid header entry "X-Foo: bar,X-Baz: qux"
# instead of two separate headers
Root cause:
BindViperToFlags (internal/cmdutils/bind-viper-to-flags.go) passes the viper value through fmt.Sprintf("%v", value). When the value comes from an env var, viper returns a plain string — there's no splitting logic. The YAML config file path works correctly (viper returns a []any slice which is now handled), but env vars do not.
Affected flags:
--custom-headers / FGA_CUSTOM_HEADERS
--api-scopes / FGA_API_SCOPES
Workaround:
Use the config file (~/.fga.yaml) instead:
custom-headers:
- "X-Foo: bar"
- "X-Baz: qux"
Environment variables for
StringArrayflags (e.g.FGA_CUSTOM_HEADERS,FGA_API_SCOPES) only support a single value. Setting multiple values via env var silently produces one entry containing the entire string, which either fails parsing or is ignored.Example:
Root cause:
BindViperToFlags(internal/cmdutils/bind-viper-to-flags.go) passes the viper value throughfmt.Sprintf("%v", value). When the value comes from an env var, viper returns a plain string — there's no splitting logic. The YAML config file path works correctly (viper returns a[]anyslice which is now handled), but env vars do not.Affected flags:
--custom-headers/FGA_CUSTOM_HEADERS--api-scopes/FGA_API_SCOPESWorkaround:
Use the config file (
~/.fga.yaml) instead: