-
Notifications
You must be signed in to change notification settings - Fork 3
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
Verify requests to the function service #28
Conversation
If we expect users to set the signing key in PEM format, we might want to make sure we have a way to encode it from the API we use to retrieve it in https://github.com/stealthrocket/dispatch/pull/100/files#diff-4f35307305b1572f81cf711ef73581ebf371a703d872d99be95499fddc78839fR43
That UX is important. |
To be clear @chriso, I'm not asking you to have all the answers, just kicking off the discussion :) |
We don't require or expect that users specify keys in PEM format; the If the user has access to the 32 byte public key then they can also do the following: from dispatch.signature import Ed25519PublicKey
verification_key = Ed25519PublicKey.from_public_bytes(
b"&\xb4\x0b\x8f\x93\xff\xf3\xd8\x97\x11/~\xbcX+#-\xbdrQ}\x08/\xe8<\xfb0\xdd\xceC\xd1\xbb"
) I can add a |
As for whether we have APIs elsewhere return public keys as bytes or wrapped in a container (like PEM), I prefer the latter:
|
I agree with having users use PEM encoded strings in their code to specify the keys, there's a lot of clarity in that model 👍 What I'm wondering is more how we get them keys in the PEM format; our current protobuf messages use |
Let's have the API return keys in PEM format? The user would never see keys in any other format. |
I'm worried that the PEM format is going to create more frustration for the users. A lot could go wrong when people start using env variables. Why not just use base64? |
The SDK can now verify incoming requests that have been signed with an HTTP Message Signature.
When configuring the FastAPI integration, the user can optionally provide a
verification_key: Ed25519PublicKey
:The orchestrator signing requests is expected to generate a SHA-512
Content-Digest
header, and then generate an Ed25519Signature
header that uses a key ID ofdefault
and that covers at least the following components:("@method" "@path" "@authority" "content-type" "content-digest")
.This fixes #8.