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

Feature request: IDs for JWT claims #6016

Closed
michaelsproul opened this issue Oct 3, 2023 · 4 comments · Fixed by #6052
Closed

Feature request: IDs for JWT claims #6016

michaelsproul opened this issue Oct 3, 2023 · 4 comments · Fixed by #6052
Labels
good first issue Issues that are suitable for first-time contributors. meta-feature-request Issues to track feature requests. prio-medium Resolve this some time soon (tm). scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling.

Comments

@michaelsproul
Copy link

Problem description

The execution API spec defines an optional id claim that can be set in a JWT token to convey information about the client being authenticated. This is useful for more advanced forms of authentication beyond the basic 1-CL-to-1-EL authentication that we usually do. For example, my Electric Eel multiplexer uses the id to identify the connecting client and decide which JWT secret to use. Without the ID, it has to fall back on iterating all known JWT secrets and trying to verify the token against them (which is slow).

The spec defines the id claim here: https://github.com/ethereum/execution-apis/blob/main/src/engine/authentication.md#jwt-claims

It's worth noting that the ID in the claim is distinct from the key-ID concept defined by the JWT standard, which is part of the header, not the body. Apart from being a bit inelegant this isn't an issue.

Solution description

Add a flag to Lodestar like --jwt-id which takes a string to use as the JWT ID for claims made to the EL.

Additional context

No response

@michaelsproul michaelsproul added the meta-feature-request Issues to track feature requests. label Oct 3, 2023
@nflaig nflaig added good first issue Issues that are suitable for first-time contributors. scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling. labels Oct 3, 2023
@dapplion
Copy link
Contributor

dapplion commented Oct 3, 2023

Sounds good! We should def implement it. What's your suggested usage of id vs clv? In Lighthouse do you set the clv to the same agent as in the libp2p identify protocol?

@michaelsproul
Copy link
Author

Awesome!

CLV is unused in Lighthouse at the moment but I think would be well-suited to including version metadata. The downside is that it gets transmitted with every request, so it's a little wasteful.

I think it could be good to just leave the ID and CLV off by default and allow them both to be configured?

@dapplion dapplion added the prio-medium Resolve this some time soon (tm). label Oct 12, 2023
@nflaig
Copy link
Member

nflaig commented Oct 20, 2023

CLV off by default and allow them both to be configured

What would be the expected use case of CLV that can't be achieved by the ID already?

The use cases I see for this only make sense if the CLV is included by default and set to an identifiable value by the client itself, e.g. Lodestar/${version}

Both those use cases don't really work if it is off by default.

Until there is a clear use case for CLV I would suggest we don't implement that for now.

@michaelsproul
Copy link
Author

That sounds reasonable to me. I think the CLV is of dubious value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. meta-feature-request Issues to track feature requests. prio-medium Resolve this some time soon (tm). scope-interop Issues that fix interop issues between Lodestar and CL, EL or tooling.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants