Skip to content

chore: support passing the publicKey in the 'kid' JWT header #553

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

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Jun 21, 2024

Example usage:

const payload = {};
const token = jsonwebtoken.sign(payload, privateKey, {
    algorithm: "RS256",
    expiresIn: "120s",
    keyid: publicKey,
});

// Set header `Authorization: Bearer ${token}` when calling Engine.

PR-Codex overview

The focus of this PR is to enhance authentication middleware by decoding JWT tokens and extracting public keys for keypair authentication.

Detailed summary

  • Updated JWT decoding to extract header and payload separately
  • Modified authentication logic to use extracted public key for keypair authentication

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@arcoraven arcoraven changed the title chore: support passing the publicKey 'iss' in the 'kid' JWT header chore: support passing the publicKey in the 'kid' JWT header Jun 21, 2024
@arcoraven arcoraven merged commit 0c90424 into main Jun 27, 2024
4 checks passed
@arcoraven arcoraven deleted the ph/supportPublicKeyInKidHeader branch June 27, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants