47ng / 47ng/prisma-field-encryption

Work on the edge with crypto providers

Aperta
#96 7 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
306
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Prisma has just started letting some users test out a version of Prisma compiled to WASM so that it can run on the edge. I've tested it myself and it looks really promising, yet one problem I have encoutered is that it does not work with prisma-field-encryption yet because of prisma-field-encryption's reliance on Node.js's crypto module which is not available in edge contexts.

My suggestion is to have 'crypto providers' for different contexts, similar to what Stripe does with their Node.js module (see: https://github.com/stripe/stripe-node/tree/master/src/crypto) to support edge contexts. My thinking is that when instantiating prisma-field-encryption, you pass in a crypto provider that works for where you are running Prisma (likely just SublteCrypto and node:crypto are all that is required)

Let me know what you think!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Look at the Stripe Node.js crypto provider pattern linked in the issue. Examine the current encryption module's dependency on Node.js crypto. Identify where crypto operations are performed and design an abstraction layer to accept different providers like SubtleCrypto for edge/WASM contexts. Check existing tests to understand the encryption flow.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
node.js, typescript, wasm
Ambito
backend, database
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.