core icon indicating copy to clipboard operation
core copied to clipboard

feat: add message verifier class

Open RomainLanz opened this issue 3 months ago • 2 comments

Hey there! 👋🏻

This PR brings the MessageVerifier class to the core module instead of being defined inside the Encryption package.

It will be used by the HttpServer in order to create signed URL and for the legacy encryption driver.

RomainLanz avatar Nov 19 '25 07:11 RomainLanz

Nice. I see that the HTTP package uses the MessageVerifier as well. https://github.com/adonisjs/http-server/blob/8.x/src/cookies/drivers/signed.ts#L54

Does it make sense it to move it to a utils package, so that it could be used anywhere we like by providing in the key. In that case, the http package will receive the appKey as well and will use the verifier to sign cookies?

thetutlage avatar Nov 20 '25 10:11 thetutlage

I'm not sure it's necessary to create a dedicated package for this. The main issue is that the http module currently has no dependency on the core, and introducing one might not be ideal.

If that's a concern, I can instead extract the verifier more cleanly from the new encryption module, since it's currently tied to an encryption driver. This would keep things self-contained without adding a core dependency.

RomainLanz avatar Nov 20 '25 12:11 RomainLanz

This pull request has been marked as stale because it has been inactive for more than 21 days. Please reopen if you still intend to submit this pull request

github-actions[bot] avatar Dec 12 '25 00:12 github-actions[bot]

Closing since we kept the MessageVerifier in the encryption package.

RomainLanz avatar Dec 12 '25 07:12 RomainLanz