Skip to content

Commit

Permalink
fix(plugins): add realm to removed fields
Browse files Browse the repository at this point in the history
Basic-auth added new field "realm" but it was not added to "removed_fields" which
breaks backwards compat between new CPs and old DPs.

KAG-4516

(cherry picked from commit 420b3b6)
  • Loading branch information
nowNick authored and samugi committed Jun 11, 2024
1 parent 2e8082c commit cd3e5c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: "**Basic-Auth**: Fix an issue of realm field not recognized for older kong versions (before 3.6)"
type: bugfix
scope: Plugin
3 changes: 3 additions & 0 deletions kong/clustering/compat/removed_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,8 @@ return {
opentelemetry = {
"sampling_rate",
},
basic_auth = {
"realm"
},
},
}
16 changes: 16 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 @@ -468,6 +468,22 @@ describe("CP/DP config compat transformations #" .. strategy, function()
end)
end)
end)

describe("www-authenticate header in plugins (realm config)", function()
it("[basic-auth] removes realm for versions below 3.6", function()
local basic_auth = admin.plugins:insert {
name = "basic-auth",
}

local expected_basic_auth_prior_36 = utils.cycle_aware_deep_copy(basic_auth)
expected_basic_auth_prior_36.config.realm = nil

do_assert(utils.uuid(), "3.5.0", expected_basic_auth_prior_36)

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

Expand Down

0 comments on commit cd3e5c8

Please sign in to comment.