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

chore(*) 1.x era deprecation removals #8815

Merged
merged 6 commits into from
May 25, 2022
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
3 changes: 0 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ plugins/key-auth:
plugins/ldap-auth:
- kong/plugins/ldap-auth/**/*

plugins/log-serializers:
- kong/plugins/log-serializers/**/*

plugins/loggly:
- kong/plugins/loggly/**/*

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,27 @@
the time comes from a driver like `pgmoon` or `lmdb`. This was done for performance
reasons. Deep copying on `"select"` context can still be done before calling this
function. [#8796](https://github.com/Kong/kong/pull/8796)
- The deprecated alias of `Kong.serve_admin_api` was removed. If your custom Nginx
templates still use it, please change it to `Kong.admin_content`.
[#8815](https://github.com/Kong/kong/pull/8815)
- The deprecated `shorthands` field in Kong Plugin or DAO schemas was removed in favor
or the typed `shorthand_fields`. If your custom schemas still use `shorthands`, you
need to update them to use `shorhand_fields`.
[#8815](https://github.com/Kong/kong/pull/8815)
- The support for deprecated legacy plugin schemas was removed. If your custom plugins
still use the old (`0.x era`) schemas, you are now forced to upgrade them.
[#8815](https://github.com/Kong/kong/pull/8815)
- The old `kong.plugins.log-serializers.basic` library was removed in favor of the PDK
function `kong.log.serialize`, please upgrade your plugins to use PDK.
[#8815](https://github.com/Kong/kong/pull/8815)
- The Kong constant `CREDENTIAL_USERNAME` with value of `X-Credential-Username` was
removed. Kong plugins in general have moved (since [#5516](https://github.com/Kong/kong/pull/5516))
to use constant `CREDENTIAL_IDENTIFIER` with value of `X-Credential-Identifier` when
setting the upstream headers for a credential.
[#8815](https://github.com/Kong/kong/pull/8815)
- The support for deprecated hash structured custom plugin DAOs (using `daos.lua`) was
removed. Please upgrade the legacy plugin DAO schemas.
[#8815](https://github.com/Kong/kong/pull/8815)

#### Admin API

Expand Down
3 changes: 0 additions & 3 deletions kong-2.8.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ build = {
["kong.plugins.oauth2.daos"] = "kong/plugins/oauth2/daos.lua",
["kong.plugins.oauth2.daos.oauth2_tokens"] = "kong/plugins/oauth2/daos/oauth2_tokens.lua",


["kong.plugins.log-serializers.basic"] = "kong/plugins/log-serializers/basic.lua",

["kong.plugins.tcp-log.handler"] = "kong/plugins/tcp-log/handler.lua",
["kong.plugins.tcp-log.schema"] = "kong/plugins/tcp-log/schema.lua",

Expand Down
1 change: 0 additions & 1 deletion kong/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ local constants = {
CONSUMER_ID = "X-Consumer-ID",
CONSUMER_CUSTOM_ID = "X-Consumer-Custom-ID",
CONSUMER_USERNAME = "X-Consumer-Username",
CREDENTIAL_USERNAME = "X-Credential-Username", -- TODO: deprecated, use CREDENTIAL_IDENTIFIER instead
CREDENTIAL_IDENTIFIER = "X-Credential-Identifier",
RATELIMIT_LIMIT = "X-RateLimit-Limit",
RATELIMIT_REMAINING = "X-RateLimit-Remaining",
Expand Down
18 changes: 0 additions & 18 deletions kong/db/schema/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1647,24 +1647,6 @@ function Schema:process_auto_fields(data, context, nulls, opts)
end
end

-- deprecated
local shorthands = self.shorthands
if shorthands then
for i = 1, #shorthands do
local sname, sfunc = next(shorthands[i])
local value = data[sname]
if value ~= nil then
data[sname] = nil
local new_values = sfunc(value)
if new_values then
for k, v in pairs(new_values) do
data[k] = v
end
end
end
end
end

local now_s
local now_ms

Expand Down
26 changes: 1 addition & 25 deletions kong/db/schema/metaschema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,19 +263,6 @@ local entity_checks_schema = {
}


local shorthands_array = {
type = "array",
elements = {
type = "map",
keys = { type = "string" },
values = { type = "function" },
required = true,
len_eq = 1,
},
nilable = true,
}


local shorthand_fields_array = {
type = "array",
elements = {
Expand All @@ -290,7 +277,6 @@ local shorthand_fields_array = {


insert(field_schema, { entity_checks = entity_checks_schema })
insert(field_schema, { shorthands = shorthands_array })
insert(field_schema, { shorthand_fields = shorthand_fields_array })


Expand Down Expand Up @@ -652,9 +638,6 @@ local MetaSchema = Schema.new({
{
entity_checks = entity_checks_schema,
},
{
shorthands = shorthands_array,
},
{
shorthand_fields = shorthand_fields_array,
},
Expand All @@ -664,7 +647,7 @@ local MetaSchema = Schema.new({
{
check = {
type = "function",
nilable = true
nilable = true,
},
},
{
Expand All @@ -675,10 +658,6 @@ local MetaSchema = Schema.new({
},
},

entity_checks = {
{ only_one_of = { "shorthands", "shorthand_fields" } },
},

check = function(schema)
local errors = {}
local fields = schema.fields
Expand Down Expand Up @@ -843,9 +822,6 @@ MetaSchema.MetaSubSchema = Schema.new({
{
entity_checks = entity_checks_schema,
},
{
shorthands = shorthands_array,
},
{
shorthand_fields = shorthand_fields_array,
},
Expand Down
Loading