Skip to content

Commit b3942e3

Browse files
Yhoornemanclaude
andcommitted
fix: init-envrc pre-fills DD_API_KEY/DD_APP_KEY from secret/audit
The init-envrc template now writes active exports fetching from secret/audit/datadog-api-key and secret/audit/datadog-application-key (field=value), instead of commented placeholder examples. The follow-up hint is source-agnostic (no Vault mention) since a user may source credentials differently in the .envrc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 01e47bc commit b3942e3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ rather than the tool executing shell itself):
6666

6767
```sh
6868
datadog-slo-overrides init-envrc # writes ~/.config/datadog-slo-overrides/.envrc
69-
# edit it to `export DD_API_KEY=...` / `export DD_APP_KEY=...` (e.g. from Vault), then:
69+
# it pre-fills DD_API_KEY / DD_APP_KEY exports; review and adjust the source if needed, then:
7070
direnv allow ~/.config/datadog-slo-overrides
7171
```
7272

src/datadog_slo_overrides_cli/datadog_slo_overrides_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,9 @@ def envrc_template() -> str:
963963
'# Read only as a fallback: an explicit --api-key/--app-key or an already-set\n'
964964
'# DD_API_KEY / DD_APP_KEY in your shell always take precedence.\n'
965965
'\n'
966-
'# Example — fetch from Vault (needs a valid token; run `vault login` first):\n'
967-
'# export DD_API_KEY="$(vault kv get -field=value secret/datadog/api-key)"\n'
968-
'# export DD_APP_KEY="$(vault kv get -field=value secret/datadog/app-key)"\n'
966+
'# Fetch from Vault (needs a valid token; run `vault login` first):\n'
967+
'export DD_API_KEY="$(vault kv get -field=value secret/audit/datadog-api-key)"\n'
968+
'export DD_APP_KEY="$(vault kv get -field=value secret/audit/datadog-application-key)"\n'
969969
)
970970

971971

@@ -1496,7 +1496,7 @@ def init_envrc(
14961496
directory.mkdir(parents=True, exist_ok=True)
14971497
envrc.write_text(envrc_template())
14981498
typer.echo(f'Wrote {envrc}')
1499-
typer.echo(f'Next: edit it to export DD_API_KEY / DD_APP_KEY, then run: direnv allow {directory}')
1499+
typer.echo(f'Next: review it and adjust the credential source if needed, then run: direnv allow {directory}')
15001500

15011501

15021502
def main() -> None:

0 commit comments

Comments
 (0)