Repository navigation
feat(secrets-manager): add environments commands and structured CLI errors - #474
Open
victorvhs017 wants to merge 3 commits into
Open
victorvhs017 wants to merge 3 commits into
victorvhs017 wants to merge 3 commits into
Conversation
- Introduced new commands for managing project environments: `create`, `update`, `delete`, and `get`. - Enhanced error handling for environment-related operations, including checks for existing and pending environments. - Updated `CLI.md` to document new environment error codes and command usage. - Added unit tests to ensure functionality and error handling for the new commands. - Integrated environment management into the existing secrets manager command structure.
|
💬 Discussion in Slack: #pr-review-cli-474-feat-secrets-manager-add-environments-commands-and-structured Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
Contributor
[Critical impact] The PR appears safe to merge; no new blocking issues were found.
|
- Added a new error code `invalid_flag_value` for cases where command flags are provided with invalid values, such as empty names. - Updated `CLI.md` to document the new error code and its implications for users. - Improved the output of environment deletion commands to clarify the timing of permanent deletions. - Enhanced unit tests to validate the new error handling and output behavior for environment commands, ensuring robustness in CLI interactions.
- Updated the `TestEnvironmentsDeleteReportsWhatHappened` test to set the local time zone to UTC, ensuring consistent date formatting across different environments. - Added cleanup logic to restore the original local time zone after the test execution, maintaining test isolation and reliability.
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.
Description 📣
Secrets Management projects could be listed and created from the CLI, but there was no way to manage environments (create QA/staging, rename, soft-delete, hard-delete pending slugs) without the dashboard or raw API calls.
This branch adds
infisical secrets-manager environments(aliassm) withget,create,update, anddelete, wired to the existing/v1/projects/:id/environmentsAPI. Commands resolve the project from--projectId,INFISICAL_PROJECT_ID, or.infisical.yaml(except delete, which always requires explicit--projectId). They reject service tokens on these routes (machine identity or login session), surface pending deletion slugs, and use structuredCLIErrorresponses with suggested next steps for agents and scripts.Type ✨
Tests 🛠️
--projectIdeven when the directory is linked.-yin a TTY prompts for the slug; with-o jsonand no TTY, expect a structuredconfirmation_requirederror with a suggested--yescommand.INFISICAL_TOKENset to a service token, runenvironments getand confirm it is ignored or rejected per flag usage (same pattern assm projects).