Eduardo Del Balso
10/04/2021, 10:00 PMRyan
10/05/2021, 7:31 AMEduardo Del Balso
10/05/2021, 1:55 PMEduardo Del Balso
10/05/2021, 1:56 PMEduardo Del Balso
10/05/2021, 1:58 PMEduardo Del Balso
10/05/2021, 1:59 PMRyan
10/05/2021, 2:11 PMThe team is arguing with me that Prisma isn’t production ready because of this and are pushing me to ditch it. 😕I would say that there are a lot of advantages to Prisma and as per the requirements there could be a better workaround. Maybe @janpio has an idea 🤔
Eduardo Del Balso
10/05/2021, 9:19 PMEduardo Del Balso
10/05/2021, 9:19 PMEduardo Del Balso
10/05/2021, 9:25 PMEduardo Del Balso
10/05/2021, 9:25 PMEduardo Del Balso
10/05/2021, 9:28 PMconst { getDMMF } = require('@prisma/sdk/dist/engine-commands/getDmmf')
to make some progress, but really feels like we’re down the wrong path here.Ryan
10/06/2021, 5:23 AMPrismaClient
instance:
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
console.log(prisma._dmmf)
janpio
Eduardo Del Balso
10/06/2021, 3:59 PMEduardo Del Balso
10/06/2021, 3:59 PMEduardo Del Balso
10/07/2021, 2:40 AMjanpio
Eduardo Del Balso
10/07/2021, 4:09 PMposts
on UserEduardo Del Balso
10/07/2021, 4:22 PM{
data: {
posts: [
{
create: {
data: { ... }
}
}
}
}
When I’m traversing that object in the middleware code, I’d like to look up what the model is for the posts
attribute and what are the names of its fields, so that I can cross-check that with the list of fields on models that should be encrypted, and encrypt them if so.Eduardo Del Balso
10/07/2021, 4:24 PMincome
need to be encrypted because they’re not all PII, it depends on which model has the field named income
Eduardo Del Balso
10/07/2021, 4:27 PM@
directives in the schema, so that we can label each field with @encrypted
or something and then in middleware query for that directive on the field and change the read/write behavior for it, but that’s not supported, so we have a shadow schema that specifies the encryption behavior and we’re trying to glue it all together in middleware, so that we don’t have to implement wrappers around all our crud operations and can keep using prisma as the crud apiEduardo Del Balso
10/08/2021, 6:05 PMjanpio
janpio
janpio
janpio
Eduardo Del Balso
10/08/2021, 7:36 PMEduardo Del Balso
10/08/2021, 7:36 PMEduardo Del Balso
10/08/2021, 7:38 PMjanpio
Eduardo Del Balso
10/13/2021, 5:26 PMEduardo Del Balso
10/13/2021, 5:27 PMjanpio
Eduardo Del Balso
10/13/2021, 9:29 PM