
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.
A lightweight solution to use a cloud Key-Value database based on github.com.
npm install freedb --save
See BUILD.md.
import Free from 'freedb';
const kv = new Free.KV({
// This is my public test account and token, only used for test and CI.
// If you want to have your own database,
// Then you need to create a repository and generate a token.
host: 'git@github.com:Gcaufy-Test/test-database.git',
token: 'your_github_repo_token'
});
kv.set('mykey', 'myvalue').then(res => {
console.log(res.raw_url);
});
Create a KV instance
new Free.KV(option: DataBaseOption):
DataBaseOption {
// host: github clone links, support both https/ssh links
host: string;
// token: OAuth token, make sure you have read/write access for the repo
token: string;
// db: Basiclly it's a directory, default value is "default"
db?: string;
// branch: git branch, default value is "master"
branch?: string;
// cipher: if is a string, then treat as a secret key for aes192 for both key and value. or you can customize a encryt and decrypt function
cipher?: CipherOption | string;
// debug: show action log or not.
debug?: boolean;
}
CipherOption {
// secret key for encrypt
secret: string;
// customize encrypt algorithm, default value is ase192 encrypt algorithm
encode: (str: string): string;
// customize decrypt algorithm, default value is ase192 decrypt algorithm
decode: (str: string): string;
}
KV instance methods
Switch database. can be a non-exist database.
List all keys in current database;
Check a key exist or not in current database;
Get a key record in current database;
Set a value for a key. Will create a key if a key do not exist;
Append a value for a key. Will create a key if a key do not exist;
KeyRecord {
// Key content
content?: string;
// Key name
name?: string;
// Key content size, if the key do not exist, then size = -1
size?: number;
// Key git raw url
raw_url?: string;
// Key git html url
html_url?: string;
// Key git commit hash if there is
commit?: string;
}
There are two way to protect your data.
CipherOption
new GitDB.KV({
host: 'git@github.com:Gcuafy-Test/test-database',
token: 'mytoken',
cipher: {
secret: 'my secret key',
// Default value is using ase192 encrypt algorithm
encode (str) {
return MyEncryptMethod(str);
},
// Default value is using ase192 decrypt algorithm
decode (str) {
return MyDecryptMethod(str);
}
}
})
FAQs
Key-Value Database based on github.com
The npm package freedb receives a total of 1 weekly downloads. As such, freedb popularity was classified as not popular.
We found that freedb 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.