Skip to content

Commit 096d475

Browse files
authored
fix(session): adds a compatablity for session (#14085)
Add compatibility to #13990 KM-878
1 parent 3636949 commit 096d475

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

kong/clustering/compat/removed_fields.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,10 @@ return {
228228
"queue.concurrency_limit",
229229
},
230230
},
231+
[30010000000] = {
232+
session = {
233+
"hash_subject",
234+
"store_metadata",
235+
}
236+
}
231237
}

spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,31 @@ describe("CP/DP config compat transformations #" .. strategy, function()
602602
end)
603603
end)
604604

605+
describe("compatibility tests for sesssion plugin", function ()
606+
it("removes `config.store_metadata` and `config.hash_subject` before sending them to older(3.9.0.0)DP nodes", function ()
607+
local session = admin.plugins:insert {
608+
name = "session",
609+
enabled = true,
610+
config = {
611+
-- [[ new fields 3.10.0
612+
store_metadata = true,
613+
hash_subject = true,
614+
-- ]]
615+
}
616+
}
617+
618+
assert.not_nil(session.config.store_metadata)
619+
assert.not_nil(session.config.hash_subject)
620+
local expected_session = cycle_aware_deep_copy(session)
621+
expected_session.config.store_metadata = nil
622+
expected_session.config.hash_subject = nil
623+
do_assert(uuid(), "3.9.0", expected_session)
624+
625+
-- cleanup
626+
admin.plugins:remove({ id = session.id })
627+
end)
628+
end)
629+
605630
describe("ai plugins supported providers", function()
606631
it("[ai-proxy] tries to use unsupported providers on older Kong versions", function()
607632
-- [[ 3.8.x ]] --

0 commit comments

Comments
 (0)