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(core): add keys and key-sets entity #9737

Merged
merged 2 commits into from
Nov 16, 2022
Merged

Conversation

jschmid1
Copy link
Contributor

@jschmid1 jschmid1 commented Nov 9, 2022

Supersedes: #9677

This is ready for a first round of reviews.

Summary

This PR adds support for managing asymmetric keys in various formats (JWK, PEM). It adds two new entities

  • /keys
  • /key-sets

that accept the mentioned formats.

Full changelog

  • add new core entities keys and key-sets
  • adds daos for keys and key-sets entities

Missing things:

  • c* support or skip tests for it
  • proper uniqueness of keys within a set
  • docs (queued after initial review/approval)

Signed-off-by: Joshua Schmid jaiks@posteo.de

Comment on lines +11 to +13
function key_sets:truncate()
return self.super.truncate(self)
end
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need all the method redefinitions on this file (and on keys)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A matter of taste I guess. Some of the methods are generated based on presence of certain entity fields. Explicitly defining the methods, even if these are just a pass-through, helps with understanding the functionality that this dao provides.

kong/db/schema/entities/keys.lua Show resolved Hide resolved
kong/db/schema/entities/keys.lua Show resolved Hide resolved
kong/db/schema/typedefs.lua Show resolved Hide resolved
kong/db/schema/typedefs.lua Outdated Show resolved Hide resolved
kong/db/schema/typedefs.lua Outdated Show resolved Hide resolved
kong/constants.lua Outdated Show resolved Hide resolved
kong/constants.lua Outdated Show resolved Hide resolved
kong/db/dao/keys.lua Outdated Show resolved Hide resolved
Copy link
Contributor

@flrgh flrgh left a comment

Choose a reason for hiding this comment

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

Looks very solid! All high level items have been well-covered by other reviewers, so for the most part my comments are all low-hanging fruit (formatting/consistency, code style, etc).

Happy to +1 this after some of @bungle and @kikito's comments are addressed.

@jschmid1 jschmid1 added this to the 3.1 milestone Nov 16, 2022
Signed-off-by: Joshua Schmid <jaiks@posteo.de>
Copy link
Member

@bungle bungle left a comment

Choose a reason for hiding this comment

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

Let's move on with this, thanks @jschmid1.

@jschmid1 jschmid1 merged commit 74729c1 into Kong:master Nov 16, 2022
javierguerragiraldez added a commit to Kong/koko that referenced this pull request Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants