-
Notifications
You must be signed in to change notification settings - Fork 851
Lua plugin support for connection exempt list #12849
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
Adds Lua plugin bindings and documentation for managing the per-client connection limit exempt list via the new TS APIs introduced alongside proxy.config.http.per_client.connection.exempt_list (#12198).
Changes:
- Expose
ts.connection_limit_exempt_list_add/remove/clearin the Lua plugin misc API table. - Implement Lua-to-TS wrappers calling
TSConnectionLimitExemptListAdd/Remove/Clear. - Document the new Lua APIs in the Lua admin guide.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| plugins/lua/ts_lua_misc.cc | Adds Lua bindings for add/remove/clear of the connection limit exempt list. |
| doc/admin-guide/plugins/lua.en.rst | Documents the new Lua APIs with syntax, descriptions, and examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static int | ||
| ts_lua_connection_limit_exempt_list_add(lua_State *L) | ||
| { | ||
| size_t len; | ||
| const char *ip_ranges; | ||
|
|
||
| ip_ranges = luaL_checklstring(L, 1, &len); | ||
|
|
||
| if (ip_ranges && len > 0) { | ||
| TSReturnCode ret = TSConnectionLimitExemptListAdd(std::string_view(ip_ranges, len)); |
Copilot
AI
Feb 3, 2026
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.
These new Lua bindings add user-visible behavior but there doesn’t appear to be a gold test covering them. Consider adding a pluginTest/lua gold test that exercises add/remove/clear and verifies the per-client connection limit exempt behavior (e.g., max_connections_in throttles before add, then no throttling after adding 127.0.0.1/32, and throttling returns after remove/clear).
| **description**: Add IP ranges to the per-client connection limit exempt list. This function wraps the TSConnectionLimitExemptListAdd API. | ||
|
|
||
| The IP_RANGES parameter should be a string containing one or more IP address ranges in CIDR notation, separated by commas. Client connections from these IP ranges will be exempt from per-client connection limits. | ||
|
|
Copilot
AI
Feb 3, 2026
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.
The docs say IP_RANGES must be in CIDR notation, but the underlying parsing (swoc::IPRange) accepts a single IP address and dash ranges in addition to CIDR. Consider updating the description to match the supported formats (and note that whitespace around comma-separated entries is not trimmed, so ", " may fail).
|
|
||
| **description**: Remove IP ranges from the per-client connection limit exempt list. This function wraps the TSConnectionLimitExemptListRemove API. | ||
|
|
||
| The IP_RANGES parameter should be a string containing one or more IP address ranges in CIDR notation, separated by commas. |
Copilot
AI
Feb 3, 2026
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.
Same doc issue as add(): IP_RANGES is documented as CIDR-only, but the underlying API accepts single IPs and dash ranges too; also consider noting that whitespace around comma separators is not ignored.
| The IP_RANGES parameter should be a string containing one or more IP address ranges in CIDR notation, separated by commas. | |
| The IP_RANGES parameter should be a string containing one or more IP address specifications separated by commas. Each | |
| specification may be a CIDR range (for example, ``192.168.1.0/24``), a single IP address (for example, ``192.168.1.10``), | |
| or a dash-separated IP range (for example, ``192.168.1.10-192.168.1.20``). Whitespace around the commas is not ignored, | |
| so do not include spaces before or after commas. |
This is related to #12198
Supporting the new API in lua plugin