Skip to content

Commit

Permalink
fix(session): adds a compatablity for session
Browse files Browse the repository at this point in the history
  • Loading branch information
raoxiaoyan committed Jan 7, 2025
1 parent df6cc59 commit 3ae163d
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

0 comments on commit 3ae163d

Please sign in to comment.