local typedefs = require "kong.db.schema.typedefs"return { name = "key-auth", fields = { { consumer = typedefs.no_consumer }, { protocols = typedefs.protocols_http }, { config = { type = "record", fields = { { key_names = { type = "array", required = true, elements = typedefs.header_name, default = { "apikey" }, }, }, { hide_credentials = { type = "boolean", default = false }, }, { anonymous = { type = "string" }, }, { key_in_body = { type = "boolean", default = false }, }, { run_on_preflight = { type = "boolean", default = true }, }, }, }, }, },}
参考
https://qizhidao.top/2021/03/07/Kong%E7%BD%91%E5%85%B3%E6%95%B4%E5%90%88spring-cloud%E5%BE%AE%E6%9C%8D%E5%8A%A1oauth2/