Skip to content

Commit

Permalink
fix(clustering): session renamed fields (#10354)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuele Illuminati <[email protected]>
  • Loading branch information
mashapedeployment and samugi authored Feb 23, 2023
1 parent 2e08e60 commit 6cbc7d9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@

- Fix an issue where control plane does not downgrade config for `aws_lambda` and `zipkin` for older version of data planes.
[#10346](https://github.com/Kong/kong/pull/10346)
- Fix an issue where control plane does not rename fields correctly for `session` for older version of data planes.
[#10352](https://github.com/Kong/kong/pull/10352)

## 3.2.0

Expand Down
1 change: 1 addition & 0 deletions kong/clustering/compat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ end
local function rename_field(config, name_from, name_to, has_update)
if config[name_from] ~= nil then
config[name_to] = config[name_from]
config[name_from] = nil
return true
end
return has_update
Expand Down
34 changes: 34 additions & 0 deletions spec/01-unit/19-hybrid/03-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ describe("kong.clustering.compat", function()
"goodbye",
"my.nested.field",
},
session = {
"anything",
},
},
})
end)
Expand Down Expand Up @@ -275,6 +278,37 @@ describe("kong.clustering.compat", function()
},
},
},

{
name = "renamed fields",
version = "1.0.0",
plugins = {
{
name = "session",
config = {
idling_timeout = 60,
rolling_timeout = 60,
stale_ttl = 60,
cookie_same_site = "Default",
cookie_http_only = false,
remember = true,
},
},
},
expect = {
{
name = "session",
config = {
cookie_idletime = 60,
cookie_lifetime = 60,
cookie_discard = 60,
cookie_samesite = "Lax",
cookie_httponly = false,
cookie_persistent = true,
},
},
},
},
}

for _, case in ipairs(cases) do
Expand Down

0 comments on commit 6cbc7d9

Please sign in to comment.