shukitchan opened a new pull request, #12650: URL: https://github.com/apache/trafficserver/pull/12650
This pull request adds support for getting and setting a "verified client address" in the Traffic Server Lua plugin API, allowing plugins to reliably determine and set the true client IP address (especially useful when behind proxies or load balancers). It includes both implementation and documentation, as well as thorough automated tests for IPv4, IPv6, and error handling. **Lua Plugin API Enhancements:** * Added `ts.client_request.client_addr.get_verified_addr` and `ts.client_request.client_addr.set_verified_addr` functions to the Lua plugin API, enabling plugins to retrieve or set a verified client IP address for the current transaction. These functions handle both IPv4 and IPv6 addresses and validate input. [[1]](diffhunk://#diff-2ba4d71a58c393bc7b54367d933fcb20e045fa7ac1dd8376fbfee8461e6813dfR69-R70) [[2]](diffhunk://#diff-2ba4d71a58c393bc7b54367d933fcb20e045fa7ac1dd8376fbfee8461e6813dfR129-R134) [[3]](diffhunk://#diff-2ba4d71a58c393bc7b54367d933fcb20e045fa7ac1dd8376fbfee8461e6813dfR1150-R1224) **Documentation Updates:** * Documented the new Lua API functions in `doc/admin-guide/plugins/lua.en.rst`, including syntax, usage context, examples, and important notes for plugin developers. **Automated Testing:** * Added new gold test `lua_verified_addr.test.py` and supporting Lua script `verified_addr.lua` to verify correct behavior for setting/getting verified addresses, handling both IPv4 and IPv6, and proper error handling for invalid input. [[1]](diffhunk://#diff-6c9a55dc8db569f580e9b9ab9d243ea1a7877fa81da37178ba751801fce65aa6R1-R102) [[2]](diffhunk://#diff-1eb1eb15ebafe93f592b716b9186f7f2211196ffd045a9b69869b261f2b2899bR1-R87) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
