Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@synonymdev/slashauth
Advanced tools
SlashAuth is a Slashtags protocol for authorization over a Slashtag's connection.
Once authentication is done both sides share a private encrypted drives dedicated to each other, and can exchange data over, as an asynchronous communication channel.
npm i @synonymdev/slashtag @synonymdev/slashauth
import { Slashtag } from '@synonymdev/slashtag';
import { SlashAuth } from '@synonymdev/slashauth';
const initiator = new Slashtag({
keyPair: Slashtag.createKeyPair(),
protocols: { SlashAuth },
});
// Responder's wallet will have access to the initiator's profile
await initiator.setProfile({ name: 'Alice' });
// Access the protocol instance from anywhere in the application
const auth = slashtag.protocol(SlashAuth);
// After getting the slashauth:// url from the Responder,
// you can use it to read the Responder's profile
const responder = sdk.slashtag({ url: slashauthURL });
// Get the server's profile if it exists, so you can ask
// user for confirmation to authenticate to that Responder
const profile = await serverSlashtag.getProfile();
auth.once('error', errorHandler);
// On success, Initiator will get the details of the Drive that
// the Responder created for the Initiator
auth.once('success', ({ drive }) => {
// Success handler
});
// Connect to the server and send the token in the url `?q=<token>`
auth.request(url);
import { Slashtag } from '@synonymdev/slashtag';
import { SlashAuth } from '@synonymdev/slashauth';
const responder = new Slashtag({
keyPair: Slashtag.createKeyPair(),
protocols: { SlashAuth },
});
// Initiator's wallet will have access to the Responder's profile
await responder.setProfile({ name: 'Bob' });
const auth = slashtag.protocol(SlashAuth);
auth.on('request', async ({ token, peerInfo, drive }, response) => {
// Try resolving user's profile from their Slashtag
const initiator = request.peerInfo.slashtag;
// The Responder can send either a success or error message
try {
authorize(request.token, initiator);
response.success();
} catch (e) {
response.error(e.message);
}
});
// Listen on the Slashtag.key
await slashtag.listen();
function authorize(token, initiator) {
// Check the token against server's sessions, clientIDs, etc.
// Check if the user is already registered, blocked, etc.
}
// Generate a slashauth:// url and pass it to the initiator
// token can be a random string, or a session token or a clientID, etc.
SlashAuth.formatURL(slashtag.url, token);
Before any of the SlashAuth's messages are exchanged, the Initiator and Responder are already connected over a secure connection using Noise Protocol.
More about Slashtags connections here.
So both the Initiator's and Responder's keys are already known and all subsequent communication is trusted.
This protocol adds two features:
Contacts
Initiator 'Alice' wants to establish a connection to Responder 'Bob'.
slashauth:
, Bob's base32 encoding publicKey, and a unique token for this session.Once the request is accepted, now both Alice and Bob add each other as contacts, with drives for Incoming and Outgoing asynchronous messages.
Login & Registration
FAQs
Authorization using slashtags
The npm package @synonymdev/slashauth receives a total of 0 weekly downloads. As such, @synonymdev/slashauth popularity was classified as not popular.
We found that @synonymdev/slashauth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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.