Skip to content

Commit

Permalink
fix(session): adds a compatablity for session (#14085)
Browse files Browse the repository at this point in the history
Add compatibility to #13990

KM-878
  • Loading branch information
raoxiaoyan authored Jan 8, 2025
1 parent 3636949 commit 096d475
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kong/clustering/compat/removed_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,10 @@ return {
"queue.concurrency_limit",
},
},
[30010000000] = {
session = {
"hash_subject",
"store_metadata",
}
}
}
25 changes: 25 additions & 0 deletions spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,31 @@ describe("CP/DP config compat transformations #" .. strategy, function()
end)
end)

describe("compatibility tests for sesssion plugin", function ()
it("removes `config.store_metadata` and `config.hash_subject` before sending them to older(3.9.0.0)DP nodes", function ()
local session = admin.plugins:insert {
name = "session",
enabled = true,
config = {
-- [[ new fields 3.10.0
store_metadata = true,
hash_subject = true,
-- ]]
}
}

assert.not_nil(session.config.store_metadata)
assert.not_nil(session.config.hash_subject)
local expected_session = cycle_aware_deep_copy(session)
expected_session.config.store_metadata = nil
expected_session.config.hash_subject = nil
do_assert(uuid(), "3.9.0", expected_session)

-- cleanup
admin.plugins:remove({ id = session.id })
end)
end)

describe("ai plugins supported providers", function()
it("[ai-proxy] tries to use unsupported providers on older Kong versions", function()
-- [[ 3.8.x ]] --
Expand Down

1 comment on commit 096d475

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:096d4756eed3e2b28f7361752bb10d1044642fd3
Artifacts available https://github.com/Kong/kong/actions/runs/12665317551

Please sign in to comment.