
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Creates Joi based object schemas from JSON.
@hapi/joi
implementationInstall via npm.
npm install joi-json --save
Note: @hapi/joi
needs to be installed into your project
const builder = require( 'joi-json' ).builder();
let jsonSchema = {
firstName: 'string:min=1,max=60,required', // string using string-based notation
lastName: { // string using object notation
'@type': 'string',
min: 1,
max: 60,
required: true
},
address: { // address is an object (i.e. joi.object() )
street: 'string:min=1,max=80,required',
street2: 'string:min=1,max=80',
city: 'string:min=1,max=40,required',
state: 'string:min=1,max=40,required',
postal: 'string:min=1,max=20,required',
'@required': true // needs the '@' to indicate that "required" is a property
},
// alternative values (i.e. joi.alternatives().try() )
favNumberOrWord: [
'string:min=1,max=10',
'number:min=0,max=100'
]
};
let schema = builder.build( jsonSchema );
Which would yield the equivalent to the following joi
schema:
const joi = require( '@hapi/joi' );
let schema = {
firstName: joi.string().min(1).max(60).trim().required(),
lastName: joi.string().min(1).max(60).trim().required(),
address: Object.keys( {
street: joi.string().min(1).max(80).trim().required(),
street2: joi.string().min(1).max(80).trim(),
city: joi.string().min(1).max(40).trim().required(),
state: joi.string().min(1).max(40).trim().required(),
postal: joi.string().min(1).max(20).trim().required()
}).required(),
favNumberOrWord: [
joi.string().min(1).max(10).trim(),
joi.number().min(1).max(100)
]
};
For information on how to use Joi-JSON, please see our API documentation
We'd love to get feedback on how to make this tool better. Feel free to contact us at feedback@vandium.io
4.0.0 (2019-12-04)
Breaking:
@hapi
organization. This version
will no longer support the previous joi
package. Be sure to include a dependency
of @hapi/joi
in your project dependencies.FAQs
Builds Joi schemas from JSON objects
The npm package joi-json receives a total of 3,064 weekly downloads. As such, joi-json popularity was classified as popular.
We found that joi-json 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.