-
Notifications
You must be signed in to change notification settings - Fork 344
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: blocklist-source-range annotation #446
Conversation
Codecov Report
@@ Coverage Diff @@
## master #446 +/- ##
==========================================
+ Coverage 37.01% 37.04% +0.03%
==========================================
Files 47 47
Lines 3839 3841 +2
==========================================
+ Hits 1421 1423 +2
Misses 2233 2233
Partials 185 185
Continue to review full report at Codecov.
|
if am, ok := annotations[_corsAllowMethods]; ok { | ||
cors.Methods = am | ||
// NewCorsHandler creates a handler to convert annotations about | ||
// cors to APISIX cors plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// cors to APISIX cors plugin. | |
// CORS to APISIX CORS plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use small case to represent a plugin name.
pkg/types/apisix/v1/plugin_types.go
Outdated
// +k8s:deepcopy-gen=true | ||
type IPRestrictConfig struct { | ||
Whitelist []string `json:"whitelist,omitempty"` | ||
Blacklist []string `json:"blacklist,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blacklist []string `json:"blacklist,omitempty"` | |
Blocklist []string `json:"blacklist,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this name unless APISIX also change it.
pkg/types/apisix/v1/plugin_types.go
Outdated
// IPRestrictConfig is the rule config for ip-restriction plugin. | ||
// +k8s:deepcopy-gen=true | ||
type IPRestrictConfig struct { | ||
Whitelist []string `json:"whitelist,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change all Whitelist
to Allowlist
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for consistency as terms in APISIX are black
, white
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if APISIX will be modified, but these are two projects. I think it makes sense to modify it now. In order to avoid subsequent modifications caused by break changing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
@tao12345666333 @gxthrj Changed. |
DO NOT MERGE this PR until #442 is merged.
Please answer these questions before submitting a pull request
Why submit this pull request?
Bugfix
New feature provided
Improve performance
Backport patches
Related issues
#445
Bugfix
Description
How to fix?
New feature or improvement
Backport patches
Why need to backport?
Source branch
Related commits and pull requests
Target branch