Found during Run 2 smoke testing (see docs/ga-test-report.md).
Problem
a7 global-rule create --id smoke-gr-X --plugins-json '{"cors":...}' -g default
returns a resource at id = "cors" (the plugin name), ignoring the user-supplied --id smoke-gr-X. API7 EE enforces id == plugin name for global rules.
The CLI accepts a flag it will silently override. Run 1 noted this as 'minor — value is ignored by EE'. Treat as a real CLI bug.
Fix options
- Drop
--id from pkg/cmd/global-rule/create/create.go entirely; document that id is derived from the plugin key.
- Warn / error when
--id is passed and doesn't match the single plugin key in --plugins-json.
Lean toward option 1 (less surface area, less surprise).
Tests
TestGlobalRule_CreateWithoutID: create with --plugins-json '{"cors":...}', assert returned id == "cors"
- If option 2 chosen:
TestGlobalRule_CreateRejectsMismatchedID
Part of #22.
Found during Run 2 smoke testing (see docs/ga-test-report.md).
Problem
returns a resource at
id = "cors"(the plugin name), ignoring the user-supplied--id smoke-gr-X. API7 EE enforces id == plugin name for global rules.The CLI accepts a flag it will silently override. Run 1 noted this as 'minor — value is ignored by EE'. Treat as a real CLI bug.
Fix options
--idfrompkg/cmd/global-rule/create/create.goentirely; document that id is derived from the plugin key.--idis passed and doesn't match the single plugin key in--plugins-json.Lean toward option 1 (less surface area, less surprise).
Tests
TestGlobalRule_CreateWithoutID: create with--plugins-json '{"cors":...}', assert returned id == "cors"TestGlobalRule_CreateRejectsMismatchedIDPart of #22.