Skip to content

Add signature with each key for directory responses #30

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 14, 2025

Conversation

thibmeu
Copy link
Collaborator

@thibmeu thibmeu commented Jun 13, 2025

This adds a method to http-message-sig package so that directory responses can be signed as recommended in the draft. The draft change is pending and available in thibmeu/http-message-signatures-directory#40

This commit also updates the example worker to provide a signature over the directory.

Tests are to be added. They could also serve as a basis to get test vectors in the directory draft.

If needed, this commit can be deployed to a test domain @AkshataDM

When running npm run start locally, I get

$ http http://localhost:8787/.well-known/http-message-signatures-directory
HTTP/1.1 200 OK
Content-Length: 178
Content-Type: application/http-message-signatures-directory
Signature: binding0=:i23cuESh2w4oCNrD+TgsaJXDQf2big85jY3aPV0VTSkZaPQvxqMM6j9r8A3i/D2yzl+lDuDbxrWBlwnUciSkAA==:
Signature-Input: binding0=("@authority");created=1749805161;keyid="poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U";alg="ed25519";expires=1749805461;tag="http-message-signatures-directory"

{"keys":[{"kid":"poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U","kty":"OKP","crv":"Ed25519","x":"JrQLj5P_89iXES9-vFgrIy29clF9CC_oPPsw3c5D0bs","nbf":1743465600000}],"purpose":"rag"}

This adds a method to http-message-sig package so that directory
responses can be signed as recommended in the draft. The draft change is
pending and available in thibmeu/http-message-signatures-directory#40

This commit also updates the example worker to provide a signature over
the directory.

Tests are to be added. They could also serve as a basis to get test
vectors in the directory draft.
@thibmeu thibmeu requested review from AkshatM and armfazh June 13, 2025 09:26
@thibmeu thibmeu self-assigned this Jun 13, 2025
@thibmeu thibmeu added the enhancement New feature or request label Jun 13, 2025
@thibmeu thibmeu merged commit 8dad5e3 into cloudflare:main Jun 14, 2025
2 checks passed
@thibmeu thibmeu deleted the sign-directory-response branch June 14, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants