feat: add idempotency_token special variable per resource per session#30
Merged
jeffreyaven merged 2 commits intomainfrom Mar 15, 2026
Merged
feat: add idempotency_token special variable per resource per session#30jeffreyaven merged 2 commits intomainfrom
jeffreyaven merged 2 commits intomainfrom
Conversation
Introduces `idempotency_token`, a UUID v4 that is generated once per
resource at session start and remains stable for the lifetime of the
invocation. This allows mutation queries (INSERT/UPDATE) to carry a
provider-side client token that distinguishes genuine new requests from
retries of the same request — a requirement for many async APIs such as
the AWS Cloud Control API.
Implementation:
- `CommandRunner` gains an `idempotency_tokens: HashMap<String, String>`
field populated at startup (one UUID per resource in the manifest).
- `get_full_context` accepts an `idempotency_token: Option<&str>` and
injects two keys when a token is present:
- `idempotency_token` (unscoped, for direct use)
- `<resource_name>.idempotency_token` (scoped, for `this.` and downstream access)
- `this.idempotency_token` inside a resource's `.iql` file preprocesses
to `{{ <resource_name>.idempotency_token }}` via the existing
`preprocess_this_prefix` mechanism.
Documentation:
- `template-filters.md`: new "Special Variables" section documenting
`stack_name`, `stack_env`, `resource_name`, and `idempotency_token`
with usage examples and a tip contrasting it with `uuid()`.
- `resource-query-files.md`: new "Special Variables" section with a
reference table and an `idempotency_token` usage example.
https://claude.ai/code/session_01HAXNi38tB8nY9wiDnqVNWH
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 23248038 | Triggered | Generic High Entropy Secret | f74fd0a | src/core/config.rs | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
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.
Introduces
idempotency_token, a UUID v4 that is generated once per resource at session start and remains stable for the lifetime of the invocation. This allows mutation queries (INSERT/UPDATE) to carry a provider-side client token that distinguishes genuine new requests from retries of the same request — a requirement for many async APIs such as the AWS Cloud Control API.Implementation:
CommandRunnergains anidempotency_tokens: HashMap<String, String>field populated at startup (one UUID per resource in the manifest).get_full_contextaccepts anidempotency_token: Option<&str>and injects two keys when a token is present:idempotency_token(unscoped, for direct use)<resource_name>.idempotency_token(scoped, forthis.and downstream access)this.idempotency_tokeninside a resource's.iqlfile preprocessesto
{{ <resource_name>.idempotency_token }}via the existingpreprocess_this_prefixmechanism.Documentation:
template-filters.md: new "Special Variables" section documentingstack_name,stack_env,resource_name, andidempotency_tokenwith usage examples and a tip contrasting it withuuid().resource-query-files.md: new "Special Variables" section with a reference table and anidempotency_tokenusage example.https://claude.ai/code/session_01HAXNi38tB8nY9wiDnqVNWH