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: kong plugin #1073

Merged
merged 12 commits into from
Sep 9, 2024
Merged

feat: kong plugin #1073

merged 12 commits into from
Sep 9, 2024

Conversation

anandkumarpatel
Copy link
Contributor

@anandkumarpatel anandkumarpatel commented Sep 5, 2024

🚥 Resolves ISSUE_ID

🧰 Changes

Add kong plugin

🧬 QA & Testing

Follow the "Deploying locally" instructions in the PR

@gratcliff gratcliff added the enhancement New feature or request label Sep 5, 2024
Copy link
Contributor

@llimllib llimllib left a comment

Choose a reason for hiding this comment

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

Very cool! The one unchecked cache is my only useful comment.

I built the dockerfile, but didn't test further than that

Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

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

just some documentation nits.

can you also add something to .github/MAINTAINERS.md on how we'll end up deploying this? if that's sensitive info then it can go somewhere in our handbook. would just like to have some docs somewhere on how this gets from this repo to customers.

packages/kong-plugin/README.md Show resolved Hide resolved
packages/kong-plugin/README.md Show resolved Hide resolved
packages/kong-plugin/README.md Outdated Show resolved Hide resolved
packages/kong-plugin/README.md Outdated Show resolved Hide resolved
packages/kong-plugin/kong/plugins/readme-plugin/schema.lua Outdated Show resolved Hide resolved
packages/kong-plugin/kong/plugins/readme-plugin/schema.lua Outdated Show resolved Hide resolved
packages/kong-plugin/kong/plugins/readme-plugin/schema.lua Outdated Show resolved Hide resolved
packages/kong-plugin/kong/plugins/readme-plugin/schema.lua Outdated Show resolved Hide resolved
@erunion
Copy link
Member

erunion commented Sep 5, 2024

mind also giving this a PR title? 🥺

@anandkumarpatel anandkumarpatel changed the title Feat/kong feature: kong plugin Sep 5, 2024
@anandkumarpatel anandkumarpatel changed the title feature: kong plugin feat: kong plugin Sep 5, 2024
Copy link
Member

@gratcliff gratcliff left a comment

Choose a reason for hiding this comment

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

Nice work, that was quick! Left a few comments as tidy up, but it's super close.


In the future:

- We will build a Docker image for the plugin and release it to the Kong Community plugins site.
Copy link
Member

Choose a reason for hiding this comment

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

@anandkumarpatel do you have any tickets in place for these tasks? If not, can we start tracking them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not yet! where should I add these tickets to? (note, this is just for hackathon, so we wont work on the tickets unless there is traction so not sure if its worth adding them?)

@@ -0,0 +1,98 @@
-- Helper functions provided by Kong Gateway, see https://github.com/Kong/kong/blob/master/spec/helpers.lua
local helpers = require "spec.helpers"
Copy link
Member

Choose a reason for hiding this comment

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

While I'm not sure how reasonable it is in this chunk of work, it would be nice to support integration tests for this (and Cloudflare) in our main integration test suite. I think that might require some mocking similar to how Wrangler does it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whats our integration test environment like? if it can run docker then we should be able to create some! otherwise we won't really be able to run a kong instance.

packages/kong-plugin/README.md Outdated Show resolved Hide resolved
# Run kong with the plugin
curl -Ls https://get.konghq.com/quickstart | bash -s -- -r "" -i kong-readme-plugin -t v1
# Enable the plugin
curl -isX POST http://localhost:8001/plugins -d name=readme-plugin -d 'config.api_key=<Your API Key>'
Copy link
Member

Choose a reason for hiding this comment

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

Why port 8001? What if this is exposed on another port?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if they ran the above script, its 8001. I am assuming if they don't follow the script they would know what they are doing.

development = false,
error = nil,
group = group,
_id = entry.request.id,
Copy link
Member

Choose a reason for hiding this comment

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

This is typically a UUID that we create in the client. I'm not seeing that done here, am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kong creates unique id, thats where this id is coming from

@anandkumarpatel
Copy link
Contributor Author

@erunion Thanks for the review, I fixed your issues. let me know if there is something else you want to see!

Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

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

nice work

.github/MAINTAINERS.md Outdated Show resolved Hide resolved
Co-authored-by: Jon Ursenbach <[email protected]>
.github/MAINTAINERS.md Outdated Show resolved Hide resolved
Co-authored-by: Jon Ursenbach <[email protected]>
@anandkumarpatel anandkumarpatel merged commit 9781c94 into main Sep 9, 2024
5 of 8 checks passed
@anandkumarpatel anandkumarpatel deleted the feat/kong branch September 9, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants