
Security News
Socket Integrates With Bun 1.3’s Security Scanner API
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
@linode/validation
Advanced tools
This library consists of Yup schemas corresponding to the endpoints of the
Linode API, intended to be used for client-side validation.
They closely (though not exactly) match the validation that is run by the API back-end when a
request is received. They can be used to validate API request payloads manually or to validate forms (for example through
Formik’s validationSchema
). They also work well with the @linode/api-v4 package.
import { CreateLinodeSchema } from '@linode/validation';
const payload = { label: 'My Linode', type: 'g6-standard-1' };
CreateLinodeSchema.validateSync(payload);
// Uncaught: u [ValidationError]: Region is required.
NOTE: This feature is in development.
import { createLinode } from '@linode/api-v4';
import { CreateLinodeSchema } from '@linode/validation';
const payload = { label: 'My Linode', type: 'g6-standard-1' };
createLinode(payload, { schema: CreateLinodeSchema }).catch((error) => {
console.log(error);
});
// { field: 'region', reason: 'Region is required.' }
These schemas were originally included in the @linode/api-v4 package by default, and automatically applied before any network request was made. This worked well in the early days of Cloud Manager, especially before @linode/api-v4 was published as a separate package. However, as the project grew, this setup caused a few problems:
FAQs
Yup validation schemas for use with the Linode APIv4
The npm package @linode/validation receives a total of 545 weekly downloads. As such, @linode/validation popularity was classified as not popular.
We found that @linode/validation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.