Catalog npm
Back to packageRELEASE DETAILS

1.0.2

npm

3id-test-helper

Generate 3IDs and signers for testing

Published9 Jul 2020
Direct dependencies21
Transitive dependenciesNot calculated

README

Current package documentation

3id Test Helper

A library to generate DIDs and sign Json Web Tokens (JWTs). This library is meant for running tests so that you do not need to log in to your wallet, connect to 3box and then sign JWTs.

Install

Using npm:

$ npm install 3id-test-helper

API

Create the class

const DidHelper = require('3id-test-helper')
const IPFS = require('ipfs')

const ipfs = await IPFS.create()
const testHelper = new DidHelper(ipfs)

Generate DIDs

const accounts = await testHelper.generateAccounts()

When you generate accounts, you create random Ethereum private keys which are used to generate your DIDs.

You can get those private keys and hardcode them in your tests so you can reuse the same DIDs.

const privateKeys = testHelper.getPrivateKeys()
const reusedDIDs = testHelper.generateAccounts(privateKeys)

Signing Json Web Tokens (JWTs)

Important: The did you pass in must have been generated by the class. When the class generates the DIDs, it creates a signer for JWTs.

const jwt = await testHelper.createJWTFromDID(did, payload)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 21

Native requirements
21 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
3id-resolver
Environment
{
  "local_name": "3id-resolver",
  "alias": false,
  "peer_metadata": null
}
^1.0.1runtime
@ethersproject/hdnode
Environment
{
  "local_name": "@ethersproject/hdnode",
  "alias": false,
  "peer_metadata": null
}
^5.0.1runtime
did-jwt
Environment
{
  "local_name": "did-jwt",
  "alias": false,
  "peer_metadata": null
}
^4.4.0runtime
did-resolver
Environment
{
  "local_name": "did-resolver",
  "alias": false,
  "peer_metadata": null
}
^2.0.1runtime
elliptic
Environment
{
  "local_name": "elliptic",
  "alias": false,
  "peer_metadata": null
}
^6.5.3runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.0.4runtime
ipfs
Environment
{
  "local_name": "ipfs",
  "alias": false,
  "peer_metadata": null
}
^0.47.0runtime
ipfs-did-document
Environment
{
  "local_name": "ipfs-did-document",
  "alias": false,
  "peer_metadata": null
}
^1.2.3runtime
js-sha256
Environment
{
  "local_name": "js-sha256",
  "alias": false,
  "peer_metadata": null
}
^0.9.0runtime
store
Environment
{
  "local_name": "store",
  "alias": false,
  "peer_metadata": null
}
^2.0.12runtime
tweetnacl
Environment
{
  "local_name": "tweetnacl",
  "alias": false,
  "peer_metadata": null
}
^1.0.3runtime
tweetnacl-util
Environment
{
  "local_name": "tweetnacl-util",
  "alias": false,
  "peer_metadata": null
}
^0.15.1runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.2.0development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
6.8.0development
eslint-config-standard
Environment
{
  "local_name": "eslint-config-standard",
  "alias": false,
  "peer_metadata": null
}
^14.1.1development
eslint-plugin-import
Environment
{
  "local_name": "eslint-plugin-import",
  "alias": false,
  "peer_metadata": null
}
^2.22.0development
eslint-plugin-mocha
Environment
{
  "local_name": "eslint-plugin-mocha",
  "alias": false,
  "peer_metadata": null
}
^7.0.1development
eslint-plugin-node
Environment
{
  "local_name": "eslint-plugin-node",
  "alias": false,
  "peer_metadata": null
}
^11.1.0development
eslint-plugin-promise
Environment
{
  "local_name": "eslint-plugin-promise",
  "alias": false,
  "peer_metadata": null
}
^4.2.1development
eslint-plugin-standard
Environment
{
  "local_name": "eslint-plugin-standard",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^8.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-mqP7xK8Vmq6BTBofIViM3ifNIwYCNdYIQ/5oDMN5O9Waat6BqbRI/QL6qOZPGN9iQQRUUbQaoRqv78noB+hGuA==",
  "shasum": "d2d90f946e4160d99ebdf44476f36e8f904151d8",
  "tarball": "https://registry.npmjs.org/3id-test-helper/-/3id-test-helper-1.0.2.tgz",
  "fileCount": 8,
  "unpackedSize": 18172,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfBmmGCRA9TVsSAnZWagAAgXwP/10g0+HU3FcMyFMJSPsN\n3GLIkc5C483llf7LzRymJSDN8opJNGR0MbLORu4dRZgVswtu+2IZxfVKH5gL\naDaNZ64IuMoLBld7xqxrOaiTc9PsTLelpJ9sC85aP3ZfkHugJQyQHhWuV79t\n0xmZ6MNITgnT4eVz5fY5y5+Nmy/pecX52rlB3daVLt/gYvoJC0gL6xGRFt/U\nol+XSMvpVvgv8X8JKH3uGNH3U07xFbeeQk/BHLA9nsxHgbYwjQTcjfz/Hjqq\nYm9fgmcKrx+MBDx1KQrPFCcr3ZKHEFQ1jm0naVsJ08xspszYRB2BXtWFBY8g\nbQmhfnFvQrV3pcj2gr+cCD+w5LZnJyAnlNPsoekPSBGogFiQm5WEuFQ47gC/\nwueh0LhBkN/0bY1573gBGGZQF/DtXzLkAsLoQasU3fqJNbD8hDngdt4V0dPm\n0/noWmG4Myv8H+82YiKEYAaQhBx6dyv9LIdO4eSc/2MI7OKF69n+qdEtIzlk\nLfaqVL+0HqS/7xSXWlD8AwUkoeRE/77bR6+XUvzhkyiqJMLinm9sglMxEYUB\n2u21z5iEVagwdWDw07CCkQ/FCBUX+FXr/H0xjP035ZWI1tw8i4M12urB+3mJ\nzNZvjBP5D8vIk828Z478+GQXQRehIV9pBe0sidPwotAODp8Jqq0is5goF2x/\nJ4Be\r\n=5x0x\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQCVXi+XWlSYytRLuXSpv35VWziFFJOmnibayK7iTbYFPgIgYww2jQBixNrWfsLx2o0POuupj2qz7OJwHt5/83OCjmI="
    }
  ]
}

Repository

PENDING
clearrainlabs/3id-test-helpers

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
outpostprotocol/3id-test-helpers

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:46 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e1fb286d4883fa84efdbdc791ea87525700cba51099c74bb79212e02b3cd6880

Other collected versions

1.0.517 Sept1.0.424 Jul1.0.39 Jul1.0.19 Jul1.0.09 JulView all collected versions →