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(plugin/redirect): plugin to redirect requests to a new location #13900

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

mheap
Copy link
Member

@mheap mheap commented Nov 20, 2024

Summary

Adds a new plugin that allows users to return a Location header on a given entity.

This use case can currently be met with the request-termination and exit-transformer plugins, but it's a common workflow that we should support as a first class citizen.

Docs are pending - If this PR is deemed acceptable I can submit a docs PR before merge

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

@github-actions github-actions bot added chore Not part of the core functionality of kong, but still needed schema-change-noteworthy cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Nov 20, 2024
@mheap mheap changed the title fofeat(plugin/redirect): plugin to redirect requests to a new location feat(plugin/redirect): plugin to redirect requests to a new location Nov 20, 2024
kong/plugins/redirect/handler.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/handler.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/handler.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/handler.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/schema.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/schema.lua Outdated Show resolved Hide resolved
kong/plugins/redirect/schema.lua Show resolved Hide resolved
kong/plugins/redirect/schema.lua Show resolved Hide resolved
Copy link
Contributor

@nowNick nowNick left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀 !

It's also an interesting argument towards some sort of plugin piping (combining plugins).

kong/plugins/redirect/schema.lua Show resolved Hide resolved
Copy link
Member

@kikito kikito left a comment

Choose a reason for hiding this comment

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

Looks good enough to me, minor cosmetic comment

@@ -43,6 +43,7 @@ local plugins = {
"ai-request-transformer",
"ai-response-transformer",
"standard-webhooks",
"redirect"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"redirect"
"redirect",

@kikito kikito merged commit fa9bed9 into master Nov 22, 2024
36 checks passed
@kikito kikito deleted the feat/redirect-plugin branch November 22, 2024 13:16
@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-13900-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-13900-to-master-to-upstream
git checkout -b cherry-pick-13900-to-master-to-upstream
ancref=$(git merge-base 7d2f2c1354453318b16f73fccd2c9b9cf0a7e7ae 030454704e5f35a96db19e2d64b38ebc65926349)
git cherry-pick -x $ancref..030454704e5f35a96db19e2d64b38ebc65926349

@github-actions github-actions bot added the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Nov 22, 2024
@kikito kikito removed the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee chore Not part of the core functionality of kong, but still needed schema-change-noteworthy size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants