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

fix(admin): reject AdminAPI call with empty tags #13723

Merged
merged 3 commits into from
Oct 30, 2024
Merged

Conversation

nowNick
Copy link
Contributor

@nowNick nowNick commented Sep 30, 2024

Summary

When querying entities that have tags assigned a user can send a request with tags parameter. Previously sending tags= (empty parameter) resulted in 500 error. This commit changes that so that it returns 400 error as empty explicit tags are not allowed.

Checklist

Issue reference

KAG-5496
Fix #13591

@github-actions github-actions bot added core/admin-api cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Sep 30, 2024
@nowNick nowNick force-pushed the fix/fix-for-tags-null branch 2 times, most recently from 26a3788 to 813fd53 Compare October 1, 2024 16:00
@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 1, 2024
@nowNick nowNick marked this pull request as ready for review October 1, 2024 17:17
@nowNick nowNick changed the title fix(admin): allow to receive empty tags fix(admin): reject AdminAPI call with empty tags Oct 1, 2024
@team-gateway-bot team-gateway-bot added the author/community PRs from the open-source community (not Kong Inc) label Oct 1, 2024
Copy link
Contributor

@hutchic hutchic left a comment

Choose a reason for hiding this comment

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

LGTM. Does the openapi spec need to be updated to reflect?

@brentos
Copy link
Contributor

brentos commented Oct 29, 2024

Just a couple minor comments, otherwise LGTM

@nowNick nowNick force-pushed the fix/fix-for-tags-null branch 2 times, most recently from 4c7f8b0 to 3b5af35 Compare October 30, 2024 16:29
When querying entities that have tags assigned a user can send
a request with `tags` parameter. Previously sending `tags=''`
(empty string or explicit nil) resulted in 500 error.
This commit changes that so that it returns 400 error as empty
explicit tags are not allowed

KAG-5496
Fix #13591
PR Review fixes - remove typo emtpy -> empty
PR Review fixes - improve error message: remove info about empty string
@locao locao added this to the 3.8.1 milestone Oct 30, 2024
@locao locao merged commit d1069e6 into master Oct 30, 2024
33 checks passed
@locao locao deleted the fix/fix-for-tags-null branch October 30, 2024 17:07
github-actions bot pushed a commit that referenced this pull request Oct 30, 2024
@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-13723-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-13723-to-master-to-upstream
git checkout -b cherry-pick-13723-to-master-to-upstream
ancref=$(git merge-base 94c7a9ff549f976888948788241da1b221f17ffa 3b5af359cda51f1f09d72a674cfa38dc3349b554)
git cherry-pick -x $ancref..3b5af359cda51f1f09d72a674cfa38dc3349b554

@team-gateway-bot
Copy link
Collaborator

Successfully created backport PR for release/3.8.x:

@github-actions github-actions bot added the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Oct 30, 2024
locao pushed a commit that referenced this pull request Oct 30, 2024
kevwilliams pushed a commit that referenced this pull request Oct 30, 2024
@locao locao removed the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author/community PRs from the open-source community (not Kong Inc) backport release/3.8.x cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee core/admin-api size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error occurs on endpoints when tags parameter is empty
5 participants