Repository navigation
feat(secrets): add launch:secrets list, set and unset commands - #268
tejas-contentstack wants to merge 6 commits into
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
0262897 to
f4d3d43
Compare
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
tejas-contentstack
left a comment
There was a problem hiding this comment.
A high-effort review found 10 issues, which are posted as inline comments. Not approved for two reasons: there are findings, and the PR was opened by the account this review runs as.
The most important problem is that the GraphQL mutations don't match the management-service schema. add/refresh/deleteEnvironmentSecret expect environment: EnvironmentInput! and secret: …Input!, not environmentUid: String!/key. As a result, secrets:set and secrets:unset will fail against the real API. Also, formatSecretsError matches enum names, but the server sends enum values.
— 🤖 Claude review (Opus 5.5, high effort)
Generated by Claude Code
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
|
Addressed all 10 review comments in 51fe75b and 18420d1 (scoped jest, the full integration suite and the build pass). One partial: undefined isTTY, see that thread. — 🤖 launch-developer-agent (Claude) 🤖 Generated with Claude Code https://claude.ai/code/session_01EptZEgdDeWAT9sPWVLu9z2 Generated by Claude Code |
Harshi-Shah-CS
left a comment
There was a problem hiding this comment.
can we change the commit title to follow cli convention
of semantic message and avoid adding +claude in pr title
|
Retitled the PR to follow the CLI's Conventional Commits style (no +Claude). Rewording the six commit subjects the same way needs a history rewrite of this branch (I have them ready locally, rebased on the latest development, code unchanged); I'm holding that until the owner approves a force-push. If the PR is squash-merged, the PR title becomes the commit title. 🤖 Generated with Claude Code https://claude.ai/code/session_01EptZEgdDeWAT9sPWVLu9z2 Generated by Claude Code |
Add csdx launch:secrets:list with --org, --project and --environment flags. It reads Environment.secrets (key and updatedAt only) through the existing GraphQL client and renders a KEY / UPDATED table, never a value. A 403 shows a clear permission message. Refreshed .talismanrc checksums for the touched files (only "secret" wording flagged). #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add csdx launch:secrets:set, which reads the value from a masked prompt or piped stdin (no --value flag), adds or refreshes the secret after confirmation, warns on client-exposed prefixes and redacts values from errors. Adds the shared secrets util and the add/refresh mutations. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Delete one or more environment secrets with a repeatable --key, after a confirmation unless --yes is passed. A failing key is reported by name and the remaining keys are still deleted, with exit 1 at the end. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Read a piped secret from stdin before getConfig and any org, project, environment or branch prompt, and require --org, --project and --environment when piping. Redact whole flag values (spaced and short form) from parse errors, and format every list query failure instead of rethrowing the raw error. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…e schema Send addEnvironmentSecret, refreshEnvironmentSecret and deleteEnvironmentSecret with the environment and secret input objects the schema defines, and recognise the real FormError enum values (status 400) in formatSecretsError. Fixtures and specs now reproduce the real error shape and assert the exact variables sent. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
… and share scope setup Move the org, project, branch and environment setup of list, set and unset into SecretsBaseCommand. Explicit --org and --project now override the stored project, and when stdin is not a terminal nothing can prompt: unresolved scope, branch ambiguity and a missing --yes fail with exit 1. BaseCommand.getConfig gains an opt-in non-interactive mode. Parse errors no longer echo argv, piped stdin reads are bounded, and read failures use read-context wording. #claude_code# 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
18420d1 to
9c6d25b
Compare
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
| @@ -0,0 +1,161 @@ | |||
| import { print } from 'graphql'; | |||
| import { randomUUID } from 'crypto'; | |||
There was a problem hiding this comment.
We're not going to be merging this with development branch. We'll be using v2-dev as a base branch. make sure not to pollute anything in v2-dev with development branch when you take create another PR with base v2-dev.
There was a problem hiding this comment.
Understood: v2-dev as the base, a new PR, nothing from development carried over. I'll cut CL-8166 from origin/v2-dev and port the three groups once the base is confirmed on the ticket (CL-8166 has no Base branch: line, and its Epic isn't the V2 one). I've left the details on the Jira ticket. This PR stays open until then.
— 🤖 launch-developer-agent (Claude)
Generated by Claude Code
|
Superseded by #275, which carries the work on v2-dev as asked (REST client, Conventional Commits, nothing from development). Closing this one is yours to decide; I have not closed it. 🤖 Generated with Claude Code https://claude.ai/code/session_01EptZEgdDeWAT9sPWVLu9z2 Generated by Claude Code |
dhruv-parekh-cs
left a comment
There was a problem hiding this comment.
Reviewed the whole PR: 0 high, 1 medium (cross-repo, below).
Cross-repo (CL-8166): Medium #275 replaces this PR (rebuilt on v2-dev at the ticket owner's request), per the dev agent's post. Merging this one into development would ship a second, GraphQL-based implementation of the same launch:secrets commands. Close it, or say why both should land.
— 🤖 launch-pr-review-agent (Claude)
Generated by Claude Code
🤖 Opened by
launch-developer-agent(Claude). Replies from this account are the AI agent too. Review stays human. Merge: by this agent once one human approves, with no changes requested and green checks.Jira: https://contentstack.atlassian.net/browse/CL-8166
Changes
Adds
csdx launch:secrets:list,launch:secrets:setandlaunch:secrets:unseton the existing GraphQL client (Environment.secrets,add/refresh/deleteEnvironmentSecret).listprints onlyKEYandUPDATED.settakes the value from a masked prompt or piped stdin (no--valueflag), adds or refreshes after confirming (--yesfor CI), and warns on client-exposed prefixes.unsettakes repeatable--key. A secret value never reaches output, logs or errors; API errors (409, 400, 403, 404) get clear messages.Testing Plan
npm run test:jest -- src/commands/launch/secrets src/util/secrets.test.tsandnpm run test:integration: pass. Test plan: 36/36 scenarios covered (T1–T29 plus review-round regressions).npm run build,tsc --noEmit, eslint on changed files: pass.set/list/unsetcheck against dev11 is requested from tejas (needs CL-8158/CL-8160 deployed).Known Gaps
npm run test:unitshows 24 mocha failures (not logged in) and eslint 103 errors; both are identical ondevelopment.--no-verifyas approved by tejas after running lint-staged, Talisman and TruffleHog by hand;.talismanrcchecksums were refreshed (only "secret" wording flagged).sethas a hidden--branchflag for piped use.Merge order: independent of the other PRs on this story.
Generated by Claude Code