-
Notifications
You must be signed in to change notification settings - Fork 170
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
Openresty Update #1272
Openresty Update #1272
Conversation
Fix that updates base image to Openresty 1.19.3 version. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
**Deprecated:** Use [policies](./policies.md) instead. | ||
|
||
Specifies the name of the main Lua module that implements the API gateway logic. Custom modules can override the functionality of the default `apicast.lua` module. See [an example](../examples/custom-module) of how to use modules. | ||
|
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.
@eloycoto Will there be further text to review? If there is only the removal of text, then it LGTM 😄
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.
My job is to make you happy, so no changes in doc :-)
a005dcb
to
9c5a062
Compare
@@ -37,7 +37,7 @@ function _M.ref() | |||
|
|||
local _ = ngx.ctx -- load context | |||
|
|||
local ctx_ref = C.ngx_http_lua_ffi_get_ctx_ref(r) | |||
local ctx_ref = C.ngx_http_lua_ffi_get_ctx_ref(r, ffi.new("int[1]"), ffi.new("int[1]")) |
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.
What does this do?
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 C call definition changed, and now it needs to pass a integer.
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.
Why 1? Does it matter? Or we can just send anything?
Would be good to clarify with a comment.
@@ -54,7 +56,7 @@ local header_mt = { | |||
__tostring = function(t) | |||
local tmp = {} | |||
|
|||
for k,v in pairs(t) do | |||
for k,v in tablex_sort(t) do |
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.
Why do headers need to be sorted? Is it to pass some tests or is there some part of the code that expects them sorted?
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.
Just to pass the test, is the only way to have consistent data.
prefix = "" | ||
first = false | ||
end | ||
result = string.format("%s%s%s=%s",result, prefix, k, v) |
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.
Isn't it better to use concat
to avoid passing the tmp string to format
on every iteration?
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.
concat has issues with sort.
Load configuration module and APICAST_MODULE will be disabled due to the deprecation. From now on, policy_loader should be used. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
When using ssl_certificate phase, before the context was not populated to other phases, so the ctx.service was set by access phase, and path routing was not working at all. return on path routing enabled, and setting that on the access() phase. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Semaphores are not enabled on log_by_lua phases, but we need to run this action here. Thread is not enabled, so the timer is the only way to execute this function. FYI: Timer is a local request, this is why a TCP socket can be open. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
On ngx.encode_args, the encoding is not longer sorted because Luajit changed. This way always set the encode on the sorted way to make test easier to validate. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
This adds a new helper to validate that the response json body is correct but it's not the same at all. This validate that a key can be equal or match a regular expression. Example body: ``` {"a": 1, "b": 2} ``` Example validator: ``` {"key": "a", "value": 1} {"key": "b", "value": "\d+", "op", "regexp"} ``` Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Because of the Luajit update, and the sort issues, some test need to be changed to support dynamic information and not be flaky. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
APICAST_MODULE option is no longer supported, due to the new update, this feature is now deprecated and no longer supported. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Oauth2 is no longer required in the gateway, JWT and Openidconnect is the prefered way and users are aware of this deprecation since APICast 2.5 Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Because of the Luajit update, and the sort issues, some test need to be changed to support dynamic information and not be flaky. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
When setting headers, the order is important in case of duplication, using tablex that keep the order as it was set. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
Hi,
I bumped the Openresty Version to 1.9.3, the latest stable, prior we had almost this version, but with a few commits on top of that.
The most important change is related to how Luajit iterate over metatables, so the order is no longer the creation one; it's arbitrary, so the
ngx.decode
,cjon.decode
, pairs can a different result each time. Saying that almost all test failed because we tested the string.Example:
Regarding other changes:
Long PR, each commit is self-documented, so should be easy to get the context.