Skip to content

Commit

Permalink
fix: maintenance of dependencies, bots and build scripts (decentraliz…
Browse files Browse the repository at this point in the history
…ed-identity#136)

* ci: replace circleci with github workflows

* ci: configure bots

* ci: revise issue templates

* build: adjust build scripts and compiler/linter configs

* chore: update devdeps

* docs: update links in readme
  • Loading branch information
mirceanis committed Jun 24, 2021
1 parent 4cdfe19 commit 0d3fcf7
Show file tree
Hide file tree
Showing 18 changed files with 9,421 additions and 17,200 deletions.
127 changes: 0 additions & 127 deletions .circleci/config.yml

This file was deleted.

17 changes: 12 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
env: {
node: true,
'jest/globals': true
},
extends: [
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['@typescript-eslint', 'jest'],
rules: {}
}
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

Prerequisites
### Prerequisites

Please answer the following questions for yourself before submitting an issue.

Expand Down Expand Up @@ -49,7 +49,7 @@ Please provide any relevant information about your setup. This is important in c

Please include any relevant log snippets or files here.
Create a [GIST](https://gist.github.com) which is a paste of your _full or sanitized_ logs, and link them here.
Do _NOT_ paste your full logs here, as it will make this issue very long and hard to read!
Please do _NOT_ paste your full logs here, as it will make this issue very long and hard to read!

#### Alternatives you considered

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
title: '[proposal]'
labels: enhancement
assignees: ''

---
Expand Down
9 changes: 6 additions & 3 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
daysUntilStale: 70
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- in-progress
- planned-feature
- good-first-issue
- triage
# Label to use when marking an issue as stale
staleLabel: inactive-autoclose
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build, Test and Publish
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
build-test-publish:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}

- run: yarn install --frozen-lockfile

- name: setup git coordinates
run: |
git config user.name uport-automation-bot
git config user.email devops@uport.me
- name: Run semantic-release
env:
GH_TOKEN: ${{secrets.GH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
if: github.ref == 'refs/heads/master'
run: yarn run release
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build and Test NODE
on: [pull_request, workflow_dispatch]
jobs:
build-test:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}

- run: yarn install --frozen-lockfile
- run: yarn run lint
- run: yarn run test:ci
7 changes: 5 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
"changelogFile": "CHANGELOG.md"
}],
"@semantic-release/npm",
"@semantic-release/git",
["@semantic-release/git", {
"assets": ["CHANGELOG.md", "docs", "package.json", "yarn.lock"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
],
"branch": "master"
}
}
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
---
title: "Ethr DID Resolver"
index: 7 category: "ethr-did-resolver"
type: "reference"
source: "https://github.com/decentralized-identity/ethr-did-resolver/blob/develop/README.md"
---
[![npm](https://img.shields.io/npm/dt/ethr-did-resolver.svg)](https://www.npmjs.com/package/ethr-did-resolver)
[![npm](https://img.shields.io/npm/v/ethr-did-resolver.svg)](https://www.npmjs.com/package/ethr-did-resolver)
[![codecov](https://codecov.io/gh/decentralized-identity/ethr-did-resolver/branch/develop/graph/badge.svg)](https://codecov.io/gh/decentralized-identity/ethr-did-resolver)

# ethr DID Resolver

[![codecov](https://codecov.io/gh/decentralized-identity/ethr-did-resolver/branch/develop/graph/badge.svg)](https://codecov.io/gh/decentralized-identity/ethr-did-resolver)
[![CircleCI](https://circleci.com/gh/decentralized-identity/ethr-did-resolver.svg?style=svg)](https://circleci.com/gh/decentralized-identity/ethr-did-resolver)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/7bcde296af8e467787b04c956c2c9f6f)](https://www.codacy.com/manual/uport-project/ethr-did-resolver?utm_source=github.com&utm_medium=referral&utm_content=uport-project/ethr-did-resolver&utm_campaign=Badge_Grade)

This library is intended to use ethereum addresses or secp256k1 publicKeys as fully self-managed
[Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/#decentralized-identifiers-dids) and wrap them in a
[DID Document](https://w3c-ccg.github.io/did-spec/#did-documents)
[Decentralized Identifiers](https://w3c.github.io/did-core/#identifier) and wrap them in a
[DID Document](https://w3c.github.io/did-core/#did-document-properties)

It supports the proposed [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/) spec from the
It supports the proposed [Decentralized Identifiers](https://w3c.github.io/did-core/#identifier) spec from the
[W3C Credentials Community Group](https://w3c-ccg.github.io).

It requires the `did-resolver` library, which is the primary interface for resolving DIDs.
Expand All @@ -38,9 +31,9 @@ represents a distinct identifier than the generic one, with different DID docume

## DID Document

The did resolver takes the ethereum address, looks at contract events and builds a DID document based on the ERC1056 Events
corresponding to the address. When an identifier is a full `publicKey`, the corresponding `ethereumAddress` is computed
and checked in the same manner.
The did resolver takes the ethereum address, looks at contract events and builds a DID document based on the ERC1056
Events corresponding to the address. When an identifier is a full `publicKey`, the corresponding `ethereumAddress` is
computed and checked in the same manner.

The minimal DID document for an ethereum address `0xb9c5714089478a327f09197987f16f9e5d936e8a` with no transactions to
the registry looks like this:
Expand All @@ -60,15 +53,20 @@ the registry looks like this:
"blockchainAccountId": "0xb9c5714089478a327f09197987f16f9e5d936e8a"
}
],
"authentication": ["did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller"],
"assertionMethod": ["did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller"]
"authentication": [
"did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller"
],
"assertionMethod": [
"did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller"
]
}
```

Note this resolver uses the `EcdsaSecp256k1RecoveryMethod2020` type and an `blockchainAccountId` to represent the default
`verificationMethod`, `assertionMethod`, and `authentication` entry.
Any value from the registry that returns an ethereum address will be added to the `verificationMethod` array of the DID
document with type `EcdsaSecp256k1RecoveryMethod2020` and an `blockchainAccountId` attribute containing the address.
Note this resolver uses the `EcdsaSecp256k1RecoveryMethod2020` type and an `blockchainAccountId` to represent the
default
`verificationMethod`, `assertionMethod`, and `authentication` entry. Any value from the registry that returns an
ethereum address will be added to the `verificationMethod` array of the DID document with
type `EcdsaSecp256k1RecoveryMethod2020` and an `blockchainAccountId` attribute containing the address.

## Building a DID document

Expand All @@ -80,8 +78,8 @@ computed.

## Resolving a DID document

The library presents a `resolve()` function that returns a `Promise` returning the DID document. It is not meant to
be used directly but through the [`did-resolver`](https://github.com/decentralized-identity/did-resolver) aggregator.
The library presents a `resolve()` function that returns a `Promise` returning the DID document. It is not meant to be
used directly but through the [`did-resolver`](https://github.com/decentralized-identity/did-resolver) aggregator.

You can use the `getResolver(config)` method to produce an entry that can be used with the `Resolver`
constructor:
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript']
}
Loading

0 comments on commit 0d3fcf7

Please sign in to comment.