Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@porkchopsandwich/dsn
Advanced tools
DSN URI string parsing and stringifying.
npm install @porkchopsandwich/dsn
import { parse, stringify } from "@porkchopsandwich/dsn";
// Parse a DSN URI into elements
const parsed = parse("mysqli://user:p&ssw!rd@hostname:1234/path/to/entity?extra=1");
// -> { protocol: "mysqli", username: "user", "password": "p&ssw!rd", host: "hostname", port: 1234, path: "path/to/entity", query: URLSearchParams }
// Compile a DSN object into a URI string
const dsnUriString = stringify({
protocol: "arbitrary",
host: "unprotected.host",
path: "path/to/dsn/entity"
});
// -> "arbitrary://unprotected.host/path/to/dsn/entity"
parse(dsnString: string): Dsn | undefined
parse()
takes a string
, and returns either a Dsn
object (see below), or undefined if it does not look like a DSN URI.
The Dsn string must contain a protocol, host and path. It may contain a username, password, port and/or query.
stringify(dsn: Dsn): string
stringify()
takes a Dsn
object (see below) and returns a string
.
The Dsn object must contain a protocol string
, host string
and path string
. It may contain a username string
, password string
, port number
and/or query URLSearchParams
.
Dsn
objectDsn objects are returned by parse()
and taken by stringify()
. They have the following form:
Field | Type | Notes |
---|---|---|
protocol | string | Required |
host | string | Required |
path | string | Required |
username | string | Optional |
password | string | Optional |
host | number | Optional |
query | URLSearchParams | Optional |
FAQs
DSN URI parsing and stringifying
The npm package @porkchopsandwich/dsn receives a total of 0 weekly downloads. As such, @porkchopsandwich/dsn popularity was classified as not popular.
We found that @porkchopsandwich/dsn 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.