Skip to content

feat(alb-waf): Onboard WAF managed rule set - #1534

Open
Fyusel wants to merge 1 commit into
mainfrom
onboard-waf-managed-rule-set
Open

feat(alb-waf): Onboard WAF managed rule set#1534
Fyusel wants to merge 1 commit into
mainfrom
onboard-waf-managed-rule-set

Conversation

@Fyusel

@Fyusel Fyusel commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

STACKITCLI-442

Description

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@Fyusel
Fyusel requested a review from a team as a code owner August 14, 2026 09:28
STACKITCLI-442

Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
@Fyusel
Fyusel force-pushed the onboard-waf-managed-rule-set branch from 87f28e9 to c506935 Compare August 14, 2026 09:28
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 8 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/create 51.22% (+51.22%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/delete 27.59% (+27.59%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/describe 73.21% (+73.21%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/list 77.78% (+77.78%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/update 52.54% (+52.54%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/config/set 91.10% (+0.19%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset 35.07% (-0.04%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config 70.32% (+0.11%) 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/albwaf/client 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/pkg/utils 52.94% (+2.06%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/alb-waf.go 0.00% (ø) 4 (+4) 0 4 (+4)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/create/create.go 51.22% (+51.22%) 41 (+41) 21 (+21) 20 (+20) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/delete/delete.go 27.59% (+27.59%) 29 (+29) 8 (+8) 21 (+21) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/describe/describe.go 73.21% (+73.21%) 56 (+56) 41 (+41) 15 (+15) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/list/list.go 77.78% (+77.78%) 63 (+63) 49 (+49) 14 (+14) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/managed-rule-set.go 0.00% (ø) 8 (+8) 0 8 (+8)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/update/update.go 52.54% (+52.54%) 59 (+59) 31 (+31) 28 (+28) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/beta.go 0.00% (ø) 11 (+1) 0 11 (+1)
github.com/stackitcloud/stackit-cli/internal/cmd/config/set/set.go 91.10% (+0.19%) 146 (+3) 133 (+3) 13 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go 35.07% (-0.04%) 134 (+3) 47 (+1) 87 (+2) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go 91.04% (+0.14%) 67 (+1) 61 (+1) 6 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/albwaf/client/client.go 0.00% (ø) 1 (+1) 0 1 (+1)
github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings.go 55.32% (+5.32%) 47 (+5) 26 (+5) 21 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/alb-waf/managed-rule-set/update/update_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/utils/strings_test.go

}

func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) {
globalFlags := globalflags.Parse(p, cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
globalFlags := globalflags.Parse(p, cmd)
globalFlags := globalflags.Parse(p, cmd)
if globalFlags.ProjectId == "" {
return nil, &errors.ProjectIdError{}
}

}

func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) {
globalFlags := globalflags.Parse(p, cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
globalFlags := globalflags.Parse(p, cmd)
globalFlags := globalflags.Parse(p, cmd)
if globalFlags.ProjectId == "" {
return nil, &errors.ProjectIdError{}
}

}

func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel, error) {
globalFlags := globalflags.Parse(p, cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
globalFlags := globalflags.Parse(p, cmd)
globalFlags := globalflags.Parse(p, cmd)
if globalFlags.ProjectId == "" {
return nil, &errors.ProjectIdError{}
}

if response.NextPageId != nil {
nextPageID = *response.NextPageId
}
received += want

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
received += want
received += len(response.Items)

}

func fetchManagedRuleSets(ctx context.Context, model *inputModel, apiClient *albwaf.APIClient) ([]albwaf.GetLimitedManagedRuleSetResponse, error) {
var nextPageID string

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks pagination AIP compliant, we could add a comment to replace this with the utils function we want to do in STACKITSDK-525

}

func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inputModel, error) {
globalFlags := globalflags.Parse(p, cmd)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
globalFlags := globalflags.Parse(p, cmd)
globalFlags := globalflags.Parse(p, cmd)
if globalFlags.ProjectId == "" {
return nil, &errors.ProjectIdError{}
}

content = append(content, table)

if resp.Groups != nil && len(*resp.Groups) > 0 {
for _, groupId := range utils.SortedKeys(*resp.Groups) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants