You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Environment variables in {{include}}d files are never substituted, so they stay literal (including in shipped examples) #165
{{env.NAME}} inside a file pulled in with {{include ...}} is never substituted, and never checked against the whitelist. ExtendedYamlParser::loadYamlFile is just YAML::Load(ReadConfigFile(path)) (src/extended_yaml_parser.cpp, used at both include sites), so included content skips the substitution the including file gets.
Reproduced (whitelist lists only FLAPI_INC_LISTED, both variables set; the shared file is outside the templates directory so it is only ever reached through the include):
flapi --validate-config passes. It is not a confidentiality problem (a value is never read), but it is exactly the silent-literal failure the whitelist enforcement in #164 exists to prevent: a password that is the text {{env.DB_PASSWORD}}.
Pre-existing: identical on main. Found by two independent reviewers of #164.
It affects the shipped examples
examples/sqls/customers/customers-rest.yaml and customers-mcp-tool.yaml include auth from customer-common.yaml, which has twelve {{env.CUSTOMER_API_*}} references. So those endpoints' auth users carry literal names such as {{env.CUSTOMER_API_READ_USER}} today.
Why this is not a one-line fix
Simply substituting included content is what the docs promise ("anywhere in your YAML") — but an unset variable substitutes as an empty string, so the shipped auth users would become empty usernames and passwords. Someone needs to decide what an empty credential does on those endpoints before this is changed, and the fix must also keep the whitelist error from being swallowed by the include site's generic "Could not resolve include path" catch.
Suggested
Substitute and enforce included content under the same policy, with a dedicated exception type so the whitelist error reaches the operator.
Treat an unset-but-whitelisted variable in a credential field as an error rather than an empty string (see also test_jwt_empty_secret.py, which already worries about this for jwt-secret).
Add tests for listed and unlisted references inside an included file, and fix the example whitelists to match.
Until then the docs say {{env.NAME}} is checked in the main config and endpoint files, and not in included content.
Activity
fix: match environment variable names case-sensitively; the file brow…
Merge pull request #169 from DataZooDE/fix/gh-165-include-env-substit…
docs: Included files get env substitution and the whitelist check (#268)
docs: Make the Readme the entry point and stop docs drift (#268) (#269)