Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest crypto-ld and jsigs api. #83

Merged
merged 32 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e8551d6
Update to latest crypto-ld and jsigs api.
dmitrizagidulin Aug 10, 2020
9b57766
Update workflow.
davidlehn Aug 23, 2020
b8ff019
Fix coverage output.
davidlehn Aug 23, 2020
e91e7b8
Update dependencies.
davidlehn Aug 23, 2020
1008b99
Fix lint issues.
davidlehn Aug 23, 2020
7de89b5
Update API usage.
davidlehn Aug 23, 2020
e3d86d7
Remove testing on Node.js 10.x.
davidlehn Aug 23, 2020
dcfff1f
Remove bin/, rename test/ dir, update copyright.
dmitrizagidulin Mar 8, 2021
35c4e67
Remove unused mocha.opts.
dmitrizagidulin Mar 8, 2021
594a995
Update to latest packages.
dmitrizagidulin Mar 18, 2021
e54badb
Set up lint, fix mocha script.
dmitrizagidulin Mar 18, 2021
14da26b
Update karma config.
dmitrizagidulin Mar 18, 2021
ebcf94b
Extract dateRegex tests to separate file.
dmitrizagidulin Mar 18, 2021
f6b516c
Update to latest published packages.
dmitrizagidulin Mar 19, 2021
df98546
Update checking for issuer and controller in validate.
dmitrizagidulin Mar 25, 2021
9d631fd
Update jsonld* deps.
dlongley Apr 21, 2021
279ec76
Re-enable tests.
dlongley Apr 21, 2021
b6afc94
Fix linting errors.
dlongley Apr 21, 2021
6bf79ec
Update to latest suite packages.
dmitrizagidulin Apr 21, 2021
bf34996
Setup nyc options.
davidlehn Apr 21, 2021
b0a14ac
Fix karma testing.
davidlehn Apr 21, 2021
1b6af76
Update DID doc context URL.
dlongley Apr 21, 2021
3cbae0b
Ensure mock DID Doc loader only loads the DID Doc/keys in it.
dlongley Apr 21, 2021
a5c7ce4
Update dist files.
davidlehn Apr 21, 2021
e442571
Remove typescript def generation support.
davidlehn Apr 21, 2021
34de705
No longer ship browser bundles.
davidlehn Apr 21, 2021
6f7d1ca
Remove unused 'esm' dependency.
davidlehn Apr 21, 2021
c3485ac
Rename package to `@digitalbazaar/vc`.
davidlehn Apr 21, 2021
f0a70c3
Fix typo.
davidlehn Apr 21, 2021
1861112
Fix typo.
davidlehn Apr 21, 2021
07eff2b
Fix badge links.
davidlehn Apr 21, 2021
f3ec4eb
Update changelog.
davidlehn Apr 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
/*!
* Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
*/
module.exports = {
root: true,
extends: [
'eslint-config-digitalbazaar',
// 'eslint-config-digitalbazaar/jsdoc'
],
env: {
node: true
},
extends: [
'digitalbazaar',
'digitalbazaar/jsdoc'
],
ignorePatterns: ['dist/']
parserOptions: {
// this is required for dynamic import()
ecmaVersion: 2020
},
ignorePatterns: ['node_modules', 'dist'],
rules: {
'jsdoc/check-examples': 0,
'jsdoc/require-description-complete-sentence': 0
}
};
22 changes: 10 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on: [push]
jobs:
test-node:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -17,29 +18,27 @@ jobs:
- run: npm install
- name: Run test with Node.js ${{ matrix.node-version }}
run: npm run test-node
env:
CI: true
test-karma:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run karma tests
- name: Run karma test
run: npm run test-karma
env:
CI: true
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -52,9 +51,10 @@ jobs:
coverage:
needs: [test-node, test-karma]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [12.x]
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -64,10 +64,8 @@ jobs:
- run: npm install
- name: Generate coverage report
run: npm run coverage-ci
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.lcov
file: ./coverage/lcov.info
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion BACKGROUND.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## `vc-js` Background Documentation
## `@digitalbazaar/vc` Background Documentation

See also (related specs):

Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# vc-js ChangeLog
# @digitalbazaar/vc ChangeLog

## 1.0.0 - 2021-xx-xx

### Changed
- **BREAKING**: Rename library to `@digitalbazaar/vc`.
- Update dependencies.

### Removed
- **BREAKING**: Remove typescript def generation support.
- **BREAKING**: No longer shipping browser bundles.
- **BREAKING**: Move binaries from `bin/` to `@digitalbazaar/vc-js-cli`.

## 0.6.4 - 2020-05-22

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2020, Digital Bazaar, Inc.
Copyright (c) 2017-2021, Digital Bazaar, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Verifiable Credentials JS Library _(vc-js)_
# Verifiable Credentials JS Library _(@digitalbazaar/vc)_

[![Build Status](https://travis-ci.org/digitalbazaar/vc-js.png?branch=master)](https://travis-ci.org/digitalbazaar/vc-js)
[![NPM Version](https://img.shields.io/npm/v/vc-js.svg?style=flat-square)](https://npm.im/vc-js)
[![Build Status](https://img.shields.io/github/workflow/status/digitalbazaar/vc-js/Node.js%20CI)](https://github.com/digitalbazaar/vc-js/actions?query=workflow%3A%22Node.js+CI%22)
[![NPM Version](https://img.shields.io/npm/v/@digitalbazaar/vc.svg)](https://npm.im/@digitalbazaar/vc)

> A Javascript library for issuing and verifying Verifiable Credentials
> A Javascript library for issuing and verifying Verifiable Credentials.

## Table of Contents

Expand Down Expand Up @@ -48,8 +48,7 @@ the following:

## Install

- Node.js 8.3+ required.
- Node.js 10.12.0+ is highly recommended due to RSA key generation speed.
- Node.js 12+ required.

To install locally (for development):

Expand All @@ -61,6 +60,24 @@ npm install

## Usage

### Setting up a signature suite

For signing, when setting up a signature suite, you will need to pass in
a key pair containing a private key.

```js
import vc from '@digitalbazaar/vc';

// Required to set up a suite instance with private key
import {Ed25519VerificationKey2020} from
'@digitalbazaar/ed25519-verification-key-2020';
import {Ed25519Signature2020} from '@digitalbazaar/ed25519-signature-2020';

const keyPair = await Ed25519VerificationKey2020.generate();

const suite = new Ed25519Signature2020({key: keyPair});
```

### Issuing a Verifiable Credential

Pre-requisites:
Expand All @@ -71,7 +88,7 @@ Pre-requisites:
Document and Public Key

```js
const vc = require('vc-js');
const vc = require('@digitalbazaar/vc');

// Sample unsigned credential
const credential = {
Expand Down Expand Up @@ -103,7 +120,7 @@ Pre-requisites:
* (Recommended) You have a strategy for where to publish your Controller
Documents and Public Keys

#### Creating an Unsigned Presentation
#### Creating an unsigned presentation

To create a presentation out of one or more verifiable credentials, you can
use the `createPresentation()` convenience function. Alternatively, you can
Expand Down Expand Up @@ -182,8 +199,8 @@ Pre-requisites:
// contexts are loaded from jsonld-signatures
// and not an insecure source.
const {extendContextLoader} = require('jsonld-signatures');
const vc = require('vc-js');
// vc-js exports its own secure documentLoader.
const vc = require('@digitalbazaar/vc');
// @digitalbazaar/vc exports its own secure documentLoader.
const {defaultDocumentLoader} = vc;
// a valid json-ld @context.
const myCustomContext = require('./myCustomContext');
Expand Down
Loading