Skip to content

Commit

Permalink
wip - add nullable = false to all plugin schema records
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Oct 4, 2018
1 parent 1e40d35 commit d38c9f5
Show file tree
Hide file tree
Showing 27 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions kong/plugins/acl/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ whitelist = { type = "array", elements = { type = "string" }, }, },
{ blacklist = { type = "array", elements = { type = "string" }, }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/aws-lambda/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ timeout = { type = "number", required = true, default = 60000 }, },
{ keepalive = { type = "number", required = true, default = 60000 }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/basic-auth/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ anonymous = { type = "string", uuid = true, legacy = true }, },
{ hide_credentials = { type = "boolean", default = false }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/bot-detection/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ whitelist = {
type = "array",
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/correlation-id/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ header_name = { type = "string", default = "Kong-Request-ID" }, },
{ generator = { type = "string", default = "uuid#counter",
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/cors/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ origins = {
type = "array",
Expand Down
2 changes: 2 additions & 0 deletions kong/plugins/datadog/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
default = { metrics = DEFAULT_METRICS },
fields = {
{ host = typedefs.host({ required = true, default = "localhost" }), },
Expand All @@ -105,6 +106,7 @@ return {
default = DEFAULT_METRICS,
elements = {
type = "record",
nullable = false,
fields = {
{ name = { type = "string", required = true, one_of = STAT_NAMES }, },
{ stat_type = { type = "string", required = true, one_of = STAT_TYPES }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/file-log/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ path = { type = "string",
required = true,
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/galileo/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ environment = { type = "string" }, },
{ retry_count = { type = "integer", default = 10 }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/hmac-auth/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ hide_credentials = { type = "boolean", default = false }, },
{ clock_skew = { type = "number", default = 300, gt = 0 }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/http-log/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ http_endpoint = typedefs.url({ required = true }) },
{ method = { type = "string", default = "POST", one_of = { "POST", "PUT", "PATCH" }, }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/ip-restriction/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ whitelist = { type = "array", elements = ip, }, },
{ blacklist = { type = "array", elements = ip, }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/jwt/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ uri_param_names = {
type = "set",
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/key-auth/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ key_names = {
type = "array",
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/ldap-auth/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ ldap_host = typedefs.host({ required = true }), },
{ ldap_port = typedefs.port({ required = true }), },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/loggly/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ return {
name = "loggly",
fields = {
{ config = {
nullable = false,
type = "record",
fields = {
{ host = typedefs.host({ default = "logs-01.loggly.com" }), },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/oauth2/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ return {
{ consumer = typedefs.no_consumer },
{ config = {
type = "record",
nullable = false,
fields = {
{ scopes = { type = "array", elements = { type = "string" }, }, },
{ mandatory_scope = { type = "boolean", default = false, required = true }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/rate-limiting/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ second = { type = "number", gt = 0 }, },
{ minute = { type = "number", gt = 0 }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/request-size-limiting/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ allowed_payload_size = { type = "integer", default = 128 }, },
},
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/request-termination/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ status_code = {
type = "integer",
Expand Down
3 changes: 3 additions & 0 deletions kong/plugins/request-transformer/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local strings_array = {

local strings_array_record = {
type = "record",
nullable = false,
fields = {
{ body = strings_array },
{ headers = strings_array },
Expand All @@ -27,6 +28,7 @@ local colon_strings_array = {

local colon_strings_array_record = {
type = "record",
nullable = false,
fields = {
{ body = colon_strings_array },
{ headers = colon_strings_array },
Expand All @@ -40,6 +42,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ http_method = typedefs.http_method },
{ remove = strings_array_record },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/response-ratelimiting/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ header_name = { type = "string", default = "x-kong-limit" }, },
{ limit_by = { type = "string",
Expand Down
3 changes: 3 additions & 0 deletions kong/plugins/response-transformer/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local colon_string_array = {

local string_record = {
type = "record",
nullable = false,
fields = {
{ json = string_array },
{ headers = string_array },
Expand All @@ -24,6 +25,7 @@ local string_record = {

local colon_string_record = {
type = "record",
nullable = false,
fields = {
{ json = colon_string_array },
{ headers = colon_string_array },
Expand All @@ -36,6 +38,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ remove = string_record },
{ replace = colon_string_record },
Expand Down
2 changes: 2 additions & 0 deletions kong/plugins/statsd/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ host = typedefs.host({ default = "localhost" }), },
{ port = typedefs.port({ default = 8125 }), },
Expand All @@ -83,6 +84,7 @@ return {
default = DEFAULT_METRICS,
elements = {
type = "record",
nullable = false,
fields = {
{ name = { type = "string", required = true, one_of = METRIC_NAMES }, },
{ stat_type = { type = "string", required = true, one_of = STAT_TYPES }, },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/syslog/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ log_level = severity },
{ successful_severity = severity },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/tcp-log/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ host = typedefs.host({ required = true }), },
{ port = typedefs.port({ required = true }), },
Expand Down
1 change: 1 addition & 0 deletions kong/plugins/udp-log/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
fields = {
{ config = {
type = "record",
nullable = false,
fields = {
{ host = typedefs.host({ required = true }) },
{ port = typedefs.port({ required = true }) },
Expand Down

0 comments on commit d38c9f5

Please sign in to comment.