diff --git a/go.mod b/go.mod index aff70d68..0d5076a5 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,11 @@ module github.com/cheqd/did-resolver go 1.18 require ( - github.com/cheqd/cheqd-node v1.2.8 + github.com/cheqd/cheqd-node/api/v2 v2.1.0 + github.com/google/uuid v1.3.0 github.com/labstack/echo/v4 v4.10.2 + github.com/mr-tron/base58 v1.2.0 + github.com/multiformats/go-multibase v0.1.1 github.com/rs/zerolog v1.29.0 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.15.0 @@ -12,123 +15,45 @@ require ( github.com/swaggo/echo-swagger v1.3.5 github.com/swaggo/swag v1.8.10 google.golang.org/grpc v1.53.0 + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 ) require ( - cosmossdk.io/errors v1.0.0-beta.7 // indirect - cosmossdk.io/math v1.0.0-beta.3 // indirect - github.com/99designs/keyring v1.2.1 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v0.19.4 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect - github.com/danieljoos/wincred v1.1.2 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/gtank/ristretto255 v0.1.2 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect - github.com/mr-tron/base58 v1.2.0 // indirect - github.com/mtibben/percent v0.2.1 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/tidwall/btree v1.5.0 // indirect - github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.1 // indirect - golang.org/x/term v0.5.0 // indirect - sigs.k8s.io/yaml v1.3.0 // indirect -) - -require ( - filippo.io/edwards25519 v1.0.0-rc.1 // indirect - github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/KyleBanks/depth v1.2.1 // indirect - github.com/armon/go-metrics v0.4.1 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd v0.22.2 // indirect - github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect - github.com/cosmos/cosmos-sdk v0.46.8 // indirect + github.com/cosmos/cosmos-sdk/api v0.1.0 // indirect github.com/cosmos/gogoproto v1.4.6 // indirect - github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // 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 - github.com/go-kit/kit v0.12.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.7 // indirect github.com/go-openapi/swag v0.22.3 // indirect - github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect - github.com/goccy/go-json v0.9.7 // indirect github.com/gogo/protobuf v1.3.3 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect - github.com/golang/glog v1.0.0 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.0.1 // indirect - github.com/google/uuid v1.3.0 - 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.5-0.20210104140557-80c98217689d // indirect + github.com/google/go-cmp v0.5.9 // 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 github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.15.11 // indirect github.com/labstack/gommon v0.4.0 // indirect - github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect - github.com/lestrrat-go/blackmagic v1.0.0 // indirect - github.com/lestrrat-go/httpcc v1.0.1 // indirect - github.com/lestrrat-go/iter v1.0.1 // indirect - github.com/lestrrat-go/jwx v1.2.25 // indirect - github.com/lestrrat-go/option v1.0.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/mitchellh/mapstructure v1.5.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 github.com/pelletier/go-toml/v2 v2.0.6 // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - 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.8.0 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.9.3 // 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.2 // indirect github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // 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.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.6.0 // indirect golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect golang.org/x/net v0.7.0 // indirect @@ -137,23 +62,9 @@ require ( golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.6.0 // indirect google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // 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 ) -replace ( - // cosmos-sdk state sync allow fast forward to latest height version - github.com/cosmos/cosmos-sdk => github.com/cheqd/cosmos-sdk v0.46.8-cheqd-state-sync - - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. - // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 - - // From Cosmos SDK v0.46.8 upstream - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - - // From Cosmos SDK v0.46.8 upstream - github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 -) +// From Cosmos SDK upstream +replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 diff --git a/go.sum b/go.sum index 7e7fb868..18d3593d 100644 --- a/go.sum +++ b/go.sum @@ -17,18 +17,14 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.107.0 h1:qkj22L7bgkl6vIeZDlOY2po43Mx/TIa2Wsa7VR+PEww= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -39,163 +35,50 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= -cosmossdk.io/math v1.0.0-beta.3/go.mod h1:3LYasri3Zna4XpbrTNdKsWmD5fHHkaNAod/mNT9XdE4= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= -filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= -github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= -github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= -github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/aws/aws-sdk-go v1.44.122 h1:p6mw01WBaNpbdP2xrisz5tIkcNwzj/HysobNoaAHjgo= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheqd/cheqd-node v1.2.8 h1:iO7uWq4CP3Wa7NBNvBZGie0XHUoKRvaYulexIFxunvo= -github.com/cheqd/cheqd-node v1.2.8/go.mod h1:zslOJtQrWGVksLrQ1OsC/GT42NTw99H3Ggzc4IKjTzE= -github.com/cheqd/cosmos-sdk v0.46.8-cheqd-state-sync h1:5RQYp1sHdjnkSrfSX5nygVpl+npzY89xnp8tzd8Omxs= -github.com/cheqd/cosmos-sdk v0.46.8-cheqd-state-sync/go.mod h1:lg+FqwndbbCYQk1YTUWRDpOsNbQG0nINQqxY7ZnsAP8= +github.com/cheqd/cheqd-node/api/v2 v2.1.0 h1:c54a1+cEpJoYYn3moUKviA7aoW+aUYuCawdj3bjc3/k= +github.com/cheqd/cheqd-node/api/v2 v2.1.0/go.mod h1:UQN1oRAceTOrwCP9u0EHivPbBpvp3q9mZHIiMYZ99AM= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= -github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= -github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= -github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= -github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= -github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= +github.com/cosmos/cosmos-sdk/api v0.1.0/go.mod h1:CupqQBskAOiTXO1XDZ/wrtWzN/wTxUvbQmOqdUhR8wI= github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4= github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI= -github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= -github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= -github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= -github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= -github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d/go.mod h1:tmAIfUFEirG/Y8jhZ9M+h36obRZAk/1fcSpXwAVlfqE= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= -github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= -github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= -github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= -github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= -github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= -github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -209,25 +92,13 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-ozzo/ozzo-validation/v4 v4.3.0 h1:byhDUpfEwjsVQb1vBunvIjh2BHQ9ead57VkAEY4V+Es= -github.com/go-ozzo/ozzo-validation/v4 v4.3.0/go.mod h1:2NKgrcHl3z6cJs+3Oo940FPRiTzuqKbvfrL2RxCj6Ew= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= -github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -235,9 +106,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -254,13 +123,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -273,13 +137,9 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -290,83 +150,30 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.1 h1:RY7tHKZcRlk788d5WSo/e83gOyyy742E8GSs771ySpg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= -github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= -github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= -github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= -github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= -github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= -github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= -github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -379,22 +186,6 @@ github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A= -github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y= -github.com/lestrrat-go/blackmagic v1.0.0 h1:XzdxDbuQTz0RZZEmdU7cnQxUtFUzgCSPq8RCz4BxIi4= -github.com/lestrrat-go/blackmagic v1.0.0/go.mod h1:TNgH//0vYSs8VXDCfkZLgIrVTTXQELZffUV0tz3MtdQ= -github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= -github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= -github.com/lestrrat-go/iter v1.0.1 h1:q8faalr2dY6o8bV45uwrxq12bRa1ezKrB6oM9FUgN4A= -github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= -github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0otA= -github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= -github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4= -github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -402,7 +193,6 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -411,144 +201,55 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= -github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= -github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI= github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo/v2 v2.8.3 h1:RpbK1G8nWPNaCVFBWsOGnEQQGgASi6b8fxcWBvDYjxQ= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= -github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -570,63 +271,34 @@ github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9J github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= github.com/swaggo/swag v1.8.10 h1:eExW4bFa52WOjqRzRD58bgWsWfdFJso50lpbeTcmTfo= github.com/swaggo/swag v1.8.10/go.mod h1:ezQVUUhly8dludpVk+/PuwJWvLLanB13ygV5Pr9enSk= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= -github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= -github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= -github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= -github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= -github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= -github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= -github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= -go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -669,8 +341,6 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2 golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -678,7 +348,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -692,11 +361,9 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -704,12 +371,9 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -722,9 +386,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -737,27 +398,17 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -769,34 +420,25 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -804,8 +446,6 @@ golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -880,7 +520,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -900,17 +539,14 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.107.0 h1:I2SlFjD8ZWabaIFOfeEDg3pf0BHJDh6iYQ1ic3Yu/UU= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -932,10 +568,8 @@ google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -964,7 +598,6 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= @@ -984,25 +617,15 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= @@ -1017,9 +640,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/migrations/did.go b/migrations/did.go new file mode 100644 index 00000000..ec8c5942 --- /dev/null +++ b/migrations/did.go @@ -0,0 +1,8 @@ +package migrations + +func MigrateDID(did string) string { + did = MigrateIndyStyleDid(did) + did = MigrateUUIDDid(did) + + return did +} diff --git a/migrations/indy_style.go b/migrations/indy_style.go new file mode 100644 index 00000000..b5a9bb8d --- /dev/null +++ b/migrations/indy_style.go @@ -0,0 +1,26 @@ +package migrations + +import ( + "crypto/sha256" + + "github.com/cheqd/did-resolver/utils" + "github.com/mr-tron/base58" +) + +func MigrateIndyStyleDid(did string) string { + method, namespace, id := utils.MustSplitDID(did) + return utils.JoinDID(method, namespace, MigrateIndyStyleID(id)) +} + +func MigrateIndyStyleID(id string) string { + // If id is UUID it should not be changed + if utils.IsValidUUID(id) { + return id + } + + // Get Hash from current id to make a 32-symbol string + hash := sha256.Sum256([]byte(id)) + + // Indy-style identifier is 16-byte base58 string + return base58.Encode(hash[:16]) +} diff --git a/migrations/uuid.go b/migrations/uuid.go new file mode 100644 index 00000000..bc3889a3 --- /dev/null +++ b/migrations/uuid.go @@ -0,0 +1,27 @@ +package migrations + +import ( + "github.com/cheqd/did-resolver/utils" + "github.com/google/uuid" +) + +func MigrateUUIDDid(did string) string { + method, namespace, id := utils.MustSplitDID(did) + return utils.JoinDID(method, namespace, MigrateUUIDId(id)) +} + +func MigrateUUIDId(id string) string { + // If id is not UUID it should not be changed + if !utils.IsValidUUID(id) { + return id + } + + // If uuid is already normalized, it should not be changed + if utils.NormalizeUUID(id) == id { + return id + } + + newID := uuid.NewSHA1(uuid.Nil, []byte(id)) + + return utils.NormalizeUUID(newID.String()) +} diff --git a/services/diddoc_service.go b/services/diddoc_service.go index da05e433..5a021a5f 100644 --- a/services/diddoc_service.go +++ b/services/diddoc_service.go @@ -4,7 +4,7 @@ import ( "net/url" "strings" - didTypes "github.com/cheqd/cheqd-node/x/did/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" "github.com/cheqd/did-resolver/types" "github.com/rs/zerolog/log" @@ -51,14 +51,15 @@ func (dds DIDDocService) ProcessDIDRequest(did string, fragmentId string, querie } } - switch { - case flag != nil: + if flag != nil { return nil, types.NewRepresentationNotSupportedError(did, contentType, nil, true) - case fragmentId != "": + } + + if fragmentId != "" { log.Trace().Msgf("Dereferencing %s, %s, %s", did, fragmentId, queries) result, err = dds.dereferenceSecondary(did, version, fragmentId, contentType) isDereferencing = true - default: + } else { log.Trace().Msgf("Resolving %s", did) result, err = dds.Resolve(did, version, contentType) isDereferencing = false @@ -68,6 +69,7 @@ func (dds DIDDocService) ProcessDIDRequest(did string, fragmentId string, querie err.IsDereferencing = isDereferencing return nil, err } + return result, nil } @@ -83,12 +85,12 @@ func (dds DIDDocService) Resolve(did string, version string, contentType types.C return nil, err } - resolvedMetadata, mErr := dds.resolveMetadata(did, *protoDidDocWithMetadata.Metadata, contentType) + resolvedMetadata, mErr := dds.resolveMetadata(did, protoDidDocWithMetadata.Metadata, contentType) if mErr != nil { mErr.ContentType = contentType return nil, mErr } - didDoc := types.NewDidDoc(*protoDidDocWithMetadata.DidDoc) + didDoc := types.NewDidDoc(protoDidDocWithMetadata.DidDoc) result := types.DidResolution{Did: &didDoc, Metadata: *resolvedMetadata, ResolutionMetadata: didResolutionMetadata} if didResolutionMetadata.ContentType == types.DIDJSONLD || didResolutionMetadata.ContentType == types.JSONLD { didDoc.AddContext(types.DIDSchemaJSONLD) @@ -134,7 +136,7 @@ func (dds DIDDocService) GetDIDDocVersionsMetadata(did string, version string, c context = types.ResolutionSchemaJSONLD } - contentStream := types.NewResolutionDidDocMetadata(did, *protoDidDocWithMetadata.Metadata, resources) + contentStream := types.NewResolutionDidDocMetadata(did, protoDidDocWithMetadata.Metadata, resources) return &types.ResourceDereferencing{Context: context, ContentStream: &contentStream, DereferencingMetadata: dereferenceMetadata}, nil } @@ -181,6 +183,7 @@ func (dds DIDDocService) dereferenceSecondary(did string, version string, fragme if contentStream == nil { return nil, types.NewNotFoundError(did, contentType, nil, true) } + result := types.DidDereferencing{ ContentStream: contentStream, Metadata: metadata, @@ -197,11 +200,13 @@ func (dds DIDDocService) dereferenceSecondary(did string, version string, fragme return &result, nil } -func (dds DIDDocService) resolveMetadata(did string, metadata didTypes.Metadata, contentType types.ContentType) (*types.ResolutionDidDocMetadata, *types.IdentityError) { +func (dds DIDDocService) resolveMetadata(did string, metadata *didTypes.Metadata, contentType types.ContentType) (*types.ResolutionDidDocMetadata, *types.IdentityError) { resources, err := dds.ledgerService.QueryCollectionResources(did) if err != nil { return nil, err } + resolvedMetadata := types.NewResolutionDidDocMetadata(did, metadata, resources) + return &resolvedMetadata, nil } diff --git a/services/ledger_service.go b/services/ledger_service.go index a6423bce..6d48f3da 100644 --- a/services/ledger_service.go +++ b/services/ledger_service.go @@ -8,9 +8,8 @@ import ( "google.golang.org/grpc/credentials" - didTypes "github.com/cheqd/cheqd-node/x/did/types" - didUtils "github.com/cheqd/cheqd-node/x/did/utils" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" "github.com/cheqd/did-resolver/types" "github.com/rs/zerolog/log" "google.golang.org/grpc" @@ -24,8 +23,8 @@ const ( type LedgerServiceI interface { QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) - QueryResource(collectionDid string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) - QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) + QueryResource(collectionDid string, resourceId string) (*resourceTypes.ResourceWithMetadata, *types.IdentityError) + QueryCollectionResources(did string) ([]*resourceTypes.Metadata, *types.IdentityError) GetNamespaces() []string } @@ -36,6 +35,7 @@ type LedgerService struct { func NewLedgerService() LedgerService { ls := LedgerService{} ls.ledgers = make(map[string]types.Network) + return ls } @@ -57,7 +57,7 @@ func NewLedgerService() LedgerService { // @Failure 500 {object} types.IdentityError // @Router /{did} [get] func (ls LedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) { - method, namespace, _, _ := didUtils.TrySplitDID(did) + method, namespace, _, _ := types.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) @@ -71,7 +71,7 @@ func (ls LedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDo defer mustCloseGRPCConnection(conn) - log.Info().Msgf("Querying did doc: %s", did) + log.Info().Msgf("Querying DIDDoc: %s", did) client := didTypes.NewQueryClient(conn) if version == "" { @@ -106,7 +106,7 @@ func (ls LedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDo // @Failure 500 {object} types.IdentityError // @Router /{did}/versions [get] func (ls LedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) { - method, namespace, _, _ := didUtils.TrySplitDID(did) + method, namespace, _, _ := types.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) @@ -119,7 +119,7 @@ func (ls LedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes. } defer mustCloseGRPCConnection(conn) - log.Info().Msgf("Querying all did doc versions metadata: %s", did) + log.Info().Msgf("Querying all DIDDoc versions metadata: %s", did) client := didTypes.NewQueryClient(conn) response, err := client.AllDidDocVersionsMetadata(context.Background(), &didTypes.QueryAllDidDocVersionsMetadataRequest{Id: did}) @@ -145,8 +145,8 @@ func (ls LedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes. // @Failure 406 {object} types.IdentityError // @Failure 500 {object} types.IdentityError // @Router /{did}/resources/{resourceId} [get] -func (ls LedgerService) QueryResource(did string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) { - method, namespace, collectionId, _ := didUtils.TrySplitDID(did) +func (ls LedgerService) QueryResource(did string, resourceId string) (*resourceTypes.ResourceWithMetadata, *types.IdentityError) { + method, namespace, collectionId, _ := types.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, true) @@ -160,10 +160,10 @@ func (ls LedgerService) QueryResource(did string, resourceId string) (*resource. defer mustCloseGRPCConnection(conn) - log.Info().Msgf("Querying did resource: %s, %s", collectionId, resourceId) + log.Info().Msgf("Querying DID resource: %s, %s", collectionId, resourceId) - client := resource.NewQueryClient(conn) - resourceResponse, err := client.Resource(context.Background(), &resource.QueryResourceRequest{CollectionId: collectionId, Id: resourceId}) + client := resourceTypes.NewQueryClient(conn) + resourceResponse, err := client.Resource(context.Background(), &resourceTypes.QueryResourceRequest{CollectionId: collectionId, Id: resourceId}) if err != nil { log.Info().Msgf("Resource not found %s", err.Error()) return nil, types.NewNotFoundError(did, types.JSON, err, true) @@ -186,8 +186,8 @@ func (ls LedgerService) QueryResource(did string, resourceId string) (*resource. // @Failure 406 {object} types.IdentityError // @Failure 500 {object} types.IdentityError // @Router /{did}/metadata [get] -func (ls LedgerService) QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) { - method, namespace, collectionId, _ := didUtils.TrySplitDID(did) +func (ls LedgerService) QueryCollectionResources(did string) ([]*resourceTypes.Metadata, *types.IdentityError) { + method, namespace, collectionId, _ := types.TrySplitDID(did) serverAddr, namespaceFound := ls.ledgers[method+DELIMITER+namespace] if !namespaceFound { return nil, types.NewInvalidDIDError(did, types.JSON, nil, false) @@ -199,10 +199,10 @@ func (ls LedgerService) QueryCollectionResources(did string) ([]*resource.Metada return nil, types.NewInternalError(did, types.JSON, err, false) } - log.Info().Msgf("Querying did resources: %s", did) + log.Info().Msgf("Querying DID resources: %s", did) - client := resource.NewQueryClient(conn) - resourceResponse, err := client.CollectionResources(context.Background(), &resource.QueryCollectionResourcesRequest{CollectionId: collectionId}) + client := resourceTypes.NewQueryClient(conn) + resourceResponse, err := client.CollectionResources(context.Background(), &resourceTypes.QueryCollectionResourcesRequest{CollectionId: collectionId}) if err != nil { return nil, types.NewNotFoundError(did, types.JSON, err, false) } @@ -218,10 +218,11 @@ func (ls *LedgerService) RegisterLedger(method string, endpoint types.Network) e } if endpoint.Endpoint == "" { - return errors.New("ledger node url cannot be empty") + return errors.New("ledger node URL cannot be empty") } ls.ledgers[method+DELIMITER+endpoint.Namespace] = endpoint + return nil } @@ -248,6 +249,7 @@ func (ls LedgerService) openGRPCConnection(endpoint types.Network) (conn *grpc.C } log.Info().Msg("openGRPCConnection: opened") + return conn, nil } @@ -268,5 +270,6 @@ func (ls LedgerService) GetNamespaces() []string { namespace := strings.Split(k, DELIMITER)[1] keys = append(keys, namespace) } + return keys } diff --git a/services/request_service.go b/services/request_service.go index 246cb5dc..be97d424 100644 --- a/services/request_service.go +++ b/services/request_service.go @@ -6,10 +6,10 @@ import ( "net/url" "strings" - didUtils "github.com/cheqd/cheqd-node/x/did/utils" + "github.com/cheqd/did-resolver/migrations" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" - "github.com/labstack/echo/v4" + echo "github.com/labstack/echo/v4" ) type RequestService struct { @@ -48,16 +48,16 @@ func (rs RequestService) ResolveDIDDoc(c echo.Context) error { return err } - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } //nolint: nestif - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did if fragmentId != "" { @@ -94,15 +94,15 @@ func (rs RequestService) ResolveDIDDocVersion(c echo.Context) error { version := c.Param("version") - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.DID_VERSION_PATH + version return c.Redirect(http.StatusMovedPermanently, path) @@ -146,15 +146,15 @@ func (rs RequestService) ResolveDIDDocVersionMetadata(c echo.Context) error { version := c.Param("version") - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.DID_VERSION_PATH + version return c.Redirect(http.StatusMovedPermanently, path) @@ -195,15 +195,15 @@ func (rs RequestService) ResolveAllDidDocVersionsMetadata(c echo.Context) error return types.NewInvalidDIDUrlError(c.Param("did"), requestedContentType, err, true) } - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.DID_VERSIONS_PATH return c.Redirect(http.StatusMovedPermanently, path) @@ -245,15 +245,15 @@ func (rs RequestService) DereferenceResourceMetadata(c echo.Context) error { } resourceId := c.Param("resource") - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.RESOURCE_PATH + resourceId + "/metadata" return c.Redirect(http.StatusMovedPermanently, path) @@ -281,15 +281,15 @@ func (rs RequestService) DereferenceResourceData(c echo.Context) error { } resourceId := c.Param("resource") - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.RESOURCE_PATH + resourceId return c.Redirect(http.StatusMovedPermanently, path) @@ -316,15 +316,15 @@ func (rs RequestService) DereferenceCollectionResources(c echo.Context) error { return types.NewInvalidDIDUrlError(c.Param("did"), requestedContentType, err, true) } - didMethod, _, identifier, _ := didUtils.TrySplitDID(did) + didMethod, _, identifier, _ := types.TrySplitDID(did) if didMethod != rs.didDocService.didMethod { return types.NewMethodNotSupportedError(did, requestedContentType, nil, false) } - if !didUtils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { - err := didUtils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) + if !utils.IsValidDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) { + err := utils.ValidateDID(did, "", rs.didDocService.ledgerService.GetNamespaces()) if err.Error() == types.NewInvalidIdentifierError().Error() && utils.IsMigrationNeeded(identifier) { - did = utils.MigrateDID(did) + did = migrations.MigrateDID(did) path := types.RESOLVER_PATH + did + types.DID_METADATA return c.Redirect(http.StatusMovedPermanently, path) diff --git a/services/resource_dereference_service.go b/services/resource_dereference_service.go index 3ee8ac04..c19b8307 100644 --- a/services/resource_dereference_service.go +++ b/services/resource_dereference_service.go @@ -6,7 +6,7 @@ import ( "strings" - resourceTypes "github.com/cheqd/cheqd-node/x/resource/types" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" "github.com/cheqd/did-resolver/types" ) @@ -68,7 +68,7 @@ func (rds ResourceService) DereferenceCollectionResources(did string, contentTyp context = types.ResolutionSchemaJSONLD } - contentStream := types.NewResolutionDidDocMetadata(did, *didDoc.Metadata, resources) + contentStream := types.NewResolutionDidDocMetadata(did, didDoc.Metadata, resources) return &types.ResourceDereferencing{Context: context, ContentStream: &contentStream, DereferencingMetadata: dereferenceMetadata}, nil } diff --git a/types/did_doc_metadata_test.go b/tests/unit-tests/did_doc_metadata_test.go similarity index 57% rename from types/did_doc_metadata_test.go rename to tests/unit-tests/did_doc_metadata_test.go index 94ede396..eb4e07a8 100644 --- a/types/did_doc_metadata_test.go +++ b/tests/unit-tests/did_doc_metadata_test.go @@ -1,13 +1,15 @@ -package types +package tests import ( "crypto/sha256" "fmt" "testing" - did "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" + "github.com/cheqd/did-resolver/types" "github.com/stretchr/testify/require" + // "google.golang.org/protobuf/types/known/timestamppb" ) func TestNewResolutionDidDocMetadata(t *testing.T) { @@ -17,7 +19,7 @@ func TestNewResolutionDidDocMetadata(t *testing.T) { resourceData := []byte("test_checksum") h := sha256.New() h.Write(resourceData) - resourceMetadata := resource.Metadata{ + resourceMetadata := resourceTypes.Metadata{ CollectionId: validIdentifier, Id: validResourceId, Name: "Existing Resource Name", @@ -26,14 +28,15 @@ func TestNewResolutionDidDocMetadata(t *testing.T) { Checksum: fmt.Sprintf("%x", h.Sum(nil)), } - validMetadataResource := DereferencedResource{ - ResourceURI: validDid + RESOURCE_PATH + resourceMetadata.Id, + created := resourceMetadata.Created.AsTime() + validMetadataResource := types.DereferencedResource{ + ResourceURI: validDid + types.RESOURCE_PATH + resourceMetadata.Id, CollectionId: resourceMetadata.CollectionId, ResourceId: resourceMetadata.Id, Name: resourceMetadata.Name, ResourceType: resourceMetadata.ResourceType, MediaType: resourceMetadata.MediaType, - Created: resourceMetadata.Created, + Created: &created, Checksum: resourceMetadata.Checksum, PreviousVersionId: nil, NextVersionId: nil, @@ -41,30 +44,34 @@ func TestNewResolutionDidDocMetadata(t *testing.T) { subtests := []struct { name string - metadata did.Metadata - resources []*resource.Metadata - expectedResult ResolutionDidDocMetadata + metadata *didTypes.Metadata + resources []*resourceTypes.Metadata + expectedResult types.ResolutionDidDocMetadata }{ { name: "metadata with resource", - metadata: did.Metadata{ + metadata: &didTypes.Metadata{ VersionId: "test_version_id", Deactivated: false, }, - resources: []*resource.Metadata{&resourceMetadata}, - expectedResult: ResolutionDidDocMetadata{ - VersionId: "test_version_id", + resources: []*resourceTypes.Metadata{&resourceMetadata}, + expectedResult: types.ResolutionDidDocMetadata{ + Created: &EmptyTime, + Updated: &EmptyTime, Deactivated: false, - Resources: []DereferencedResource{validMetadataResource}, + VersionId: "test_version_id", + Resources: []types.DereferencedResource{validMetadataResource}, }, }, { name: "metadata without resources", - metadata: did.Metadata{ + metadata: &didTypes.Metadata{ VersionId: "test_version_id", Deactivated: false, }, - expectedResult: ResolutionDidDocMetadata{ + expectedResult: types.ResolutionDidDocMetadata{ + Created: &EmptyTime, + Updated: &EmptyTime, VersionId: "test_version_id", Deactivated: false, }, @@ -73,7 +80,7 @@ func TestNewResolutionDidDocMetadata(t *testing.T) { for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - result := NewResolutionDidDocMetadata(validDid, subtest.metadata, subtest.resources) + result := types.NewResolutionDidDocMetadata(validDid, subtest.metadata, subtest.resources) require.EqualValues(t, subtest.expectedResult, result) }) diff --git a/services/diddoc_service_test.go b/tests/unit-tests/diddoc_service_test.go similarity index 63% rename from services/diddoc_service_test.go rename to tests/unit-tests/diddoc_service_test.go index d9840076..2716b09c 100644 --- a/services/diddoc_service_test.go +++ b/tests/unit-tests/diddoc_service_test.go @@ -1,19 +1,20 @@ -package services +package tests import ( "fmt" "net/url" "testing" - did "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" + "github.com/cheqd/did-resolver/services" "github.com/cheqd/did-resolver/types" - "github.com/cheqd/did-resolver/utils" "github.com/stretchr/testify/require" ) func TestDIDDocFragment(t *testing.T) { - validDIDDoc := types.NewDidDoc(utils.ValidDIDDoc()) + validDIDDoc := ValidDIDDoc() + DIDDoc := types.NewDidDoc(&validDIDDoc) subtests := []struct { name string @@ -23,27 +24,27 @@ func TestDIDDocFragment(t *testing.T) { }{ { name: "successful VerificationMethod finding", - fragmentId: validDIDDoc.VerificationMethod[0].Id, - didDoc: validDIDDoc, - expectedFragment: &validDIDDoc.VerificationMethod[0], + fragmentId: DIDDoc.VerificationMethod[0].Id, + didDoc: DIDDoc, + expectedFragment: &DIDDoc.VerificationMethod[0], }, { name: "successful Service finding", - fragmentId: validDIDDoc.Service[0].Id, - didDoc: validDIDDoc, - expectedFragment: &validDIDDoc.Service[0], + fragmentId: DIDDoc.Service[0].Id, + didDoc: DIDDoc, + expectedFragment: &DIDDoc.Service[0], }, { name: "Fragment is not found", fragmentId: "fake_id", - didDoc: validDIDDoc, + didDoc: DIDDoc, expectedFragment: nil, }, } for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - didDocService := DIDDocService{} + didDocService := services.DIDDocService{} fragment := didDocService.GetDIDFragment(subtest.fragmentId, subtest.didDoc) @@ -53,13 +54,13 @@ func TestDIDDocFragment(t *testing.T) { } func TestResolve(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validDIDDocResolution := types.NewDidDoc(validDIDDoc) - validMetadata := utils.ValidMetadata() - validResource := utils.ValidResource() + validDIDDoc := ValidDIDDoc() + validDIDDocResolution := types.NewDidDoc(&validDIDDoc) + validMetadata := ValidMetadata() + validResource := ValidResource() subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService resolutionType types.ContentType identifier string method string @@ -71,70 +72,70 @@ func TestResolve(t *testing.T) { }{ { name: "successful resolution", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, expectedDID: &validDIDDocResolution, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), + expectedMetadata: types.NewResolutionDidDocMetadata(ValidDid, &validMetadata, []*resourceTypes.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, { name: "invalid DID", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, identifier: "oooooo0000OOOO_invalid_did", - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + method: ValidMethod, + namespace: ValidNamespace, expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, { name: "invalid method", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, + identifier: ValidIdentifier, method: "not_supported_method", - namespace: utils.ValidNamespace, + namespace: ValidNamespace, expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, { name: "invalid namespace", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, + identifier: ValidIdentifier, + method: ValidMethod, namespace: "invalid_namespace", expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, { name: "representation is not supported", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: "text/html,application/xhtml+xml", - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, expectedResolutionType: types.JSON, - expectedError: types.NewRepresentationNotSupportedError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewRepresentationNotSupportedError(ValidDid, types.DIDJSONLD, nil, false), }, } @@ -142,7 +143,7 @@ func TestResolve(t *testing.T) { fmt.Printf("Testing %s", subtest.name) id := "did:" + subtest.method + ":" + subtest.namespace + ":" + subtest.identifier t.Run(subtest.name, func(t *testing.T) { - diddocService := NewDIDDocService("cheqd", subtest.ledgerService) + diddocService := services.NewDIDDocService("cheqd", subtest.ledgerService) expectedDIDProperties := types.DidProperties{ DidString: id, MethodSpecificId: subtest.identifier, @@ -158,7 +159,6 @@ func TestResolve(t *testing.T) { expectedContentType = subtest.resolutionType } resolutionResult, err := diddocService.Resolve(id, "", subtest.resolutionType) - // print(resolutionResult.Did.Id) if subtest.expectedError != nil { require.EqualValues(t, subtest.expectedError.Code, err.Code) require.EqualValues(t, subtest.expectedError.Message, err.Message) @@ -174,16 +174,16 @@ func TestResolve(t *testing.T) { } func TestDereferencing(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validVerificationMethod := utils.ValidVerificationMethod() - validService := utils.ValidService() - validResource := utils.ValidResource() - validMetadata := utils.ValidMetadata() - validFragmentMetadata := types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{}) + validDIDDoc := ValidDIDDoc() + validVerificationMethod := ValidVerificationMethod() + validService := ValidService() + validResource := ValidResource() + validMetadata := ValidMetadata() + validFragmentMetadata := types.NewResolutionDidDocMetadata(ValidDid, &validMetadata, []*resourceTypes.Metadata{}) validQuery, _ := url.ParseQuery("attr=value") subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService dereferencingType types.ContentType did string fragmentId string @@ -195,9 +195,9 @@ func TestDereferencing(t *testing.T) { }{ { name: "successful Secondary dereferencing (key)", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), dereferencingType: types.DIDJSON, - did: utils.ValidDid, + did: ValidDid, fragmentId: validVerificationMethod.Id, expectedContentStream: types.NewVerificationMethod(&validVerificationMethod), expectedMetadata: validFragmentMetadata, @@ -205,9 +205,9 @@ func TestDereferencing(t *testing.T) { }, { name: "successful Secondary dereferencing (service)", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), dereferencingType: types.DIDJSON, - did: utils.ValidDid, + did: ValidDid, fragmentId: validService.Id, expectedContentStream: types.NewService(&validService), expectedMetadata: validFragmentMetadata, @@ -215,35 +215,35 @@ func TestDereferencing(t *testing.T) { }, { name: "not supported query", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, queries: validQuery, expectedContentStream: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewRepresentationNotSupportedError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewRepresentationNotSupportedError(ValidDid, types.DIDJSONLD, nil, false), }, { name: "key not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, fragmentId: "notFoundKey", expectedContentStream: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, } for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - diddocService := NewDIDDocService("cheqd", subtest.ledgerService) + diddocService := services.NewDIDDocService("cheqd", subtest.ledgerService) var expectedDIDProperties types.DidProperties if subtest.expectedError == nil { expectedDIDProperties = types.DidProperties{ - DidString: utils.ValidDid, - MethodSpecificId: utils.ValidIdentifier, - Method: utils.ValidMethod, + DidString: ValidDid, + MethodSpecificId: ValidIdentifier, + Method: ValidMethod, } } expectedContentType := subtest.expectedContentType diff --git a/services/ledger_service_test.go b/tests/unit-tests/ledger_service_test.go similarity index 82% rename from services/ledger_service_test.go rename to tests/unit-tests/ledger_service_test.go index 0985d21d..58c0db0a 100644 --- a/services/ledger_service_test.go +++ b/tests/unit-tests/ledger_service_test.go @@ -1,10 +1,11 @@ -package services +package tests import ( "testing" - didTypes "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" + "github.com/cheqd/did-resolver/services" "github.com/cheqd/did-resolver/types" "github.com/stretchr/testify/require" ) @@ -28,7 +29,7 @@ func TestQueryDIDDoc(t *testing.T) { for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - ledgerService := NewLedgerService() + ledgerService := services.NewLedgerService() didDocWithMetadata, err := ledgerService.QueryDIDDoc("fake did", "") require.EqualValues(t, subtest.expectedDidDocWithMetada, didDocWithMetadata) require.EqualValues(t, subtest.expectedError.Error(), err.Error()) @@ -41,7 +42,7 @@ func TestQueryResource(t *testing.T) { name string collectionDid string resourceId string - expectedResource *resource.ResourceWithMetadata + expectedResource *resourceTypes.ResourceWithMetadata expectedError error }{ { @@ -55,7 +56,7 @@ func TestQueryResource(t *testing.T) { for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - ledgerService := NewLedgerService() + ledgerService := services.NewLedgerService() resource, err := ledgerService.QueryResource(subtest.collectionDid, subtest.resourceId) require.EqualValues(t, subtest.expectedResource, resource) require.EqualValues(t, subtest.expectedError.Error(), err.Error()) diff --git a/services/request_service_test.go b/tests/unit-tests/request_service_test.go similarity index 75% rename from services/request_service_test.go rename to tests/unit-tests/request_service_test.go index 758e07ac..4b78c0b4 100644 --- a/services/request_service_test.go +++ b/tests/unit-tests/request_service_test.go @@ -1,4 +1,4 @@ -package services +package tests import ( "encoding/json" @@ -6,22 +6,22 @@ import ( "net/http/httptest" "testing" - did "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" + "github.com/cheqd/did-resolver/services" "github.com/cheqd/did-resolver/types" - "github.com/cheqd/did-resolver/utils" "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" ) func TestResolveDIDDoc(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validMetadata := utils.ValidMetadata() - validResource := utils.ValidResource() - validDIDResolution := types.NewDidDoc(validDIDDoc) + validDIDDoc := ValidDIDDoc() + validMetadata := ValidMetadata() + validResource := ValidResource() + validDIDResolution := types.NewDidDoc(&validDIDDoc) subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService resolutionType types.ContentType did string expectedDID *types.DidDoc @@ -31,28 +31,28 @@ func TestResolveDIDDoc(t *testing.T) { }{ { name: "successful resolution", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, expectedDID: &validDIDResolution, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), + expectedMetadata: types.NewResolutionDidDocMetadata(ValidDid, &validMetadata, []*resourceTypes.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, expectedDID: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, } for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { context, rec := setupContext("/1.0/identifiers/:did", []string{"did"}, []string{subtest.did}, subtest.resolutionType) - requestService := NewRequestService("cheqd", subtest.ledgerService) + requestService := services.NewRequestService("cheqd", subtest.ledgerService) if (subtest.resolutionType == "" || subtest.resolutionType == types.DIDJSONLD) && subtest.expectedError == nil { subtest.expectedDID.Context = []string{types.DIDSchemaJSONLD, types.JsonWebKey2020JSONLD} @@ -81,13 +81,13 @@ func TestResolveDIDDoc(t *testing.T) { } func TestRequestService_DereferenceResourceData(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validMetadata := utils.ValidMetadata() - validResource := utils.ValidResource() + validDIDDoc := ValidDIDDoc() + validMetadata := ValidMetadata() + validResource := ValidResource() validResourceDereferencing := types.DereferencedResourceData(validResource.Resource.Data) subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService resolutionType types.ContentType did string resourceId string @@ -98,23 +98,23 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { }{ { name: "successful resolution", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, - resourceId: utils.ValidResourceId, + did: ValidDid, + resourceId: ValidResourceId, expectedResource: &validResourceDereferencing, - expectedMetadata: types.NewResolutionDidDocMetadata(utils.ValidDid, validMetadata, []*resource.Metadata{validResource.Metadata}), + expectedMetadata: types.NewResolutionDidDocMetadata(ValidDid, &validMetadata, []*resourceTypes.Metadata{validResource.Metadata}), expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, resourceId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", expectedResource: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, } @@ -124,7 +124,7 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { "/1.0/identifiers/:did/resources/:resource", []string{"did", "resource"}, []string{subtest.did, subtest.resourceId}, subtest.resolutionType) - requestService := NewRequestService("cheqd", subtest.ledgerService) + requestService := services.NewRequestService("cheqd", subtest.ledgerService) expectedContentType := validResource.Metadata.MediaType err := requestService.DereferenceResourceData(context) @@ -142,12 +142,12 @@ func TestRequestService_DereferenceResourceData(t *testing.T) { } func TestRequestService_DereferenceResourceMetadata(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validMetadata := utils.ValidMetadata() - validResource := utils.ValidResource() + validDIDDoc := ValidDIDDoc() + validMetadata := ValidMetadata() + validResource := ValidResource() subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService resolutionType types.ContentType did string resourceId string @@ -158,26 +158,26 @@ func TestRequestService_DereferenceResourceMetadata(t *testing.T) { }{ { name: "successful resolution", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, - resourceId: utils.ValidResourceId, + did: ValidDid, + resourceId: ValidResourceId, expectedResource: types.NewDereferencedResourceList( - utils.ValidDid, - []*resource.Metadata{validResource.Metadata}, + ValidDid, + []*resourceTypes.Metadata{validResource.Metadata}, ), expectedMetadata: types.ResolutionDidDocMetadata{}, expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, resourceId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", expectedResource: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, } @@ -187,7 +187,7 @@ func TestRequestService_DereferenceResourceMetadata(t *testing.T) { "/1.0/identifiers/:did/resources/:resource/metadata", []string{"did", "resource"}, []string{subtest.did, subtest.resourceId}, subtest.resolutionType) - requestService := NewRequestService("cheqd", subtest.ledgerService) + requestService := services.NewRequestService("cheqd", subtest.ledgerService) if (subtest.resolutionType == "" || subtest.resolutionType == types.DIDJSONLD) && subtest.expectedError == nil { subtest.expectedResource.AddContext(types.DIDSchemaJSONLD) @@ -221,12 +221,12 @@ func TestRequestService_DereferenceResourceMetadata(t *testing.T) { } func TestRequestService_DereferenceCollectionResources(t *testing.T) { - validDIDDoc := utils.ValidDIDDoc() - validMetadata := utils.ValidMetadata() - validResource := utils.ValidResource() + validDIDDoc := ValidDIDDoc() + validMetadata := ValidMetadata() + validResource := ValidResource() subtests := []struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService resolutionType types.ContentType did string expectedResource *types.DereferencedResourceList @@ -236,24 +236,24 @@ func TestRequestService_DereferenceCollectionResources(t *testing.T) { }{ { name: "successful resolution", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, expectedResource: types.NewDereferencedResourceList( - utils.ValidDid, - []*resource.Metadata{validResource.Metadata}, + ValidDid, + []*resourceTypes.Metadata{validResource.Metadata}, ), expectedMetadata: types.ResolutionDidDocMetadata{}, expectedError: nil, }, { name: "DID not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), resolutionType: types.DIDJSONLD, - did: utils.ValidDid, + did: ValidDid, expectedResource: nil, expectedMetadata: types.ResolutionDidDocMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, false), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, false), }, } @@ -263,7 +263,7 @@ func TestRequestService_DereferenceCollectionResources(t *testing.T) { "/1.0/identifiers/:did/metadata", []string{"did"}, []string{subtest.did}, subtest.resolutionType) - requestService := NewRequestService("cheqd", subtest.ledgerService) + requestService := services.NewRequestService("cheqd", subtest.ledgerService) if (subtest.resolutionType == "" || subtest.resolutionType == types.DIDJSONLD) && subtest.expectedError == nil { subtest.expectedResource.AddContext(types.DIDSchemaJSONLD) diff --git a/services/resource_dereference_service_test.go b/tests/unit-tests/resource_dereference_service_test.go similarity index 62% rename from services/resource_dereference_service_test.go rename to tests/unit-tests/resource_dereference_service_test.go index 89d73b2a..f306e992 100644 --- a/services/resource_dereference_service_test.go +++ b/tests/unit-tests/resource_dereference_service_test.go @@ -1,12 +1,13 @@ -package services +package tests import ( "fmt" "strings" "testing" - did "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" + "github.com/cheqd/did-resolver/services" "github.com/cheqd/did-resolver/types" "github.com/cheqd/did-resolver/utils" "github.com/stretchr/testify/require" @@ -14,7 +15,7 @@ import ( type TestCase struct { name string - ledgerService utils.MockLedgerService + ledgerService MockLedgerService dereferencingType types.ContentType identifier string method string @@ -27,118 +28,118 @@ type TestCase struct { } func getSubtest(validContentStream types.ContentStreamI) []TestCase { - validDIDDoc := utils.ValidDIDDoc() - validResource := utils.ValidResource() - validMetadata := utils.ValidMetadata() + validDIDDoc := ValidDIDDoc() + validResource := ValidResource() + validMetadata := ValidMetadata() return []TestCase{ { name: "successful dereferencing for resource", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), dereferencingType: types.DIDJSON, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, - resourceId: utils.ValidResourceId, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, + resourceId: ValidResourceId, expectedContentStream: validContentStream, expectedMetadata: types.ResolutionResourceMetadata{}, expectedError: nil, }, { name: "successful dereferencing for resource (upper case UUID)", - ledgerService: utils.NewMockLedgerService(validDIDDoc, validMetadata, validResource), + ledgerService: NewMockLedgerService(&validDIDDoc, &validMetadata, &validResource), dereferencingType: types.DIDJSON, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, - resourceId: strings.ToUpper(utils.ValidResourceId), + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, + resourceId: strings.ToUpper(ValidResourceId), expectedContentStream: validContentStream, expectedMetadata: types.ResolutionResourceMetadata{}, expectedError: nil, }, { name: "resource not found", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, resourceId: "a86f9cae-0902-4a7c-a144-96b60ced2fc9", expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, true), }, { name: "invalid resource id", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, resourceId: "invalid-resource-id", expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, true), }, { name: "invalid type", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.JSON, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, - namespace: utils.ValidNamespace, - resourceId: utils.ValidResourceId, + identifier: ValidIdentifier, + method: ValidMethod, + namespace: ValidNamespace, + resourceId: ValidResourceId, expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewRepresentationNotSupportedError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewRepresentationNotSupportedError(ValidDid, types.DIDJSONLD, nil, true), }, { name: "invalid namespace", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, - method: utils.ValidMethod, + identifier: ValidIdentifier, + method: ValidMethod, namespace: "invalid-namespace", - resourceId: utils.ValidResourceId, + resourceId: ValidResourceId, expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, true), }, { name: "invalid method", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, - identifier: utils.ValidIdentifier, + identifier: ValidIdentifier, method: "invalid-method", - namespace: utils.ValidNamespace, - resourceId: utils.ValidResourceId, + namespace: ValidNamespace, + resourceId: ValidResourceId, expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, true), }, { name: "invalid identifier", - ledgerService: utils.NewMockLedgerService(did.DidDoc{}, did.Metadata{}, resource.ResourceWithMetadata{}), + ledgerService: NewMockLedgerService(&didTypes.DidDoc{}, &didTypes.Metadata{}, &resourceTypes.ResourceWithMetadata{}), dereferencingType: types.DIDJSONLD, identifier: "invalid-identifier", - method: utils.ValidMethod, - namespace: utils.ValidNamespace, - resourceId: utils.ValidResourceId, + method: ValidMethod, + namespace: ValidNamespace, + resourceId: ValidResourceId, expectedMetadata: types.ResolutionResourceMetadata{}, - expectedError: types.NewNotFoundError(utils.ValidDid, types.DIDJSONLD, nil, true), + expectedError: types.NewNotFoundError(ValidDid, types.DIDJSONLD, nil, true), }, } } func TestDereferenceResourceMetadata(t *testing.T) { - validResource := utils.ValidResource() - subtests := getSubtest(types.NewDereferencedResourceList(utils.ValidDid, []*resource.Metadata{validResource.Metadata})) + validResource := ValidResource() + subtests := getSubtest(types.NewDereferencedResourceList(ValidDid, []*resourceTypes.Metadata{validResource.Metadata})) for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - resourceService := NewResourceService(utils.ValidMethod, subtest.ledgerService) + resourceService := services.NewResourceService(ValidMethod, subtest.ledgerService) id := "did:" + subtest.method + ":" + subtest.namespace + ":" + subtest.identifier var expectedDIDProperties types.DidProperties if subtest.expectedError == nil { expectedDIDProperties = types.DidProperties{ - DidString: utils.ValidDid, - MethodSpecificId: utils.ValidIdentifier, - Method: utils.ValidMethod, + DidString: ValidDid, + MethodSpecificId: ValidIdentifier, + Method: ValidMethod, } } expectedContentType := subtest.expectedContentType @@ -165,8 +166,9 @@ func TestDereferenceResourceMetadata(t *testing.T) { } func TestDereferenceCollectionResources(t *testing.T) { - validResource := utils.ValidResource() - content := types.NewResolutionDidDocMetadata(utils.ValidDid, utils.ValidMetadata(), []*resource.Metadata{validResource.Metadata}) + validResource := ValidResource() + validMetadata := ValidMetadata() + content := types.NewResolutionDidDocMetadata(ValidDid, &validMetadata, []*resourceTypes.Metadata{validResource.Metadata}) subtests := getSubtest(&content) for _, subtest := range subtests { @@ -174,15 +176,15 @@ func TestDereferenceCollectionResources(t *testing.T) { if !utils.IsValidResourceId(subtest.resourceId) { return } - resourceService := NewResourceService(utils.ValidMethod, subtest.ledgerService) + resourceService := services.NewResourceService(ValidMethod, subtest.ledgerService) id := "did:" + subtest.method + ":" + subtest.namespace + ":" + subtest.identifier var expectedDIDProperties types.DidProperties if subtest.expectedError == nil { expectedDIDProperties = types.DidProperties{ - DidString: utils.ValidDid, - MethodSpecificId: utils.ValidIdentifier, - Method: utils.ValidMethod, + DidString: ValidDid, + MethodSpecificId: ValidIdentifier, + Method: ValidMethod, } } expectedContentType := subtest.expectedContentType @@ -208,21 +210,21 @@ func TestDereferenceCollectionResources(t *testing.T) { } func TestDereferenceResourceData(t *testing.T) { - validResource := utils.ValidResource() + validResource := ValidResource() validResourceData := types.DereferencedResourceData(validResource.Resource.Data) subtests := getSubtest(&validResourceData) for _, subtest := range subtests { t.Run(subtest.name, func(t *testing.T) { - resourceService := NewResourceService(utils.ValidMethod, subtest.ledgerService) + resourceService := services.NewResourceService(ValidMethod, subtest.ledgerService) id := "did:" + subtest.method + ":" + subtest.namespace + ":" + subtest.identifier var expectedDIDProperties types.DidProperties if subtest.expectedError == nil { expectedDIDProperties = types.DidProperties{ - DidString: utils.ValidDid, - MethodSpecificId: utils.ValidIdentifier, - Method: utils.ValidMethod, + DidString: ValidDid, + MethodSpecificId: ValidIdentifier, + Method: ValidMethod, } } expectedContentType := validResource.Metadata.MediaType diff --git a/utils/test_utils.go b/tests/unit-tests/test_utils.go similarity index 70% rename from utils/test_utils.go rename to tests/unit-tests/test_utils.go index a8c2cb48..7ef6de86 100644 --- a/utils/test_utils.go +++ b/tests/unit-tests/test_utils.go @@ -1,12 +1,13 @@ -package utils +package tests import ( "crypto/sha256" "fmt" - didTypes "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" "github.com/cheqd/did-resolver/types" + "google.golang.org/protobuf/types/known/timestamppb" ) const ( @@ -23,6 +24,14 @@ const ( "}" ) +var ( + EmptyTimestamp = ×tamppb.Timestamp{ + Seconds: 0, + Nanos: 0, + } + EmptyTime = EmptyTimestamp.AsTime() +) + func ValidVerificationMethod() didTypes.VerificationMethod { return didTypes.VerificationMethod{ Id: ValidDid + "#key-1", @@ -51,14 +60,14 @@ func ValidDIDDoc() didTypes.DidDoc { } } -func ValidResource() resource.ResourceWithMetadata { +func ValidResource() resourceTypes.ResourceWithMetadata { data := []byte("{\"attr\":[\"name\",\"age\"]}") checksum := sha256.New().Sum(data) - return resource.ResourceWithMetadata{ - Resource: &resource.Resource{ + return resourceTypes.ResourceWithMetadata{ + Resource: &resourceTypes.Resource{ Data: data, }, - Metadata: &resource.Metadata{ + Metadata: &resourceTypes.Metadata{ CollectionId: ValidIdentifier, Id: ValidResourceId, Name: ValidResourceId, @@ -74,12 +83,12 @@ func ValidMetadata() didTypes.Metadata { } type MockLedgerService struct { - Did didTypes.DidDoc - Metadata didTypes.Metadata - Resource resource.ResourceWithMetadata + Did *didTypes.DidDoc + Metadata *didTypes.Metadata + Resource *resourceTypes.ResourceWithMetadata } -func NewMockLedgerService(did didTypes.DidDoc, metadata didTypes.Metadata, resource resource.ResourceWithMetadata) MockLedgerService { +func NewMockLedgerService(did *didTypes.DidDoc, metadata *didTypes.Metadata, resource *resourceTypes.ResourceWithMetadata) MockLedgerService { return MockLedgerService{ Did: did, Metadata: metadata, @@ -90,31 +99,31 @@ func NewMockLedgerService(did didTypes.DidDoc, metadata didTypes.Metadata, resou func (ls MockLedgerService) QueryDIDDoc(did string, version string) (*didTypes.DidDocWithMetadata, *types.IdentityError) { if did == ls.Did.Id { println("query !!!" + ls.Did.Id) - return &didTypes.DidDocWithMetadata{DidDoc: &ls.Did, Metadata: &ls.Metadata}, nil + return &didTypes.DidDocWithMetadata{DidDoc: ls.Did, Metadata: ls.Metadata}, nil } return nil, types.NewNotFoundError(did, types.JSON, nil, true) } func (ls MockLedgerService) QueryAllDidDocVersionsMetadata(did string) ([]*didTypes.Metadata, *types.IdentityError) { if did == ls.Did.Id { - return []*didTypes.Metadata{&ls.Metadata}, nil + return []*didTypes.Metadata{ls.Metadata}, nil } return nil, types.NewNotFoundError(did, types.JSON, nil, true) } -func (ls MockLedgerService) QueryResource(did string, resourceId string) (*resource.ResourceWithMetadata, *types.IdentityError) { +func (ls MockLedgerService) QueryResource(did string, resourceId string) (*resourceTypes.ResourceWithMetadata, *types.IdentityError) { if ls.Resource.Metadata == nil || ls.Resource.Metadata.Id != resourceId { return nil, types.NewNotFoundError(did, types.JSON, nil, true) } - return &ls.Resource, nil + return ls.Resource, nil } -func (ls MockLedgerService) QueryCollectionResources(did string) ([]*resource.Metadata, *types.IdentityError) { +func (ls MockLedgerService) QueryCollectionResources(did string) ([]*resourceTypes.Metadata, *types.IdentityError) { if ls.Resource.Metadata == nil { - return []*resource.Metadata{}, types.NewNotFoundError(did, types.JSON, nil, true) + return []*resourceTypes.Metadata{}, types.NewNotFoundError(did, types.JSON, nil, true) } - return []*resource.Metadata{ls.Resource.Metadata}, nil + return []*resourceTypes.Metadata{ls.Resource.Metadata}, nil } func (ls MockLedgerService) GetNamespaces() []string { diff --git a/types/dereferecing_metadata.go b/types/dereferecing_metadata.go index 42360db6..65021f50 100644 --- a/types/dereferecing_metadata.go +++ b/types/dereferecing_metadata.go @@ -1,7 +1,7 @@ package types import ( - didTypes "github.com/cheqd/cheqd-node/x/did/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" ) type DereferencingMetadata ResolutionMetadata @@ -53,7 +53,7 @@ type DereferencedDidVersionsList struct { func NewDereferencedDidVersionsList(versions []*didTypes.Metadata) *DereferencedDidVersionsList { didVersionList := []ResolutionDidDocMetadata{} for _, version := range versions { - didVersionList = append(didVersionList, NewResolutionDidDocMetadata("", *version, nil)) + didVersionList = append(didVersionList, NewResolutionDidDocMetadata("", version, nil)) } return &DereferencedDidVersionsList{ diff --git a/types/dereferencing_content_stream.go b/types/dereferencing_content_stream.go index 79cb50ed..afa45139 100644 --- a/types/dereferencing_content_stream.go +++ b/types/dereferencing_content_stream.go @@ -3,23 +3,23 @@ package types import ( "time" - resource "github.com/cheqd/cheqd-node/x/resource/types" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" ) type DereferencedResource struct { - ResourceURI string `json:"resourceURI" example:"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"` - CollectionId string `json:"resourceCollectionId" example:"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"` - ResourceId string `json:"resourceId" example:"398cee0a-efac-4643-9f4c-74c48c72a14b"` - Name string `json:"resourceName" example:"Image Resource"` - ResourceType string `json:"resourceType" example:"Image"` - MediaType string `json:"mediaType" example:"image/png"` - Created time.Time `json:"created" example:"2021-09-01T12:00:00Z"` - Checksum string `json:"checksum" example:"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"` - PreviousVersionId *string `json:"previousVersionId" example:"ad7a8442-3531-46eb-a024-53953ec6e4ff"` - NextVersionId *string `json:"nextVersionId" example:"d4829ac7-4566-478c-a408-b44767eddadc"` + ResourceURI string `json:"resourceURI" example:"did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47/resources/398cee0a-efac-4643-9f4c-74c48c72a14b"` + CollectionId string `json:"resourceCollectionId" example:"55dbc8bf-fba3-4117-855c-1e0dc1d3bb47"` + ResourceId string `json:"resourceId" example:"398cee0a-efac-4643-9f4c-74c48c72a14b"` + Name string `json:"resourceName" example:"Image Resource"` + ResourceType string `json:"resourceType" example:"Image"` + MediaType string `json:"mediaType" example:"image/png"` + Created *time.Time `json:"created" example:"2021-09-01T12:00:00Z"` + Checksum string `json:"checksum" example:"a95380f460e63ad939541a57aecbfd795fcd37c6d78ee86c885340e33a91b559"` + PreviousVersionId *string `json:"previousVersionId" example:"ad7a8442-3531-46eb-a024-53953ec6e4ff"` + NextVersionId *string `json:"nextVersionId" example:"d4829ac7-4566-478c-a408-b44767eddadc"` } -func NewDereferencedResource(did string, resource *resource.Metadata) *DereferencedResource { +func NewDereferencedResource(did string, resource *resourceTypes.Metadata) *DereferencedResource { var previousVersionId, nextVersionId *string if resource.PreviousVersionId != "" { previousVersionId = &resource.PreviousVersionId @@ -27,6 +27,7 @@ func NewDereferencedResource(did string, resource *resource.Metadata) *Dereferen if resource.NextVersionId != "" { nextVersionId = &resource.NextVersionId } + created := resource.Created.AsTime() return &DereferencedResource{ ResourceURI: did + RESOURCE_PATH + resource.Id, CollectionId: resource.CollectionId, @@ -34,7 +35,7 @@ func NewDereferencedResource(did string, resource *resource.Metadata) *Dereferen Name: resource.Name, ResourceType: resource.ResourceType, MediaType: resource.MediaType, - Created: resource.Created, + Created: &created, Checksum: resource.Checksum, PreviousVersionId: previousVersionId, NextVersionId: nextVersionId, @@ -45,7 +46,7 @@ type DereferencedResourceList struct { Resources []DereferencedResource `json:"linkedResourceMetadata,omitempty"` } -func NewDereferencedResourceList(did string, protoResources []*resource.Metadata) *DereferencedResourceList { +func NewDereferencedResourceList(did string, protoResources []*resourceTypes.Metadata) *DereferencedResourceList { resourceList := []DereferencedResource{} for _, r := range protoResources { resourceList = append(resourceList, *NewDereferencedResource(did, r)) diff --git a/types/did_doc.go b/types/did_doc.go index 37f3246d..4babe417 100644 --- a/types/did_doc.go +++ b/types/did_doc.go @@ -3,7 +3,7 @@ package types import ( "encoding/json" - did "github.com/cheqd/cheqd-node/x/did/types" + did "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" ) type DidDoc struct { @@ -39,7 +39,7 @@ type Service struct { ServiceEndpoint []string `json:"serviceEndpoint,omitempty" example:"https://example.com/endpoint/8377464"` } -func NewDidDoc(protoDidDoc did.DidDoc) DidDoc { +func NewDidDoc(protoDidDoc *did.DidDoc) DidDoc { verificationMethods := []VerificationMethod{} for _, vm := range protoDidDoc.VerificationMethod { verificationMethods = append(verificationMethods, *NewVerificationMethod(vm)) diff --git a/types/did_doc_metadata.go b/types/did_doc_metadata.go index b505e048..87674afc 100644 --- a/types/did_doc_metadata.go +++ b/types/did_doc_metadata.go @@ -3,12 +3,10 @@ package types import ( "time" - did "github.com/cheqd/cheqd-node/x/did/types" - resource "github.com/cheqd/cheqd-node/x/resource/types" + didTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/did/v2" + resourceTypes "github.com/cheqd/cheqd-node/api/v2/cheqd/resource/v2" ) -// Changed "Created time.Time" to "Create *time.Time". -// It needs to skip Created field when is empty. type ResolutionDidDocMetadata struct { Created *time.Time `json:"created,omitempty" example:"2021-09-01T12:00:00Z"` Updated *time.Time `json:"updated,omitempty" example:"2021-09-10T12:00:00Z"` @@ -17,22 +15,12 @@ type ResolutionDidDocMetadata struct { Resources []DereferencedResource `json:"linkedResourceMetadata,omitempty"` } -func NewResolutionDidDocMetadata(did string, metadata did.Metadata, resources []*resource.Metadata) ResolutionDidDocMetadata { - created := &metadata.Created - if created.IsZero() { - created = nil - } - - updated := metadata.Updated - if updated != nil { - if updated.IsZero() { - updated = nil - } - } - +func NewResolutionDidDocMetadata(did string, metadata *didTypes.Metadata, resources []*resourceTypes.Metadata) ResolutionDidDocMetadata { + created := metadata.Created.AsTime() + updated := metadata.Updated.AsTime() newMetadata := ResolutionDidDocMetadata{ - Created: created, - Updated: updated, + Created: &created, + Updated: &updated, Deactivated: metadata.Deactivated, VersionId: metadata.VersionId, } diff --git a/types/resolution_metadata.go b/types/resolution_metadata.go index 52a14cd1..b3e25cac 100644 --- a/types/resolution_metadata.go +++ b/types/resolution_metadata.go @@ -1,9 +1,9 @@ package types import ( + "errors" + "regexp" "time" - - didUtils "github.com/cheqd/cheqd-node/x/did/utils" ) type ResolutionMetadata struct { @@ -27,8 +27,8 @@ type DidResolution struct { } func NewResolutionMetadata(didUrl string, contentType ContentType, resolutionError string) ResolutionMetadata { - did, _, _, _, err1 := didUtils.TrySplitDIDUrl(didUrl) - method, _, id, err2 := didUtils.TrySplitDID(did) + did, _, _, _, err1 := TrySplitDIDUrl(didUrl) + method, _, id, err2 := TrySplitDID(did) var didProperties DidProperties if err1 == nil && err2 == nil { didProperties = DidProperties{ @@ -52,3 +52,58 @@ func (r DidResolution) GetContentType() string { func (r DidResolution) GetBytes() []byte { return []byte{} } + +// SplitDIDURLRegexp ... +// That for groups: +// Example: did:cheqd:testnet:fafdsffq11213343/path-to-s/ome-external-resource?query#key1??? +// 1 - [^/?#]* - all the symbols except / and ? and # . This is the DID part (did:cheqd:testnet:fafdsffq11213343) +// 2 - [^?#]* - all the symbols except ? and #. it means te section started from /, path-abempty (/path-to-s/ome-external-resource) +// 3 - \?([^#]*) - group for `query` part but with ? symbol (?query) +// 4 - [^#]* - group inside query string, match only exact query (query) +// 5 - #([^#]+[\$]?) - group for fragment, starts with #, includes # (#key1???) +// 6 - [^#]+[\$]? - fragment only (key1???) +// Number of queries is not limited. +var SplitDIDURLRegexp = regexp.MustCompile(`([^/?#]*)?([^?#]*)(\?([^#]*))?(#([^#]+$))?$`) + +var ( + DIDPathAbemptyRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@]*|(%[0-9A-Fa-f]{2})*)*$`) + DIDQueryRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) + DIDFragmentRegexp = regexp.MustCompile(`^([/a-zA-Z0-9\-\.\_\~\!\$\&\'\(\)\*\+\,\;\=\:\@\/\?]*|(%[0-9A-Fa-f]{2})*)*$`) +) + +// TrySplitDIDUrl Validates generic format of DIDUrl. It doesn't validate path, query and fragment content. +// Call ValidateDIDUrl for further validation. +func TrySplitDIDUrl(didURL string) (did string, path string, query string, fragment string, err error) { + matches := SplitDIDURLRegexp.FindAllStringSubmatch(didURL, -1) + + if len(matches) != 1 { + return "", "", "", "", errors.New("unable to split did url into did, path, query and fragment") + } + + match := matches[0] + + return match[1], match[2], match[4], match[6], nil +} + +var ( + SplitDIDRegexp = regexp.MustCompile(`^did:([^:]+?)(:([^:]+?))?:([^:]+)$`) + DidNamespaceRegexp = regexp.MustCompile(`^[a-zA-Z0-9]*$`) +) + +// TrySplitDID Validates generic format of DID. It doesn't validate method, name and id content. +// Call ValidateDID for further validation. +func TrySplitDID(did string) (method string, namespace string, id string, err error) { + // Example: did:cheqd:testnet:base58str1ng1111 + // match [0] - the whole string + // match [1] - cheqd - method + // match [2] - :testnet + // match [3] - testnet - namespace + // match [4] - base58str1ng1111 - id + matches := SplitDIDRegexp.FindAllStringSubmatch(did, -1) + if len(matches) != 1 { + return "", "", "", errors.New("unable to split did into method, namespace and id") + } + + match := matches[0] + return match[1], match[3], match[4], nil +} diff --git a/utils/did.go b/utils/did.go new file mode 100644 index 00000000..c3593efe --- /dev/null +++ b/utils/did.go @@ -0,0 +1,62 @@ +package utils + +import ( + "errors" + "fmt" + "strings" + + "github.com/cheqd/did-resolver/types" +) + +func MustSplitDID(did string) (method string, namespace string, id string) { + method, namespace, id, err := types.TrySplitDID(did) + if err != nil { + panic(err.Error()) + } + return +} + +func JoinDID(method, namespace, id string) string { + res := "did:" + method + + if namespace != "" { + res = res + ":" + namespace + } + + return res + ":" + id +} + +// ValidateDID checks method and allowed namespaces only when the corresponding parameters are specified. +func ValidateDID(did string, method string, allowedNamespaces []string) error { + sMethod, sNamespace, sUniqueID, err := types.TrySplitDID(did) + if err != nil { + return err + } + + // check method + if method != "" && method != sMethod { + return fmt.Errorf("did method must be: %s", method) + } + + // check namespaces + if !types.DidNamespaceRegexp.MatchString(sNamespace) { + return errors.New("invalid did namespace") + } + + if len(allowedNamespaces) > 0 && !Contains(allowedNamespaces, sNamespace) { + return fmt.Errorf("did namespace must be one of: %s", strings.Join(allowedNamespaces, ", ")) + } + + // check unique-id + err = ValidateID(sUniqueID) + if err != nil { + return err + } + + return err +} + +func IsValidDID(did string, method string, allowedNamespaces []string) bool { + err := ValidateDID(did, method, allowedNamespaces) + return err == nil +} diff --git a/utils/did_url.go b/utils/did_url.go index 40dde1f4..471df9d1 100644 --- a/utils/did_url.go +++ b/utils/did_url.go @@ -1,10 +1,10 @@ package utils import ( - "strings" + "errors" + "fmt" - migrations "github.com/cheqd/cheqd-node/app/migrations/helpers" - didUtils "github.com/cheqd/cheqd-node/x/did/utils" + "github.com/cheqd/did-resolver/types" "github.com/google/uuid" ) @@ -13,22 +13,103 @@ func IsValidResourceId(u string) bool { return err == nil } -func IsValidIndyV1ID(id string) bool { - return len(id) == 16 && didUtils.IsValidBase58(id) || - len(id) == 32 && didUtils.IsValidBase58(id) +func ValidateV1ID(id string) error { + isValidId := len(id) == 16 && IsValidBase58(id) || + len(id) == 32 && IsValidBase58(id) || + IsValidUUID(id) + + if !isValidId { + return errors.New("unique id should be one of: 16 symbols base58 string, 32 symbols base58 string, or UUID") + } + + return nil +} + +func IsValidV1ID(id string) bool { + err := ValidateV1ID(id) + return err == nil } -func IsValidUUIDV1ID(id string) bool { - return didUtils.IsValidUUID(id) && strings.ToLower(id) != id +func MustSplitDIDUrl(didURL string) (did string, path string, query string, fragment string) { + did, path, query, fragment, err := types.TrySplitDIDUrl(didURL) + if err != nil { + panic(err.Error()) + } + return } -func IsMigrationNeeded(id string) bool { - return IsValidIndyV1ID(id) || IsValidUUIDV1ID(id) +func JoinDIDUrl(did string, path string, query string, fragment string) string { + res := did + path + + if query != "" { + res = res + "?" + query + } + + if fragment != "" { + res = res + "#" + fragment + } + + return res +} + +// ValidateDIDUrl checks method and allowed namespaces only when the corresponding parameters are specified. +func ValidateDIDUrl(didURL string, method string, allowedNamespaces []string) error { + did, path, query, fragment, err := types.TrySplitDIDUrl(didURL) + if err != nil { + return err + } + + // Validate DID + err = ValidateDID(did, method, allowedNamespaces) + if err != nil { + return err + } + // Validate path + err = ValidatePath(path) + if err != nil { + return err + } + // Validate query + err = ValidateQuery(query) + if err != nil { + return err + } + // Validate fragment + err = ValidateFragment(fragment) + if err != nil { + return err + } + + return nil +} + +func ValidateFragment(fragment string) error { + if !types.DIDFragmentRegexp.MatchString(fragment) { + return fmt.Errorf("did url fragment must match the following regexp: %s", types.DIDFragmentRegexp) + } + return nil } -func MigrateDID(did string) string { - did = migrations.MigrateIndyStyleDid(did) - did = migrations.MigrateUUIDDid(did) +func ValidateQuery(query string) error { + if !types.DIDQueryRegexp.MatchString(query) { + return fmt.Errorf("did url query must match the following regexp: %s", types.DIDQueryRegexp) + } + return nil +} - return did +func ValidatePath(path string) error { + if !types.DIDPathAbemptyRegexp.MatchString(path) { + return fmt.Errorf("did url path abempty must match the following regexp: %s", types.DIDPathAbemptyRegexp) + } + return nil +} + +func IsValidDIDUrl(didURL string, method string, allowedNamespaces []string) bool { + err := ValidateDIDUrl(didURL, method, allowedNamespaces) + + return nil == err +} + +func IsMigrationNeeded(id string) bool { + return IsValidV1ID(id) } diff --git a/utils/encoding.go b/utils/encoding.go new file mode 100644 index 00000000..81125ba2 --- /dev/null +++ b/utils/encoding.go @@ -0,0 +1,29 @@ +package utils + +import ( + "fmt" + + "github.com/multiformats/go-multibase" +) + +func ValidateMultibaseEncoding(data string, expectedEncoding multibase.Encoding) error { + actualEncoding, _, err := multibase.Decode(data) + if err != nil { + return err + } + + if actualEncoding != expectedEncoding { + return fmt.Errorf("invalid actualEncoding. expected: %s actual: %s", + multibase.EncodingToStr[expectedEncoding], multibase.EncodingToStr[actualEncoding]) + } + + return nil +} + +func ValidateBase58(data string) error { + return ValidateMultibaseEncoding(string(multibase.Base58BTC)+data, multibase.Base58BTC) +} + +func IsValidBase58(data string) bool { + return ValidateBase58(data) == nil +} diff --git a/utils/id.go b/utils/id.go new file mode 100644 index 00000000..998657d1 --- /dev/null +++ b/utils/id.go @@ -0,0 +1,34 @@ +package utils + +import ( + "errors" + + "github.com/mr-tron/base58" +) + +const ( + IndyIDLength = 16 +) + +func IsValidIndyID(data string) bool { + bytes, err := base58.Decode(data) + if err != nil { + return false + } + return len(bytes) == IndyIDLength +} + +func ValidateID(id string) error { + isValidID := IsValidIndyID(id) || IsValidUUID(id) + + if !isValidID { + return errors.New("unique id should be one of: 16 bytes of decoded base58 string or UUID") + } + + return nil +} + +func IsValidID(id string) bool { + err := ValidateID(id) + return err == nil +} diff --git a/utils/str.go b/utils/str.go new file mode 100644 index 00000000..51a7653f --- /dev/null +++ b/utils/str.go @@ -0,0 +1,15 @@ +package utils + +func IndexOf(array []string, searchElement string, fromIndex int) int { + for i, v := range array[fromIndex:] { + if v == searchElement { + return fromIndex + i + } + } + + return -1 +} + +func Contains(vs []string, t string) bool { + return IndexOf(vs, t, 0) >= 0 +} diff --git a/utils/uuid.go b/utils/uuid.go new file mode 100644 index 00000000..1269aafd --- /dev/null +++ b/utils/uuid.go @@ -0,0 +1,30 @@ +package utils + +import ( + "errors" + "strconv" + "strings" + + "github.com/google/uuid" +) + +const StandardUUIDLength = 36 + +func ValidateUUID(u string) error { + if len(u) != StandardUUIDLength { + return errors.New("uuid must be of length " + strconv.Itoa(StandardUUIDLength) + " (in form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)") + } + + _, err := uuid.Parse(u) + return err +} + +func IsValidUUID(u string) bool { + return ValidateUUID(u) == nil +} + +// Normalization + +func NormalizeUUID(uuid string) string { + return strings.ToLower(uuid) +}