
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@nosana/schema-validator
Advanced tools
Simple to use library to validate Nosana Pipeline Schemas. You can learn more about the pipeline at Nosana Pipeline documentation.
The schema can be found at src/schema.ts.
When this library is bundled as ESM, types are also included.
Install:
npm i @nosana-ci/schema-validator
There are two functions available for use:
validateJson
validateYaml
Example:
import { validateJson } from '@nosana-ci/schema-validator'
const nosana_pipeline = {
"global": {
"image": "registry.hub.docker.com/library/node:16",
"trigger": {
"branch": [
"main"
]
}
},
"jobs": [
{
"name": "install-deps and run test",
"commands": [
"npm ci",
"npm run test"
]
}
]
}
validateJson(nosana_pipeline)
// => { valid: true, errors: []}
It is also possible to validate a YAML file:
const yaml = `
global:
image: registry.hub.docker.com/library/cljkondo/clj-kondo
trigger:
branch:
- main
environment:
DEBIAN_FRONTEND: noninteractive
jobs:
- name: install and build container
commands:
- env
- clj-kondo --lint src --dependencies --parallel --copy-configs
- git submodule init
- git submodule update
`
validateYaml(yaml)
// => { valid: true, errors: []}
If the schema is invalid, the errors will be returned.
The instancePath
will be the path to the invalid property and the message
will be the reason why it is invalid.
const nosana_pipeline ={
"global": {
"image": "registry.hub.docker.com/library/node:16",
"trigger": {
"branch": [
"main"
]
}
},
"jobs": [
{
"name": "install-deps and run test",
"commands": {
"one": "npm ci",
"two": "npm run test"
}
}
]
}
validateJson(nosana_pipeline)
/* => validated {
valid: false,
errors: [
{
instancePath: '/jobs/0/commands',
schemaPath: '#/properties/jobs/items/properties/commands/type',
keyword: 'type',
params: [Object],
message: 'must be array',
schema: 'array',
parentSchema: [Object],
data: [Object]
}
],
*/
FAQs
To install dependencies:
We found that @nosana/schema-validator demonstrated a not healthy version release cadence and project activity because the last version was released 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.