Skip to content

fix: validate plugin configuration in the DP#2856

Merged
spacewander merged 3 commits into
apache:masterfrom
spacewander:validate
Nov 28, 2020
Merged

fix: validate plugin configuration in the DP#2856
spacewander merged 3 commits into
apache:masterfrom
spacewander:validate

Conversation

@spacewander

Copy link
Copy Markdown
Member

Fix #2834

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@membphis

Copy link
Copy Markdown
Member

wow, That is a nice PR

@membphis

Copy link
Copy Markdown
Member

@spacewander Please update the checklist

@membphis

Copy link
Copy Markdown
Member

@spacewander you can continue this issue

@spacewander spacewander added this to the 2.1 milestone Nov 27, 2020
@spacewander
spacewander marked this pull request as ready for review November 27, 2020 10:14
Comment thread apisix/core/config_etcd.lua Outdated
data_valid, err = self.checker(item.value)
if not data_valid then
log.error("failed to check item data of [", self.key,
"] err:", err, " ,val: ", json.delay_encode(item.value))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad indentation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Comment thread apisix/plugin.lua Outdated

local function check_schema(plugins_conf, schema_type, skip_disabled_plugin)
for name, plugin_conf in pairs(plugins_conf) do
core.log.info("check plugin scheme, name: ", name, ", configurations: ",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: scheme => schema.

Comment thread apisix/plugin.lua Outdated

local function stream_check_schema(plugins_conf, schema_type, skip_disabled_plugin)
for name, plugin_conf in pairs(plugins_conf) do
core.log.info("check stream plugin scheme, name: ", name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: missing JSONSchema validation for plugin attributes

4 participants