Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@privy-io/public-api
Advanced tools
The zod README is full of inconsistencies - in one place it will use camelCase and in another PascalCase for the same thing. Because of this, chaos reigns, so we have our own guide.
Whether it's z.string
or z.object
or anywhere in between, name it with PascalCase. Easier than creating heuristics.
Input
if used for parsing req.body
If the schema is used to parse req.body
in an API handler, suffix with Input
(ie CreateUserInput
). This is relevant as you should not inherently rely on these types except in the context of the API handler, as the API handler signature may change.
Type
if exporting a typeWhen feeding into a TypeScript type, always suffix with Type
(ie CreateUserInputType
). The Zod docs imply that you can somehow overload a zod type name with a TypeScript type, but this does not work in practice.
For creating types, you simply use z.infer
:
type ImportAppleAccountInputType = z.infer<typeof ImportAppleAccountInput>;
Just group logically and we'll revisit as it becomes untenable 🤷
If a schema is only used in a single API handler, it's discretionary whether to pull the schema out. We'll have to do this anyway if/when we do OpenAPI specs, so do what feels cleanest. If they are used anywhere outside of it, move it to lib/schemas
.
FAQs
Unknown package
The npm package @privy-io/public-api receives a total of 24,388 weekly downloads. As such, @privy-io/public-api popularity was classified as popular.
We found that @privy-io/public-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.