-
Notifications
You must be signed in to change notification settings - Fork 35
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
Request identity v1 implementation #1349
Conversation
3584180
to
421a38c
Compare
421a38c
to
02074c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve checked the JWT part, and the tests looks good!
One question about the expiration, is the unit is seconds or milliseconds?
And also, this probably should be a configuration or at least a constant?
I didn’t look into the details of integrating this into the invoker, if you need some feedback there, maybe ping Francesco/Till?
the unit is seconds, i will clarify and make it a constant - dont see any need to config it yet will ping runtime folks for a wider review. thx |
02074c1
to
7b2ddbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice. I left a couple of tiny optional nits but this is good to go.
Great job 👏
#[derive(Debug, thiserror::Error)] | ||
pub enum HttpError { | ||
#[error(transparent)] | ||
Hyper(#[from] hyper::Error), | ||
#[error(transparent)] | ||
Http(#[from] hyper::http::Error), | ||
#[error(transparent)] | ||
IdentityV1(#[from] <super::request_identity::v1::Signer<'static> as SignRequest>::Error), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neat!
fb962e6
to
41c5b05
Compare
Implements a simple request signing approach using ed25519 jwts. Signed parameters:
The header looks like:
The payload looks like:
The goal of this signing protocol is to prove recent ownership of the private key without requiring mutual TLS. It is not intended to provide strong interception protection, but only client identification; request bodies and headers remain mutable by a MITM attacker. Server-authenticated TLS must still be used to provide interception protection.
A single private key can be given as a local pem file. Public keys in a format like
publickeyv1_CVmG1AvSyedeZpwwd3MRGbRu5yFt3QXXEpQJKyigB9A5
are emitted into logs and can be safely included in service code to aid in verification.Headers:
x-restate-jwt-v1
-> the jwtx-restate-signature-scheme
->v1