Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@proxyco/web-did-resolver
Advanced tools
This library is intended to represent domains accessed through https as Decentralized Identifiers and retrieve an associated DID Document
It supports the proposed did:web
method spec from
the W3C Credentials Community Group.
It requires the did-resolver
library, which is the primary interface for resolving DIDs.
To encode a DID for an HTTPS domain, simply prepend did:web:
to domain name.
eg: https://example.com -> did:web:example.com
The DID resolver takes the domain and forms a well-known URI to access the DID Document.
For a did did:web:example.com
, the resolver will attempt to access the document at
https://example.com/.well-known/did.json
A minimal DID Document might contain the following information:
{
"@context": "https://w3id.org/did/v1",
"id": "did:web:example.com",
"publicKey": [
{
"id": "did:web:example.com#owner",
"type": "Secp256k1VerificationKey2018",
"controller": "did:web:example.com",
"publicKeyHex": "04ab0102bcae6c7c3a90b01a3879d9518081bc06123038488db9cb109b082a77d97ea3373e3dfde0eccd9adbdce11d0302ea5c098dbb0b310234c8689501749274"
}
],
"assertionMethod": [ "did:web:example.com#owner" ],
"authentication": [ "did:web:example.com#owner" ]
}
Note: this example uses the Secp256k1VerificationKey2018
type and an publicKeyHex
as a publicKey entry, signaling
that this DID is claiming to control the private key associated with that publicKey.
The resolver presents a simple resolver()
function that returns a ES6 Promise returning the DID document.
import { Resolver } from 'did-resolver'
import { getResolver } from 'web-did-resolver'
const webResolver = getResolver()
const didResolver = new Resolver({
...webResolver
//...you can flatten multiple resolver methods into the Resolver
})
didResolver.resolve('did:web:uport.me').then(doc => console.log(doc))
// You can also use ES7 async/await syntax
;(async () => {
const doc = await didResolver.resolve('did:web:uport.me')
console.log(doc)
})();
FAQs
Resolve DID documents from an https domain
The npm package @proxyco/web-did-resolver receives a total of 0 weekly downloads. As such, @proxyco/web-did-resolver popularity was classified as not popular.
We found that @proxyco/web-did-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.