-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: update dependencies #12862
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
chore: update dependencies #12862
Changes from all commits
181a376
18e1645
6bafb66
5c3e0dc
a4fa22f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,7 @@ end | |
|
|
||
| function _M.access(conf, ctx) | ||
| local current_uri = ctx.var.uri | ||
| local session_obj_read, session_present = session.open() | ||
| local session_obj, sess_err, session_present = session.open() | ||
| -- step 1: check whether hits the callback | ||
| local m, err = ngx.re.match(conf.callback_url, ".+//[^/]+(/.*)", "jo") | ||
| if err or not m then | ||
|
|
@@ -103,11 +103,11 @@ function _M.access(conf, ctx) | |
| local real_callback_url = m[1] | ||
| if current_uri == real_callback_url then | ||
| if not session_present then | ||
| err = "no session found" | ||
| err = "no session found: " .. sess_err | ||
| core.log.error(err) | ||
| return 503 | ||
| end | ||
| local state_in_session = session_obj_read.data.state | ||
| local state_in_session = session_obj:get("state") | ||
| if not state_in_session then | ||
| err = "no state found in session" | ||
| core.log.error(err) | ||
|
|
@@ -135,7 +135,7 @@ function _M.access(conf, ctx) | |
| core.log.error(err) | ||
| return 503 | ||
| end | ||
| local original_url = session_obj_read.data.original_uri | ||
| local original_url = session_obj:get("original_uri") | ||
| if not original_url then | ||
| err = "no original_url found in session" | ||
| core.log.error(err) | ||
|
|
@@ -144,20 +144,20 @@ function _M.access(conf, ctx) | |
| local session_obj_write = session.new { | ||
| cookie = {lifetime = lifetime} | ||
| } | ||
| session_obj_write:start() | ||
| session_obj_write.data.access_token = access_token | ||
| session_obj_write:open() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| session_obj_write:set("access_token", access_token) | ||
| session_obj_write:save() | ||
| core.response.set_header("Location", original_url) | ||
| return 302 | ||
| end | ||
|
|
||
| -- step 2: check whether session exists | ||
| if not (session_present and session_obj_read.data.access_token) then | ||
| if not (session_present and session_obj:get("access_token")) then | ||
| -- session not exists, redirect to login page | ||
| local state = rand(0x7fffffff) | ||
| local session_obj_write = session.start() | ||
| session_obj_write.data.original_uri = current_uri | ||
| session_obj_write.data.state = state | ||
| session_obj_write:set("original_uri", current_uri) | ||
| session_obj_write:set("state", state) | ||
| session_obj_write:save() | ||
|
|
||
| local redirect_url = conf.endpoint_addr .. "/login/oauth/authorize?" .. ngx.encode_args({ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,8 +171,8 @@ function _M.log(conf, ctx) | |
| if err then | ||
| return nil, "failed to create the rocketmq producer: " .. err | ||
| end | ||
| core.log.info("rocketmq nameserver_list[1] port ", | ||
| prod.client.nameservers[1].port) | ||
| core.log.info("rocketmq nameserver_list[1]: ", | ||
| prod.client.nameservers[1]) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| -- Generate a function to be executed by the batch processor | ||
| local func = function(entries, batch_max_size) | ||
| local data, err | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,8 +189,8 @@ hello world | |
| local httpc = http.new() | ||
| local res, err = httpc:request_uri(uri, {method = "GET"}) | ||
|
|
||
| -- Extract cookie which is not authenticated | ||
| local cookie_str = concatenate_cookies(res.headers['Set-Cookie']) | ||
| -- set a random cookie | ||
| local cookie_str = "foobaar" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the previous session library used by lua-resty-openidc would set |
||
|
|
||
| -- Make the call to protected route with cookie | ||
| local function firstRequest() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,15 +141,13 @@ passed | |
| return | ||
| end | ||
|
|
||
| local cookie_str = concatenate_cookies(res.headers['Set-Cookie']) | ||
| local parts = {} | ||
| for part in string.gmatch(cookie_str, "[^|]+") do | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cookies are no longer |
||
| table.insert(parts, part) | ||
| end | ||
| local target_number = tonumber(parts[2], 10) - 86400 | ||
| -- ngx.say(target_number, current_time) | ||
| if target_number >= current_time then | ||
| local cookies = res.headers['Set-Cookie'] | ||
| -- lua-resty-session v4 changed cookie format/handling. | ||
| -- We verify that a cookie is returned, indicating a session was created. | ||
| if cookies then | ||
| ngx.say("passed") | ||
| else | ||
| ngx.say("failed: no Set-Cookie header found") | ||
| end | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -557,7 +557,7 @@ passed | |
| --- request | ||
| GET /echo?args=%40%23%24%25%5E%26 | ||
| --- response_body chomp | ||
| args=@#$%^& | ||
| args=@%23$%25%5E& | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change due to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In other words, the three characters |
||
|
|
||
|
|
||
|
|
||
|
|
||
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 response format has changed in the new version