From b92f022875733de02f3681fec66bbfbb88117a4c Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Thu, 7 Nov 2024 13:03:24 -0500 Subject: [PATCH] breaking(products): Remove support for NGWAF product. (#1338) The support added for the NGWAF product in version 10.15.0 did not work, and is being removed so that it can be redesigned. Since the feature was non-operational, no users of the CLI could have relied on it, so the major version number is not being incremented in spite of the breaking nature of the change. --- pkg/commands/products/products_test.go | 8 ++------ pkg/commands/products/root.go | 11 ----------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/pkg/commands/products/products_test.go b/pkg/commands/products/products_test.go index a39d1fb52..1e259a4df 100644 --- a/pkg/commands/products/products_test.go +++ b/pkg/commands/products/products_test.go @@ -35,7 +35,6 @@ brotli_compression false domain_inspector false fanout false image_optimizer false -ngwaf false origin_inspector false websockets false `, @@ -54,7 +53,6 @@ brotli_compression true domain_inspector true fanout true image_optimizer true -ngwaf true origin_inspector true websockets true `, @@ -62,12 +60,12 @@ websockets true { Name: "validate flag parsing error for enabling product", Args: "--service-id 123 --enable foo", - WantError: "error parsing arguments: enum value must be one of bot_management,brotli_compression,domain_inspector,fanout,image_optimizer,ngwaf,origin_inspector,websockets, got 'foo'", + WantError: "error parsing arguments: enum value must be one of bot_management,brotli_compression,domain_inspector,fanout,image_optimizer,origin_inspector,websockets, got 'foo'", }, { Name: "validate flag parsing error for disabling product", Args: "--service-id 123 --disable foo", - WantError: "error parsing arguments: enum value must be one of bot_management,brotli_compression,domain_inspector,fanout,image_optimizer,ngwaf,origin_inspector,websockets, got 'foo'", + WantError: "error parsing arguments: enum value must be one of bot_management,brotli_compression,domain_inspector,fanout,image_optimizer,origin_inspector,websockets, got 'foo'", }, { Name: "validate success for enabling product", @@ -108,7 +106,6 @@ websockets true "domain_inspector": false, "fanout": false, "image_optimizer": false, - "ngwaf": false, "origin_inspector": false, "websockets": false }`, @@ -127,7 +124,6 @@ websockets true "domain_inspector": true, "fanout": true, "image_optimizer": true, - "ngwaf": true, "origin_inspector": true, "websockets": true }`, diff --git a/pkg/commands/products/root.go b/pkg/commands/products/root.go index e08424bf8..b43655061 100644 --- a/pkg/commands/products/root.go +++ b/pkg/commands/products/root.go @@ -31,7 +31,6 @@ var ProductEnablementOptions = []string{ "domain_inspector", "fanout", "image_optimizer", - "ngwaf", "origin_inspector", "websockets", } @@ -143,12 +142,6 @@ func (c *RootCommand) Exec(_ io.Reader, out io.Writer) error { }); err == nil { ps.ImageOptimizer = true } - if _, err = ac.GetProduct(&fastly.ProductEnablementInput{ - ProductID: fastly.ProductNGWAF, - ServiceID: serviceID, - }); err == nil { - ps.NGWAF = true - } if _, err = ac.GetProduct(&fastly.ProductEnablementInput{ ProductID: fastly.ProductOriginInspector, ServiceID: serviceID, @@ -173,7 +166,6 @@ func (c *RootCommand) Exec(_ io.Reader, out io.Writer) error { t.AddLine(fastly.ProductDomainInspector, ps.DomainInspector) t.AddLine(fastly.ProductFanout, ps.Fanout) t.AddLine(fastly.ProductImageOptimizer, ps.ImageOptimizer) - t.AddLine(fastly.ProductNGWAF, ps.NGWAF) t.AddLine(fastly.ProductOriginInspector, ps.OriginInspector) t.AddLine(fastly.ProductWebSockets, ps.WebSockets) t.Print() @@ -192,8 +184,6 @@ func identifyProduct(product string) fastly.Product { return fastly.ProductFanout case "image_optimizer": return fastly.ProductImageOptimizer - case "ngwaf": - return fastly.ProductNGWAF case "origin_inspector": return fastly.ProductOriginInspector case "websockets": @@ -210,7 +200,6 @@ type ProductStatus struct { DomainInspector bool `json:"domain_inspector"` Fanout bool `json:"fanout"` ImageOptimizer bool `json:"image_optimizer"` - NGWAF bool `json:"ngwaf"` OriginInspector bool `json:"origin_inspector"` WebSockets bool `json:"websockets"` }