Repository navigation
developer_docs: document the secret() template helper - #18
Merged
Merged
Conversation
Since shard_core 0.41.2 (FreeshardBase/freeshard#173) compose templates can call secret('<name>') for a generated, app-scoped value. The page had no mention of it. It gets its own section under Variables, not an include table: it is a function with a free-form name argument, so there is no fixed set of rows to list. The complex example now password-protects its redis to show one name shared by two containers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The note that app-scoping is not a boundary against a hostile template is a shard_core design gap, not something app developers act on; it is tracked as an issue in FreeshardBase/freeshard instead. digest.md gets the secret() helper and the password-protected redis example. No other docs changed since its last generation, so this brings it fully current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7.
Documents the
secret('<name>')helper that compose templates gained in FreeshardBase/freeshard#173. Until nowdocker_compose_template.mddid not mention it. Note that the syntax is a function call,{{ secret('db_password') }}. The{{ secret.my-secret }}form in #7 was written before the implementation and does not work.Changes
### Secretssection under Variables. It is prose plus a short snippet, not atemplate_vars_*.mdinclude table.secret()is a function with a free-form name, so a table would hold one row with no real example value.REDIS_PASSWORD={{ secret('redis_password') }}and redis gets--requirepasswith the same call, which shows that one name gives the same value in both containers. Annotations renumbered from 6 onward.digest.md(the AI-optimized digest that the landing page'sllms.txtand the app-repositoryadd-appskill point at): same example change plus a terse secrets block,Generated:stamped 2026-11-03. No other file underdocs/has changed since the previous generation on 2026-06-29, so the digest is now fully current. Split digest.md into a product and an app-dev digest, and enforce freshness in CI #17 (CI freshness check) is still needed to keep it that way.How the behaviour was verified
Every claim comes from the shard_core source, not from memory:
app_secrets.py,render_docker_compose_templateinutil.py,database/app_secrets.py, migrationshard-core-0006,tests/test_app_secrets.pyand the "App compose template context" section of shard_core'sagents.md:[A-Za-z0-9], generated on the first render that references the name.util.pyat each tag: 0.41.0 and 0.41.1 have nosecret=in the render call), but 0.41.2's image was never published (ghcr.io manifest is a 404; flaky CI test, fixed in tests: mock the real docker-prune subprocess in test_docker_prune freeshard#263), so 0.41.3 is the first version a shard can run. As of 2026-11-03 it is not yet rolled out to the fleet, so consider merging this after that rollout. Drop the version line if all shards are assumed to be current.mkdocs build --strictpasses locally.Related, not addressed here
oidctemplate context: also undocumented on this page. Tracked in Document the OIDC app integration: the app_meta oidc block and {{ oidc.* }} template vars (follow-up to freeshard#148/#149) #15.🤖 Generated with Claude Code