diff --git a/kong/llm/drivers/anthropic.lua b/kong/llm/drivers/anthropic.lua index c081571ec0fcb..c942dbcbbe449 100644 --- a/kong/llm/drivers/anthropic.lua +++ b/kong/llm/drivers/anthropic.lua @@ -473,14 +473,14 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/drivers/azure.lua b/kong/llm/drivers/azure.lua index 28487d6538d63..b88bffbfd1d15 100644 --- a/kong/llm/drivers/azure.lua +++ b/kong/llm/drivers/azure.lua @@ -132,7 +132,7 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end @@ -145,7 +145,7 @@ function _M.configure_request(conf) or (conf.model.options and conf.model.options.azure_api_version) if auth_param_name and auth_param_value and auth_param_location == "query" then - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value end end diff --git a/kong/llm/drivers/cohere.lua b/kong/llm/drivers/cohere.lua index b16ee6cc96210..89151608caac7 100644 --- a/kong/llm/drivers/cohere.lua +++ b/kong/llm/drivers/cohere.lua @@ -481,14 +481,14 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/drivers/gemini.lua b/kong/llm/drivers/gemini.lua index b5fceac08a8a9..d450225ea0ff0 100644 --- a/kong/llm/drivers/gemini.lua +++ b/kong/llm/drivers/gemini.lua @@ -391,14 +391,14 @@ function _M.configure_request(conf, identity_interface) -- DBO restrictions makes sure that only one of these auth blocks runs in one plugin config if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/drivers/llama2.lua b/kong/llm/drivers/llama2.lua index cc9859c0a8dc8..446e7295e70b4 100644 --- a/kong/llm/drivers/llama2.lua +++ b/kong/llm/drivers/llama2.lua @@ -278,14 +278,14 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/drivers/mistral.lua b/kong/llm/drivers/mistral.lua index a16c1d9306662..8ae85b3a513b8 100644 --- a/kong/llm/drivers/mistral.lua +++ b/kong/llm/drivers/mistral.lua @@ -173,14 +173,14 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/drivers/openai.lua b/kong/llm/drivers/openai.lua index 1433d6f17ae91..b77cd1aafc37e 100644 --- a/kong/llm/drivers/openai.lua +++ b/kong/llm/drivers/openai.lua @@ -214,14 +214,14 @@ function _M.configure_request(conf) if auth_header_name and auth_header_value then local exist_value = kong.request.get_header(auth_header_name) - if exist_value == nil or not conf.auth.can_override then + if exist_value == nil or not conf.auth.allow_auth_override then kong.service.request.set_header(auth_header_name, auth_header_value) end end if auth_param_name and auth_param_value and auth_param_location == "query" then local query_table = kong.request.get_query() - if query_table[auth_param_name] == nil or not conf.auth.can_override then + if query_table[auth_param_name] == nil or not conf.auth.allow_auth_override then query_table[auth_param_name] = auth_param_value kong.service.request.set_query(query_table) end diff --git a/kong/llm/schemas/init.lua b/kong/llm/schemas/init.lua index 8e51339bebc22..e45c263497468 100644 --- a/kong/llm/schemas/init.lua +++ b/kong/llm/schemas/init.lua @@ -97,9 +97,9 @@ local auth_schema = { required = false, encrypted = true, referenceable = true }}, - { can_override = { + { allow_auth_override = { type = "boolean", - description = "If enabled, the auth header or param can be overridden by the request using the plugin configured value.", + description = "If enabled, the authorization header or parameter can be overridden in the request by the value configured in the plugin.", required = false, default = true }}, }