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 [DEV-1912] #67

Merged
merged 42 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
8336218
feat: Support v2 protos
DaevMithran Nov 21, 2022
cf3fe7c
fix: Remove local dependency
DaevMithran Nov 21, 2022
9208b70
fix: Test cases
DaevMithran Nov 22, 2022
95fb8f6
feat: Remove fixCheckSum helper
DaevMithran Nov 22, 2022
5a39292
build: Upgrade cheqd-node
DaevMithran Nov 29, 2022
c1a4092
Merge branch 'develop' into integrateV2Protos
DaevMithran Nov 30, 2022
560ee64
Merge branch 'develop' into integrateV2Protos
ankurdotb Dec 2, 2022
c2dc1e7
Update to latest cheqd-node package
ankurdotb Dec 2, 2022
4384570
Update Dockerfile
ankurdotb Dec 2, 2022
bd8fe66
fix: Resolution metadata unittest
DaevMithran Dec 5, 2022
2fbde1d
Merge branch 'develop' into integrateV2Protos
DaevMithran Dec 6, 2022
b726136
feat: Support version query && fix Unit tests
DaevMithran Dec 7, 2022
1378474
feat: Parse verification material in result
DaevMithran Dec 7, 2022
d49a624
feat: Support Migrated DIDs
DaevMithran Dec 7, 2022
d9e465a
feat: Add query in swagger && fix unit test
DaevMithran Dec 8, 2022
5725892
build: Upgrade cheqd-node
DaevMithran Dec 8, 2022
2be0b6f
fix: Modify publicKeyJWK type
DaevMithran Dec 15, 2022
f52fc2f
Merge branch 'develop' into integrateV2Protos
ankurdotb Dec 22, 2022
c29e142
go mod tidy
ankurdotb Dec 22, 2022
6fc10cb
Merge branch 'develop' into integrateV2Protos
ankurdotb Jan 4, 2023
05dec07
go mod tidy
ankurdotb Jan 4, 2023
725b5c0
feat: Upgrade latest cheqd-node
DaevMithran Jan 9, 2023
7db043c
feat: Update verificationMethod resolution
DaevMithran Jan 9, 2023
1938567
build: Upgrade latest cheqd-node
DaevMithran Jan 25, 2023
f6e1805
fix: Error comparison
DaevMithran Jan 25, 2023
be133a5
Merge branch 'develop' into integrateV2Protos
DaevMithran Jan 26, 2023
ecc757c
Fix problem with integration tests
abdulla-ashurov Jan 26, 2023
0da4fd9
Refactor unit tests
abdulla-ashurov Jan 26, 2023
86c0912
Update RESOURCE_DATA variable
abdulla-ashurov Jan 26, 2023
e7d99e5
Commit Mainnet DIDs in integration tests
abdulla-ashurov Jan 26, 2023
c25b7a8
test: Add migrated DID tests
DaevMithran Jan 27, 2023
0422bcf
feat: Add verificationKey contexts
DaevMithran Jan 27, 2023
11489cc
fix: Uint tests
DaevMithran Jan 27, 2023
ecca519
Add API for getting DIDDoc specific version
abdulla-ashurov Jan 28, 2023
eec394e
Add integration test for testing API for getting specific DID version
abdulla-ashurov Jan 28, 2023
400e2ce
Add negative integration test for testing API getting specific DID ve…
abdulla-ashurov Jan 28, 2023
8f85949
Add API for getting all DIDDoc versions
abdulla-ashurov Jan 30, 2023
6c4f3b1
Refactor code
abdulla-ashurov Jan 30, 2023
f30001d
Add integration tests for testing get all DID versions API
abdulla-ashurov Jan 30, 2023
e6bc1fb
Change API for getting metadata for all resources in collection
abdulla-ashurov Jan 30, 2023
9220107
Remove not need integration tests
abdulla-ashurov Jan 30, 2023
665b4d4
We should use already implemented migrations functions instead of cre…
abdulla-ashurov Jan 30, 2023
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
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
68 changes: 37 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/cheqd/did-resolver
go 1.18

require (
github.com/cheqd/cheqd-node v0.6.10
github.com/labstack/echo/v4 v4.10.0
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
Expand All @@ -14,28 +15,35 @@ require (
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.2 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.2.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.2.0 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // 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.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