47ng / 47ng/prisma-field-encryption

TURBO REPO (Error: [prisma-field-encryption] Error: no encryption key provided.)

Aperta
#128 2 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

### Issue description
Hi there, Thank you for that amazing package.
I have tried to use this package with **[turbo repo](https://turbo.build/repo/docs)** and it was working fine on local
But when I have put it in production **([Vercel](https://vercel.com/docs))**, I have got the following issue
```ssh
Error: [prisma-field-encryption] Error: no encryption key provided.
```

### What I have Tried

1. I have put the encryption key on my vercel project as always, (this was already made on first deployement)
2. Then I have changed the key name from my own to "PRISMA_FIELD_ENCRYPTION_KEY" as mentioned in your docs
But I still get the same issue

### Solution found
Finally I had to take all my local env to .env.local (not version controlled) an encryption key to .env(version controlled) that is not secure. My project is private and I am alone on I think this is not secure. By the way it is working with this solution

### Version
```json
{
"prisma": "^5.21.0",
"prisma-field-encryption": "^1.6.0"
}
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue is about environment variable loading in a TurboRepo monorepo deployed to Vercel. Start by examining how the prisma-field-encryption middleware reads the PRISMA_FIELD_ENCRYPTION_KEY. Check the package's source for key loading logic and compare local vs. Vercel environment setups. Look at the project's build output and runtime environment to see where the key is expected. 'Done' is when the key is correctly loaded in production without committing it to version control.

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

Valutazione

Stack tecnologico
docker, typescript
Ambito
backend, devops, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 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.