Repository navigation
[CDTOOL-1766] Add ContentGuard bot-management commands - #1922
Conversation
b04a7db to
1a03f4e
Compare
bot-management commandsbot-management commands
philippschulte
left a comment
There was a problem hiding this comment.
Nice work on your first Fastly CLI contribution! 🎉
I didn't find any blocking issues with the implementation.
Great first contribution!
|
Marking as |
rcaril
left a comment
There was a problem hiding this comment.
Looks great!
A few items around validation below.
|
Instead of adding validation for length in the Exec functions, I decided to add a c.CmdClause.
Flag("description", "Description of the workspace").
Action(c.description.Set).
Action(validate.LengthBetween(0, 1000)).
StringVar(&c.description.Value)I also added non-empty checks for the identifier flags (e.g. I changed the types of some struct fields from |
0deb05e to
cfbf33b
Compare
cfbf33b to
b6245bf
Compare
20ea90f to
abf3523
Compare
rcaril
left a comment
There was a problem hiding this comment.
Thanks for the updates! This should be ready to merge pending the updates around the command design.
b34c35a to
286c260
Compare
|
Updated with the new
|
007f42b to
ae1b4cf
Compare
rcaril
left a comment
There was a problem hiding this comment.
Two small items above, otherwise looks good!
ed7e912 to
daeb90d
Compare
With the removal of RequestRecorder, some of the test names were misleading, such as "--service-id filters by service", which can't actually be asserted since the response is entirely mocked and the request isn't checked. These have been changed to describe the actual behavior of the test (generally just parsing arguments and rendering the response).
Adds checks for workspace name and description length based on the API
spec. Rather than doing this ad-hoc in the Exec function, I added a
reusable `validate` package that provides checks to be added to any
argument through the `Action` function.
Right now this only covers length checks, but future checks could
include (based on ad-hoc checks in the repo):
- regex pattern or "not contains".
- Used by the dns commands.
- Format/parse checks, like ngwaf thresholds
- I'd prefer to parse into a new type though, which is awkward for
Action (but still possible, see OptionalString).
- Cross-flag rules like mutual exclusion, exactly one of, X requires Y.
- used in logging create commands, s3 and kinesis, TLS commands,
`bot-management workspace update`
- Can't go in an `Action`, but maybe on `CmdClause.Validate`
Removes embedded fields pattern, adds tests for empty id args, fixes error wording to mention bytes, fixes duplicate word in comment
daeb90d to
1bd12bd
Compare
Change summary
Adds commands to configure the new ContentGuard Bot Management feature: https://www.fastly.com/documentation/reference/api/bot-management/
All Submissions:
New Feature Submissions:
Changes to Core Features:
User Impact
Adds commands to configure the new ContentGuard Bot Management feature: https://www.fastly.com/documentation/reference/api/bot-management/
Are there any considerations that need to be addressed for release?