From d725a0d2b5556bb48a7ff834fc837d93d04fa8b9 Mon Sep 17 00:00:00 2001 From: Richard Carillo Date: Tue, 9 Dec 2025 11:48:00 -0500 Subject: [PATCH 1/3] added ErrInvalidVerboseJSONCombo check to create and update commands --- pkg/commands/ngwaf/workspace/redaction/create.go | 5 +++++ pkg/commands/ngwaf/workspace/redaction/update.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/commands/ngwaf/workspace/redaction/create.go b/pkg/commands/ngwaf/workspace/redaction/create.go index 9c2b44bb1..b7aaf90ad 100644 --- a/pkg/commands/ngwaf/workspace/redaction/create.go +++ b/pkg/commands/ngwaf/workspace/redaction/create.go @@ -9,6 +9,7 @@ import ( "github.com/fastly/go-fastly/v12/fastly/ngwaf/v1/workspaces/redactions" "github.com/fastly/cli/pkg/argparser" + fsterr "github.com/fastly/cli/pkg/errors" "github.com/fastly/cli/pkg/global" "github.com/fastly/cli/pkg/text" ) @@ -57,6 +58,10 @@ func (c *CreateCommand) Exec(_ io.Reader, out io.Writer) error { return err } + if c.Globals.Verbose() && c.JSONOutput.Enabled { + return fsterr.ErrInvalidVerboseJSONCombo + } + var err error input := &redactions.CreateInput{ Field: &c.field, diff --git a/pkg/commands/ngwaf/workspace/redaction/update.go b/pkg/commands/ngwaf/workspace/redaction/update.go index 9afa54e7b..390e34d03 100644 --- a/pkg/commands/ngwaf/workspace/redaction/update.go +++ b/pkg/commands/ngwaf/workspace/redaction/update.go @@ -9,6 +9,7 @@ import ( "github.com/fastly/go-fastly/v12/fastly/ngwaf/v1/workspaces/redactions" "github.com/fastly/cli/pkg/argparser" + fsterr "github.com/fastly/cli/pkg/errors" "github.com/fastly/cli/pkg/global" "github.com/fastly/cli/pkg/text" ) @@ -61,6 +62,10 @@ func (c *UpdateCommand) Exec(_ io.Reader, out io.Writer) error { return err } + if c.Globals.Verbose() && c.JSONOutput.Enabled { + return fsterr.ErrInvalidVerboseJSONCombo + } + var err error input := &redactions.UpdateInput{ RedactionID: &c.redactionID, From 0e3b6edb268bf0e6325ee494a0972f8c93858615 Mon Sep 17 00:00:00 2001 From: Richard Carillo Date: Tue, 9 Dec 2025 11:53:05 -0500 Subject: [PATCH 2/3] vitualpatch check --- pkg/commands/ngwaf/workspace/virtualpatch/update.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/commands/ngwaf/workspace/virtualpatch/update.go b/pkg/commands/ngwaf/workspace/virtualpatch/update.go index 2a4f2191c..8270b95c5 100644 --- a/pkg/commands/ngwaf/workspace/virtualpatch/update.go +++ b/pkg/commands/ngwaf/workspace/virtualpatch/update.go @@ -10,6 +10,7 @@ import ( "github.com/fastly/go-fastly/v12/fastly/ngwaf/v1/workspaces/virtualpatches" "github.com/fastly/cli/pkg/argparser" + fsterr "github.com/fastly/cli/pkg/errors" "github.com/fastly/cli/pkg/global" "github.com/fastly/cli/pkg/text" ) @@ -56,6 +57,10 @@ func NewUpdateCommand(parent argparser.Registerer, g *global.Data) *UpdateComman // Exec invokes the application logic for the command. func (c *UpdateCommand) Exec(_ io.Reader, out io.Writer) error { + if c.Globals.Verbose() && c.JSONOutput.Enabled { + return fsterr.ErrInvalidVerboseJSONCombo + } + var err error input := &virtualpatches.UpdateInput{ VirtualPatchID: &c.virtualpatchID, From a817a5de3fbf6b661a22d16b05e16b030e2b87e7 Mon Sep 17 00:00:00 2001 From: Richard Carillo Date: Tue, 9 Dec 2025 12:01:28 -0500 Subject: [PATCH 3/3] changelog update --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7fea799..8ac3312d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - feat(commands/ngwaf/customsignals): add support for CRUD operations for NGWAF Custom Signals ([#1592](https://github.com/fastly/cli/pull/1592)) ### Bug fixes: +- fix(commands/ngwaf/virtualpatch): ensured a check was in place for the 'update' command that disallowed the --json and --verbose flag to be ran at the same time. ([#1596](https://github.com/fastly/cli/pull/1596)) +- fix(commands/ngwaf/redaction): ensured a check was in place for the 'create' and 'update' commands that disallowed the --json and --verbose flag to be ran at the same time. ([#1596](https://github.com/fastly/cli/pull/1596)) ### Dependencies: - build(deps): `golang.org/x/crypto` from 0.43.0 to 0.45.0 ([#1584](https://github.com/fastly/cli/pull/1584))