Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@steemfans/auth-data
Advanced tools
This SDK is for the users who want to use steem user's private key to sign data to auth user identity without jsonrpc.
If you are using jsonrpc as your api protocol, you could refer to this SDK => https://github.com/steemit/rpc-auth or this SDK => https://github.com/steemit/koa-jsonrpc.
import { signData } from '@steemfans/auth-data';
// This is the data what you want to submit to server
const data = {
username: 'test',
avatar: '1.png',
};
// This is steem user's posting private key.
const privKeyOfTestUser = '5JP**********tH';
// sign the data
const signedData = signData(data, privKeyOfTestUser);
// submit the signedData
axios.post(url, signedData);
import { authData } from '@steemfans/auth-data';
// get the submited data
const data = JSON.parse(this.request.body);
// get user's public key. the `getUserPublicKey` need be written by yourself.
const pubKey = yield getUserPublicKey(data.username, 'posting');
// auth the data
if (!authData(data, pubKey)) {
throw Error('the signature is incorrect.');
}
If you want to use active key to sign data, you can add auth_type
to the data
to point which key you are using.
import { signData } from '@steemfans/auth-data';
// This is the data what you want to submit to server
const data = {
username: 'test',
avatar: '1.png',
auth_key: 'active',
};
// This is steem user's active private key.
const privKeyOfTestUser = '5JP**********tH';
// sign the data
const signedData = signData(data, privKeyOfTestUser);
// submit the signedData
axios.post(url, signedData);
import { authData } from '@steemfans/auth-data';
// get the submited data
const data = JSON.parse(this.request.body);
// get user's public key. the `getUserPublicKey` need be written by yourself.
const pubKey = yield getUserPublicKey(data.username, data.auth_key);
// auth the data
if (!authData(data, pubKey)) {
throw Error('the signature is incorrect.');
}
If you have any issue, please be easy to submit on the issue page.
FAQs
To sign and auth data without a json-rpc way.
The npm package @steemfans/auth-data receives a total of 10 weekly downloads. As such, @steemfans/auth-data popularity was classified as not popular.
We found that @steemfans/auth-data 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.