Skip to content
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

fix(session): adds a compatablity for session #14085

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading