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

feat: Support v2 protos #91

Merged
merged 7 commits into from
Jan 30, 2023
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
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ updates:

# Maintain dependencies for NPM
- package-ecosystem: "npm"
target-branch: "develop"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for Docker
- package-ecosystem: "docker"
target-branch: "develop"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for Golang
- package-ecosystem: "gomod"
target-branch: "develop"
directory: "/"
schedule:
interval: "weekly"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cleanup-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
description: 'Retain days'
required: true
type: string
default: 30
default: "30"
minimum_runs:
description: 'Minimum runs to keep for each workflow'
required: true
type: string
default: 0
default: "0"
delete_workflow_pattern:
description: 'Name/filename of workflow. Default is all.'
required: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
Expand All @@ -63,7 +63,7 @@ jobs:
id: set-version
run: |
VERSION=$( git describe --tags ${{ github.sha }})
echo ::set-output name=VERSION::"$VERSION"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"

release-docker:
name: "Release Docker image"
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/cheqd/did-resolver?include_prereleases&label=dev%20release&style=flat-square)](https://github.com/cheqd/did-resolver/releases/) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/cheqd/did-resolver/latest?style=flat-square) [![GitHub contributors](https://img.shields.io/github/contributors/cheqd/did-resolver?label=contributors%20%E2%9D%A4%EF%B8%8F&style=flat-square)](https://github.com/cheqd/did-resolver/graphs/contributors)

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cheqd/did-resolver/Workflow%20Dispatch?label=workflows&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/dispatch.yml) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/cheqd/did-resolver/CodeQL?label=CodeQL&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/codeql.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/did-resolver?style=flat-square)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cheqd/did-resolver/dispatch.yml?label=workflows&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/dispatch.yml) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/cheqd/did-resolver/codeql.yml?label=CodeQL&style=flat-square)](https://github.com/cheqd/did-resolver/actions/workflows/codeql.yml) ![GitHub repo size](https://img.shields.io/github/repo-size/cheqd/did-resolver?style=flat-square)

## ℹ️ Overview

Expand Down Expand Up @@ -73,6 +73,10 @@ RESOLVER_LISTNER="0.0.0.0:8080"

Further documentation on [cheqd DID Resolver](https://docs.cheqd.io/identity/on-ledger-identity/did-resolver) is available on the [cheqd Identity Documentation site](https://docs.cheqd.io/identity/). This includes instructions on how to do custom builds using `Dockerfile` / Docker Compose.

## 🐞 Bug reports & 🤔 feature requests

If you notice anything not behaving how you expected, or would like to make a suggestion / request for a new feature, please create a [**new issue**](https://github.com/cheqd/did-resolver/issues/new/choose) and let us know.

## 💬 Community

The [**cheqd Community Slack**](http://cheqd.link/join-cheqd-slack) is our primary chat channel for the open-source community, software developers, and node operators.
Expand Down
9 changes: 3 additions & 6 deletions cmd/serve.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package cmd

import (
"net/http"

"github.com/cheqd/did-resolver/services"
"github.com/cheqd/did-resolver/types"
"github.com/cheqd/did-resolver/utils"
Expand Down Expand Up @@ -64,12 +62,11 @@ func serve() {
// Routes
e.GET(types.SWAGGER_PATH, echoSwagger.WrapHandler)
e.GET(types.RESOLVER_PATH+":did", requestService.ResolveDIDDoc)
e.GET(types.RESOLVER_PATH+":did"+types.DID_VERSION_PATH+":version", requestService.ResolveDIDDocVersion)
e.GET(types.RESOLVER_PATH+":did"+types.DID_VERSIONS_PATH, requestService.ResolveAllDidDocVersionsMetadata)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource", requestService.DereferenceResourceData)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource/metadata", requestService.DereferenceResourceMetadata)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+"all", requestService.DereferenceCollectionResources)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+"", func(c echo.Context) error {
return c.Redirect(http.StatusMovedPermanently, "all")
})
e.GET(types.RESOLVER_PATH+":did"+types.DID_METADATA, requestService.DereferenceCollectionResources)

log.Info().Msg("Starting listener")
log.Fatal().Err(e.Start(config.ResolverListener))
Expand Down
15 changes: 13 additions & 2 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const docTemplate = `{
"description": "#Fragment",
"name": "fragmentId",
"in": "query"
},
{
"type": "string",
"description": "Version",
"name": "versionId",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -581,8 +587,13 @@ const docTemplate = `{
"example": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1"
},
"serviceEndpoint": {
"type": "string",
"example": "https://example.com/endpoint/8377464"
"type": "array",
"items": {
"type": "string"
},
"example": [
"https://example.com/endpoint/8377464"
]
},
"type": {
"type": "string",
Expand Down
15 changes: 13 additions & 2 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
"description": "#Fragment",
"name": "fragmentId",
"in": "query"
},
{
"type": "string",
"description": "Version",
"name": "versionId",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -573,8 +579,13 @@
"example": "did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1"
},
"serviceEndpoint": {
"type": "string",
"example": "https://example.com/endpoint/8377464"
"type": "array",
"items": {
"type": "string"
},
"example": [
"https://example.com/endpoint/8377464"
]
},
"type": {
"type": "string",
Expand Down
11 changes: 9 additions & 2 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ definitions:
example: did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47#service-1
type: string
serviceEndpoint:
example: https://example.com/endpoint/8377464
type: string
example:
- https://example.com/endpoint/8377464
items:
type: string
type: array
type:
example: did-communication
type: string
Expand Down Expand Up @@ -254,6 +257,10 @@ paths:
in: query
name: fragmentId
type: string
- description: Version
in: query
name: versionId
type: string
produces:
- application/did+ld+json
- application/ld+json
Expand Down
70 changes: 38 additions & 32 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,47 @@ module github.com/cheqd/did-resolver
go 1.18

require (
github.com/cheqd/cheqd-node v0.6.10
github.com/cheqd/cheqd-node v1.2.2
github.com/labstack/echo/v4 v4.9.1
github.com/mr-tron/base58 v1.2.0
github.com/rs/zerolog v1.28.0
github.com/spf13/cobra v1.6.1
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
github.com/swaggo/echo-swagger v1.3.5
github.com/swaggo/swag v1.8.8
github.com/swaggo/swag v1.8.9
google.golang.org/grpc v1.51.0
)

require (
github.com/99designs/go-keychain v0.0.0-20160105221929-9cf53c87839c // indirect
github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
)

require (
github.com/google/uuid v1.3.0
google.golang.org/protobuf v1.28.1 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
)

require (
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
github.com/DataDog/zstd v1.4.5 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/armon/go-metrics v0.4.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/btcsuite/btcd v0.22.2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/confio/ics23/go v0.7.0 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/cosmos-sdk v0.45.9 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-sdk v0.46.8 // indirect
github.com/cosmos/gogoproto v1.4.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
Expand All @@ -51,12 +59,12 @@ require (
github.com/gogo/protobuf v1.3.3 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
Expand All @@ -74,9 +82,8 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mr-tron/base58 v1.1.0 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
Expand All @@ -88,30 +95,29 @@ require (
github.com/prometheus/client_golang v1.12.2 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.34.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/tendermint v0.34.21 // indirect
github.com/tendermint/tm-db v0.6.6 // indirect
github.com/tendermint/tendermint v0.34.24 // indirect
github.com/tendermint/tm-db v0.6.7 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20221012134737-56aed061732a // indirect
golang.org/x/crypto v0.2.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
golang.org/x/sys v0.0.0-20221010170243-090e33056c14 // indirect
golang.org/x/text v0.4.0 // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect
golang.org/x/tools v0.2.0 // indirect
google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading