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

kes: add support for API key authentication #340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aead
Copy link
Member

@aead aead commented Mar 7, 2023

This commit adds support for KES<->KES authentication via API keys. Now, a KES edge server can authenticate to a KES server (stateful) via API keys - not just via TLS private key / certificate files.

case config.APIKey != nil:
cert, err = kes.GenerateCertificate(config.APIKey)
if err != nil {
}

Choose a reason for hiding this comment

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

can we return the error here?

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

Minor comment. Also how to verify the changes?

if config.PrivateKey == "" {
return nil, errors.New("kes: no private key provided")
if config.APIKey != nil && (config.PrivateKey != "" || config.Certificate != "") {
return nil, errors.New("kes: ambiguous configuration: API key as well as mTLS private key and certificate provided")
Copy link
Contributor

Choose a reason for hiding this comment

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

API key as well as mTLS private key and/or certificate provided ?

This commit adds support for KES<->KES authentication
via API keys. Now, a KES edge server can authenticate
to a KES server (stateful) via API keys - not just
via TLS private key / certificate files.

Signed-off-by: Andreas Auernhammer <hi@aead.dev>
@shtripat
Copy link
Contributor

Please resolve the conflict and add steps for verification. I feel we can add a wiki for the this mechanism of API keys authentication, right?

@allanrogerr
Copy link

@aead PTAL

@bh4t bh4t added the new-feature This PR implements a new feature label Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature This PR implements a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants