npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@digitalbazaar/security-document-loader

v3.0.0

Published

A JSON-LD documentLoader library pre-loaded with core commonly used contexts (suites, VC, DIDs).

Downloads

6,987

Readme

Core JSON-LD securityLoader (@digitalbazaar/security-document-loader)

Build Status Coverage Status NPM Version

A JSON-LD documentLoader library pre-loaded with commonly used security contexts (suites, VC, DIDs).

Table of Contents

Background

This is useful for unit tests, in Node.js and the browser. It includes several core contexts and DID resolvers that you might want when testing applications involving Verifiable Credentials, did:key or Veres One DIDs, as well as Ed25519 signing and verifying.

Note: This library plays a similar role to bedrock-security-context, but is intended for not just Bedrock style applications, but also for isomorphic libs, etc.

Included contexts:

  • https://www.w3.org/ns/did/v1 DID Core Context v1
  • https://w3id.org/veres-one/v1 Veres One DID Method Context v1
  • https://www.w3.org/2018/credentials/v1 Verifiable Credentials v1
  • https://w3id.org/security/suites/ed25519-2020/v1 Ed25519Signature2020 Crypto Suite
  • https://w3id.org/security/suites/x25519-2020/v1 X25519VerificationKey2020 Crypto Suite

Included DID Method drivers:

Other required contexts and did drivers can easily be added (see Usage section below).

Security

TBD

Install

  • Node.js 14+ is required.

NPM

To install via NPM:

npm install --save @digitalbazaar/security-document-loader

Development

To install locally (for development):

git clone https://github.com/digitalbazaar/security-document-loader.git
cd security-document-loader
npm install

Usage

The core document loader is easily extensible. For example, to add more contexts:

import {securityLoader} from '@digitalbazaar/security-document-loader';

import secCtx from '@digitalbazaar/security-context';
import webkmsCtx from 'webkms-context';
import zcapCtx from 'zcap-context';

const loader = securityLoader()
loader.addStatic(
  secCtx.SECURITY_CONTEXT_V2_URL,
  secCtx.contexts.get(secCtx.SECURITY_CONTEXT_V2_URL)
);
loader.addStatic(webkmsCtx.CONTEXT_URL, webkmsCtx.CONTEXT);
loader.addStatic(zcapCtx.CONTEXT_URL, zcapCtx.CONTEXT);

const documentLoader = loader.build();

Adding did resolvers

By default, securityLoader uses did-io's CachedResolver as a harness for multiple DID method drivers, and supports the did-method-key driver.

To add another did method driver to it:


import {securityLoader} from '@digitalbazaar/security-document-loader';
const loader = securityLoader()

loader.protocolHandlers.get('did').use(didMethodDriver);

Contribute

See the contribute file!

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

Commercial Support

Commercial support for this library is available upon request from Digital Bazaar: [email protected]

License

New BSD License (3-clause) © Digital Bazaar