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

Refactor to use new crypto-ld and jsigs api. #50

Merged
merged 22 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 9 additions & 11 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,13 +18,12 @@ 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 }}
Expand All @@ -33,13 +33,12 @@ jobs:
- run: npm install
- name: Run karma tests
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
125 changes: 125 additions & 0 deletions CHANGELOG-ocapld.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# ocapld ChangeLog

### Note
- **BREAKING**: Changed package name from `ocapld` to `@digitalbazaar/zcapld`.
- See the [`zcapld` changelog](./CHANGELOG.md) for newer changes.

## 2.0.0 - 2020-04-02

### Changed
- **BREAKING**: An `invocationTarget` must be specified in all delegations.
- Improve test coverage.

### Fixed
- Properly validate `allowedAction` in capabilities.

### Added
- Add verification of `expires` as a core feature.
- Add the ability to specificy a `maxChainLength` when verifying capability
delegations.
- Add an optional `allowTargetAttenuation` flag which allows the
`invocationTarget` of a delegation chain to be increasingly restrictive
based on a hierarchical RESTful URL structure.

## 1.8.0 - 2020-02-14

### Changed

- Use jsonld-signatures@5.

## 1.7.0 - 2020-02-07

### Added
- Implement validation for embedded capabilities in `capabilityChain`.

## 1.6.1 - 2020-01-30

### Fixed
- Adjust the parameters to `inspectCapabilityChain` to support more general
use cases. See in-line documentation for parameter details.

## 1.6.0 - 2020-01-29

### Added
- Add an optional `inspectCapabilityChain` parameter to `CapabilityDelegation`
and `CapabilityInvocation`. `inspectCapabilityChain` must be an async
function used to check the capability chain. It can, for instance, be used
to find revocations related to any of the capabilities in the chain.

## 1.5.1 - 2020-01-29

### Fixed
- Address issues in `verifyCapabilityChain` helper that resulted in some
proofs not being properly verified.

## 1.5.0 - 2020-01-09

### Added
- Support multiple values for `expectedTarget` and `expectedRootCapability`
for use cases such as where capabilities are given for reading/writing
any item in a collection instead of only individual items.

## 1.4.0 - 2019-10-08

### Changed
- Use [email protected] Use with support for Node 12 native Ed25519
crypto.

## 1.3.1 - 2019-08-11

### Fixed
- Handle case where a capability lists list multiple
controllers/invokers/delegators.

## 1.3.0 - 2019-07-17

### Added
- Add `expectedRootCapability` to allow a root capability to
specify an `invocationTarget` different from its `id`. This
allows zcaps to be used to manage authority for resources
that cannot express their own zcap authority information
such as binary files or resources that use JSON or JSON-LD
but, for whatever reason, cannot express `controller`,
`invoker`, `delegator`, or key information.

## 1.2.1 - 2019-06-29

### Fixed
- Check `allowedAction` against expected `capabilityAction`.
- Fix expected action check.
- Fix capability chain check.
- Ensure root caps are dereferenced and have a valid target.
- Handle case where `invocationTarget` is an object.

## 1.2.0 - 2019-05-17

### Added
- Support `controller` on capabilities as `delegator` and `invoker`.

### Changed
- Update webpack and babel.
- Switch to eslint.

## 1.1.0 - 2019-03-27

### Changed
- Upgrade jsonld-signatures to version 4.

## 1.0.2 - 2019-01-03

### Fixed
- Change jsonld-signatures to a regular dependency.

## 1.0.1 - 2019-01-03

### Fixed
- Distribute webpack built dist files.

## 1.0.0 - 2019-01-03

### Changed
- Use webpack 'externals' for jsonld and jsonld-signatures.

## 0.1.0 - 2019-01-02
- Initial release.
- See git history for changes.
135 changes: 17 additions & 118 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,20 @@
# ocapld ChangeLog
# @digitalbazaar/zcapld ChangeLog

## 2.0.0 - 2020-04-02
## 1.0.0 - 2021-xx-xx

### Changed
- **BREAKING**: An `invocationTarget` must be specified in all delegations.
- Improve test coverage.

### Fixed
- Properly validate `allowedAction` in capabilities.

### Added
- Add verification of `expires` as a core feature.
- Add the ability to specificy a `maxChainLength` when verifying capability
delegations.
- Add an optional `allowTargetAttenuation` flag which allows the
`invocationTarget` of a delegation chain to be increasingly restrictive
based on a hierarchical RESTful URL structure.

## 1.8.0 - 2020-02-14

### Changed

- Use jsonld-signatures@5.

## 1.7.0 - 2020-02-07

### Added
- Implement validation for embedded capabilities in `capabilityChain`.

## 1.6.1 - 2020-01-30

### Fixed
- Adjust the parameters to `inspectCapabilityChain` to support more general
use cases. See in-line documentation for parameter details.

## 1.6.0 - 2020-01-29

### Added
- Add an optional `inspectCapabilityChain` parameter to `CapabilityDelegation`
and `CapabilityInvocation`. `inspectCapabilityChain` must be an async
function used to check the capability chain. It can, for instance, be used
to find revocations related to any of the capabilities in the chain.

## 1.5.1 - 2020-01-29

### Fixed
- Address issues in `verifyCapabilityChain` helper that resulted in some
proofs not being properly verified.

## 1.5.0 - 2020-01-09

### Added
- Support multiple values for `expectedTarget` and `expectedRootCapability`
for use cases such as where capabilities are given for reading/writing
any item in a collection instead of only individual items.

## 1.4.0 - 2019-10-08

### Changed
- Use [email protected] Use with support for Node 12 native Ed25519
crypto.

## 1.3.1 - 2019-08-11

### Fixed
- Handle case where a capability lists list multiple
controllers/invokers/delegators.

## 1.3.0 - 2019-07-17

### Added
- Add `expectedRootCapability` to allow a root capability to
specify an `invocationTarget` different from its `id`. This
allows zcaps to be used to manage authority for resources
that cannot express their own zcap authority information
such as binary files or resources that use JSON or JSON-LD
but, for whatever reason, cannot express `controller`,
`invoker`, `delegator`, or key information.

## 1.2.1 - 2019-06-29

### Fixed
- Check `allowedAction` against expected `capabilityAction`.
- Fix expected action check.
- Fix capability chain check.
- Ensure root caps are dereferenced and have a valid target.
- Handle case where `invocationTarget` is an object.

## 1.2.0 - 2019-05-17

### Added
- Support `controller` on capabilities as `delegator` and `invoker`.

### Changed
- Update webpack and babel.
- Switch to eslint.

## 1.1.0 - 2019-03-27

### Changed
- Upgrade jsonld-signatures to version 4.

## 1.0.2 - 2019-01-03

### Fixed
- Change jsonld-signatures to a regular dependency.

## 1.0.1 - 2019-01-03

### Fixed
- Distribute webpack built dist files.

## 1.0.0 - 2019-01-03

### Changed
- Use webpack 'externals' for jsonld and jsonld-signatures.

## 0.1.0 - 2019-01-02
- Initial release.
- See git history for changes.
- **BREAKING**: Changed package name from `ocapld` to `@digitalbazaar/zcapld`.
- **BREAKING**: Resetting version to `1.0.0`.
- **BREAKING**: Only support Node.js >=12.
- Update dependencies.
- Use new `@digitalbazaar/ed25519-signature-2018` and
`@digitalbazaar/ed25519-verification-key-2018` dependencies for testing.

### Removed
- **BREAKING**: Remove `bitcore-message` dependency. It's for a specialized use
case.
- **BREAKING**: Remove browser bundles.

### Previous ocapld ChangeLog
- This package was renamed from `ocapld`.
See the [`ocapld` changelog](./CHANGELOG-ocapld.md) for earlier changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018, Digital Bazaar, Inc.
Copyright (c) 2018-2021, Digital Bazaar, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
Loading