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

feat: strictly validate the input of core resources #10233

Merged
merged 1 commit into from
Sep 20, 2023
Merged

feat: strictly validate the input of core resources #10233

merged 1 commit into from
Sep 20, 2023

Conversation

Sn0rt
Copy link
Contributor

@Sn0rt Sn0rt commented Sep 20, 2023

Description

Fixes #10229

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Signed-off-by: Sn0rt <wangguohao.2009@gmail.com>
Comment on lines -60 to -66
"uri": "/hello",
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1980": 1
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you remove this?

Copy link
Contributor Author

@Sn0rt Sn0rt Sep 20, 2023

Choose a reason for hiding this comment

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

This field is not as expected and is not allowed to be passed into upstream in the global-rule.

_M.global_rule = {
    type = "object",
    properties = {
        id = id_schema,
        plugins = plugins_schema,
        create_time = timestamp_def,
        update_time = timestamp_def
    },
    required = {"id", "plugins"},
    additionalProperties = false,
}

Copy link
Contributor

Choose a reason for hiding this comment

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

If you delete this block, the test case will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have test this PR on myself repo https://github.com/Sn0rt/apisix/pull/9

@Sn0rt Sn0rt changed the title feat: strict check core resource define feat: strictly validate the input of core resources. Sep 20, 2023
@monkeyDluffy6017 monkeyDluffy6017 changed the title feat: strictly validate the input of core resources. feat: strictly validate the input of core resources Sep 20, 2023
@monkeyDluffy6017 monkeyDluffy6017 merged commit a98f1ca into apache:master Sep 20, 2023
42 checks passed
@Sn0rt Sn0rt deleted the api7/strict-verification-of-resource branch October 24, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: APISIX core resources require strict verification and do not need to pass in additional fields.
4 participants