Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@cerbos/orm-prisma
Advanced tools
An adapater library that takes a [Cerbos](https://cerbos.dev) Query Plan ([PlanResources API](https://docs.cerbos.dev/cerbos/latest/api/index.html#resources-query-plan)) response and converts it into a [Prisma](https://prisma.io) where class object. This
An adapater library that takes a Cerbos Query Plan (PlanResources API) response and converts it into a Prisma where class object. This is designed to work alongside a project using the Cerbos Javascript SDK.
The following conditions are supported: and
, or
, eq
, ne
, lt
, gt
, lte
, gte
and in
.
npm install @cerbos/orm-prisma
This package exports a single function:
queryPlanToPrisma({ queryPlan, fieldNameMapper }): PrismaCondition
The function reqiures the full query plan from Cerbos to be passed in an object along with a fieldNameMapper
.
The fieldNameMapper
is used to convert the field names in the query plan response to names of fields in the Prisma model - this can be done as a map or a function:
{
"request.resource.attr.aFieldName": "prismaModelFieldName"
}
//or
(fieldName: string): string => {
if(fieldName.indexOf("request.resource.") > 0) {
return fieldName.replace("request.resource.attr", "")
}
if(fieldName.indexOf("request.principal.") > 0) {
return fieldName.replace("request.principal.attr", "")
}
}
A full Prisma application making use of this adapater can be found at https://github.com/cerbos/express-prisma-cerbos
FAQs
An adapter library that takes a [Cerbos](https://cerbos.dev) Query Plan ([PlanResources API](https://docs.cerbos.dev/cerbos/latest/api/index.html#resources-query-plan)) response and converts it into a [Prisma](https://prisma.io) where class object. This i
The npm package @cerbos/orm-prisma receives a total of 3,996 weekly downloads. As such, @cerbos/orm-prisma popularity was classified as popular.
We found that @cerbos/orm-prisma demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.