Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(product): Add 'product' commands for each Fastly product. #1362

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kpfleming
Copy link
Contributor

Adds 'enable', 'disable', and 'status' commands for each product previously supported by the 'products' command (which is now deprecated).

Also adds 'configure' commands for products which support configuration (DDoS Protection and Next-Gen WAF).

@kpfleming kpfleming added DO NOT MERGE YET dependencies Pull requests that update a dependency file labels Dec 17, 2024
Copy link
Contributor

@cee-dub cee-dub left a comment

Choose a reason for hiding this comment

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

Love the test mocking. Package names could be more idiomatic.

pkg/commands/product/bot_management/disable.go Outdated Show resolved Hide resolved
pkg/commands/product/bot_management/status.go Outdated Show resolved Hide resolved
pkg/commands/product/bot_management/status.go Outdated Show resolved Hide resolved
pkg/commands/product/bot_management/product_test.go Outdated Show resolved Hide resolved
pkg/commands/product/bot_management/disable.go Outdated Show resolved Hide resolved
Adds 'enable', 'disable', and 'status' commands for each product
previously supported by the 'products' command (which is now
deprecated).

Also adds 'configure' commands for products which support
configuration (DDoS Protection and Next-Gen WAF).
@kpfleming
Copy link
Contributor Author

@cee-dub If you're interested, this could use a second 'structural' review; much like go-fastly, this now has an internal/productcore package which uses generics to provide the base implementations for all of the commands in fastly product <name> .... It's complete for all products except NGWAF, which requires an extra enablement parameter, and then it will get extended to support the configuration commands too.

Copy link
Contributor

@cee-dub cee-dub left a comment

Choose a reason for hiding this comment

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

Nice use of generics to deal with consuming the different API types that are essentially the same.

go.mod Show resolved Hide resolved
pkg/commands/product/botmanagement/common.go Outdated Show resolved Hide resolved
internal/productcore/disable.go Show resolved Hide resolved
pkg/commands/product/botmanagement/common.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file DO NOT MERGE YET
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants