diff --git a/go.mod b/go.mod index 422533c4666d166c10ec86bb652f21e8b63cab56..9f0fa8826937a5ffa41bf934cbb6ab8c398064c3 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/hack-pad/go-indexeddb v0.2.0 github.com/pkg/errors v0.9.1 github.com/spf13/jwalterweatherman v1.1.0 - gitlab.com/elixxir/client v1.5.1-0.20221021211331-d639eea870fc - gitlab.com/elixxir/crypto v0.0.7-0.20221021185743-d26832a1197a + gitlab.com/elixxir/client v1.5.1-0.20221022003714-8980452f25e5 + gitlab.com/elixxir/crypto v0.0.7-0.20221022003355-d8a6158b32a7 gitlab.com/elixxir/primitives v0.0.3-0.20221017172918-6176818d1aba gitlab.com/xx_network/crypto v0.0.5-0.20221017172404-b384a8d8b171 gitlab.com/xx_network/primitives v0.0.4-0.20221017171439-42169a3e5c0d @@ -23,34 +23,20 @@ require ( github.com/cloudflare/circl v1.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/elliotchance/orderedmap v1.4.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.11.7 // indirect github.com/klauspost/cpuid/v2 v2.1.0 // indirect - github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect - github.com/pkg/profile v1.6.0 // indirect github.com/rs/cors v1.8.2 // indirect github.com/sethvargo/go-diceware v0.3.0 // indirect github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect github.com/soheilhy/cmux v0.1.5 // indirect - github.com/spf13/afero v1.9.2 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.5.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.12.0 // indirect - github.com/subosito/gotenv v1.4.0 // indirect github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect github.com/ttacon/libphonenumber v1.2.1 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect @@ -68,8 +54,5 @@ require ( google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect google.golang.org/grpc v1.49.0 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.7 // indirect ) diff --git a/go.sum b/go.sum index f8cd131fb9954d4421bedd3020e67aa71a909cb3..9ac20560b7d4e69c4029a5a9b2627379b5d6c9e0 100644 --- a/go.sum +++ b/go.sum @@ -165,7 +165,6 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= 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.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -331,7 +330,6 @@ github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA 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.4/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/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= @@ -349,7 +347,6 @@ github.com/improbable-eng/grpc-web v0.12.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6 github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -405,7 +402,6 @@ github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0U github.com/liyue201/goqr v0.0.0-20200803022322-df443203d4ea h1:uyJ13zfy6l79CM3HnVhDalIyZ4RJAyVfDrbnfFeJoC4= github.com/liyue201/goqr v0.0.0-20200803022322-df443203d4ea/go.mod h1:w4pGU9PkiX2hAWyF0yuHEHmYTQFAd6WHzp6+IY7JVjE= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -438,7 +434,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -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/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -484,10 +479,8 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -497,7 +490,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.6.0 h1:hUDfIISABYI59DyeB3OTay/HxSRwTQ8rB/H83k6r5dM= github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -564,19 +556,14 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= -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.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= 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.1/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.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -595,7 +582,6 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 h1:5u+EJUQiosu3JFX0XS0qTf5FznsMOzTjGqavBGuCbo0= @@ -630,27 +616,15 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f h1:yXGvNBqzZwAhDYlSnxPRbgor6JWoOt1Z7s3z1O9JR40= gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/client v1.5.1-0.20221019000148-2cece7473a2b h1:8FtDW5+g/lWK09RMTgNVuMcLItntslH9pikSGpT1HkQ= -gitlab.com/elixxir/client v1.5.1-0.20221019000148-2cece7473a2b/go.mod h1:/j/GbuxAVfR5cqLqYAq5s8IgafpyHVO63efwh/Xob4w= -gitlab.com/elixxir/client v1.5.1-0.20221020221442-96d5b780dc6c h1:Yj4wTFBa8Kzje+6PuEvgFt9abF0UoP6pjGWxAZGbKX8= -gitlab.com/elixxir/client v1.5.1-0.20221020221442-96d5b780dc6c/go.mod h1:/j/GbuxAVfR5cqLqYAq5s8IgafpyHVO63efwh/Xob4w= -gitlab.com/elixxir/client v1.5.1-0.20221020231618-fbe7fb53bdc4 h1:FL/iuSNqV2zNZkqeddZgOkkby4kVX/Mk1jsYZDTIZb0= -gitlab.com/elixxir/client v1.5.1-0.20221020231618-fbe7fb53bdc4/go.mod h1:MxXSZ7HShzdQ383LkxaWdA7tawpKCpjJw/BHtDEDvx0= -gitlab.com/elixxir/client v1.5.1-0.20221021203835-4d25a8f65353 h1:HiF7Nxwcsk0sSTrpDvPMG0+mGxL0TjJ9J1/8GcKtiaY= -gitlab.com/elixxir/client v1.5.1-0.20221021203835-4d25a8f65353/go.mod h1:vADvJNa+AD599FSMC8UB1Adulg1b0JQu37weyfeMFvA= -gitlab.com/elixxir/client v1.5.1-0.20221021211331-d639eea870fc h1:Iv7p5HB1fJiaTzL1qi/ZHBXweMQ5lIRjf540N6Htd2o= -gitlab.com/elixxir/client v1.5.1-0.20221021211331-d639eea870fc/go.mod h1:vADvJNa+AD599FSMC8UB1Adulg1b0JQu37weyfeMFvA= +gitlab.com/elixxir/client v1.5.1-0.20221022003714-8980452f25e5 h1:8SsC+GZYTZBDMn47OpSBc1kRVvFpx0IYZG6B8sL9BzU= +gitlab.com/elixxir/client v1.5.1-0.20221022003714-8980452f25e5/go.mod h1:a5pLHWVKdwacbyL9yGlV/xP5xHbhC2ycqTbEsDyzjo4= gitlab.com/elixxir/comms v0.0.4-0.20221017173926-4eaa6061dfaa h1:/FEpu0N0rAyq74FkvO3uY8BcQoWLSbVPhj/s5QfscZw= gitlab.com/elixxir/comms v0.0.4-0.20221017173926-4eaa6061dfaa/go.mod h1:rW7xdbHntP2MoF3q+2+f+IR8OHol94MRyviotfR5rXg= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= gitlab.com/elixxir/crypto v0.0.7-0.20221017173452-565da4101a3b/go.mod h1:1rftbwSVdy49LkBIkPr+w+P2mDOerYeBKoZuB3r0yqI= -gitlab.com/elixxir/crypto v0.0.7-0.20221017204335-9201b3672f3a h1:RxobrpD5owwdyNg5KTqBINJ8z0zsXsbu+UhMEC80wIE= -gitlab.com/elixxir/crypto v0.0.7-0.20221017204335-9201b3672f3a/go.mod h1:1rftbwSVdy49LkBIkPr+w+P2mDOerYeBKoZuB3r0yqI= -gitlab.com/elixxir/crypto v0.0.7-0.20221020231252-3c82f61ce90f h1:Gb9CUZ4Ln3iB/qFS7paZ1AwYObdhf4aYy9RJq79lSDI= -gitlab.com/elixxir/crypto v0.0.7-0.20221020231252-3c82f61ce90f/go.mod h1:1rftbwSVdy49LkBIkPr+w+P2mDOerYeBKoZuB3r0yqI= -gitlab.com/elixxir/crypto v0.0.7-0.20221021185743-d26832a1197a h1:niF6yQflBFYXKl95pJLMWQCmwH2D29lovZlTqoAzbEY= -gitlab.com/elixxir/crypto v0.0.7-0.20221021185743-d26832a1197a/go.mod h1:1rftbwSVdy49LkBIkPr+w+P2mDOerYeBKoZuB3r0yqI= +gitlab.com/elixxir/crypto v0.0.7-0.20221022003355-d8a6158b32a7 h1:+8DHBxZxJcmJSmcUFK4ZjjXgwV3wSo9O4+4NCaLdO4c= +gitlab.com/elixxir/crypto v0.0.7-0.20221022003355-d8a6158b32a7/go.mod h1:P/S3pEPYl7fuHQ1m4mL2pIaCxAjYIXrJml/pnfofI+U= gitlab.com/elixxir/ekv v0.2.1 h1:dtwbt6KmAXG2Tik5d60iDz2fLhoFBgWwST03p7T+9Is= gitlab.com/elixxir/ekv v0.2.1/go.mod h1:USLD7xeDnuZEavygdrgzNEwZXeLQJK/w1a+htpN+JEU= gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d/go.mod h1:OQgUZq7SjnE0b+8+iIAT2eqQF+2IFHn73tOo+aV11mg= @@ -1234,7 +1208,6 @@ 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= diff --git a/main.go b/main.go index 08f31ea22e609f36d3ba1372123dbca320596ee7..30013ac04b54b29f28fa8fa0cce76f74eff31849 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( "fmt" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/bindings" - "gitlab.com/elixxir/xxdk-wasm/creds" + "gitlab.com/elixxir/xxdk-wasm/storage" "gitlab.com/elixxir/xxdk-wasm/utils" "gitlab.com/elixxir/xxdk-wasm/wasm" "os" @@ -28,7 +28,7 @@ func init() { jww.SetStdoutThreshold(jww.LevelFatal + 1) // Check that the WASM binary version is correct - err := utils.CheckAndStoreVersions() + err := storage.CheckAndStoreVersions() if err != nil { jww.FATAL.Panicf("WASM binary version error: %+v", err) } @@ -38,11 +38,11 @@ func main() { fmt.Println("Starting xxDK WebAssembly bindings.") fmt.Printf("Client version %s\n", bindings.GetVersion()) - // creds/password.go - js.Global().Set("GetOrInitPassword", js.FuncOf(creds.GetOrInitPassword)) + // storage/password.go + js.Global().Set("GetOrInitPassword", js.FuncOf(storage.GetOrInitPassword)) js.Global().Set("ChangeExternalPassword", - js.FuncOf(creds.ChangeExternalPassword)) - js.Global().Set("VerifyPassword", js.FuncOf(creds.VerifyPassword)) + js.FuncOf(storage.ChangeExternalPassword)) + js.Global().Set("VerifyPassword", js.FuncOf(storage.VerifyPassword)) // utils/array.go js.Global().Set("Uint8ArrayToBase64", js.FuncOf(utils.Uint8ArrayToBase64)) @@ -71,6 +71,9 @@ func main() { js.Global().Set("LoadChannelsManagerWithIndexedDb", js.FuncOf(wasm.LoadChannelsManagerWithIndexedDb)) js.Global().Set("GenerateChannel", js.FuncOf(wasm.GenerateChannel)) + js.Global().Set("DecodePublicURL", js.FuncOf(wasm.DecodePublicURL)) + js.Global().Set("DecodePrivateURL", js.FuncOf(wasm.DecodePrivateURL)) + js.Global().Set("GetChannelJSON", js.FuncOf(wasm.GetChannelJSON)) js.Global().Set("GetChannelInfo", js.FuncOf(wasm.GetChannelInfo)) js.Global().Set("GetShareUrlType", js.FuncOf(wasm.GetShareUrlType)) js.Global().Set("IsNicknameValid", js.FuncOf(wasm.IsNicknameValid)) diff --git a/utils/localStorage.go b/storage/localStorage.go similarity index 99% rename from utils/localStorage.go rename to storage/localStorage.go index b0bd76be067b850043c69733f58770957e9d695c..2f2329209ca951c5f1dcc4e063dfde9ba9edc7f4 100644 --- a/utils/localStorage.go +++ b/storage/localStorage.go @@ -7,7 +7,7 @@ //go:build js && wasm -package utils +package storage import ( "encoding/base64" diff --git a/utils/localStorage_test.go b/storage/localStorage_test.go similarity index 99% rename from utils/localStorage_test.go rename to storage/localStorage_test.go index e102a1052c5c22042c1b5f5dc6c0c352855147a7..155bd7c4c32a558f05ea14989f18c1cb83a38051 100644 --- a/utils/localStorage_test.go +++ b/storage/localStorage_test.go @@ -7,7 +7,7 @@ //go:build js && wasm -package utils +package storage import ( "bytes" diff --git a/creds/password.go b/storage/password.go similarity index 97% rename from creds/password.go rename to storage/password.go index 58eb8d9ffe3c002963702d6f2573ec4c031d3ca9..6b838a1fd492d6a4e71b69ce815a21d07195865f 100644 --- a/creds/password.go +++ b/storage/password.go @@ -7,7 +7,7 @@ //go:build js && wasm -package creds +package storage import ( "crypto/cipher" @@ -130,7 +130,7 @@ func VerifyPassword(_ js.Value, args []js.Value) interface{} { // getOrInit is the private function for GetOrInitPassword that is used for // testing. func getOrInit(externalPassword string) ([]byte, error) { - localStorage := utils.GetLocalStorage() + localStorage := GetLocalStorage() internalPassword, err := getInternalPassword(externalPassword, localStorage) if err != nil { if errors.Is(err, os.ErrNotExist) { @@ -148,7 +148,7 @@ func getOrInit(externalPassword string) ([]byte, error) { // changeExternalPassword is the private function for ChangeExternalPassword // that is used for testing. func changeExternalPassword(oldExternalPassword, newExternalPassword string) error { - localStorage := utils.GetLocalStorage() + localStorage := GetLocalStorage() internalPassword, err := getInternalPassword(oldExternalPassword, localStorage) if err != nil { return err @@ -172,14 +172,14 @@ func changeExternalPassword(oldExternalPassword, newExternalPassword string) err // verifyPassword is the private function for VerifyPassword that is used for // testing. func verifyPassword(externalPassword string) bool { - _, err := getInternalPassword(externalPassword, utils.GetLocalStorage()) + _, err := getInternalPassword(externalPassword, GetLocalStorage()) return err == nil } // initInternalPassword generates a new internal password, stores an encrypted // version in local storage, and returns it. func initInternalPassword(externalPassword string, - localStorage *utils.LocalStorage, csprng io.Reader, + localStorage *LocalStorage, csprng io.Reader, params argonParams) ([]byte, error) { internalPassword := make([]byte, internalPasswordLen) @@ -217,7 +217,7 @@ func initInternalPassword(externalPassword string, // getInternalPassword retrieves the internal password from local storage, // decrypts it, and returns it. func getInternalPassword( - externalPassword string, localStorage *utils.LocalStorage) ([]byte, error) { + externalPassword string, localStorage *LocalStorage) ([]byte, error) { encryptedInternalPassword, err := localStorage.GetItem(passwordKey) if err != nil { return nil, errors.WithMessage(err, getPasswordStorageErr) diff --git a/creds/password_test.go b/storage/password_test.go similarity index 97% rename from creds/password_test.go rename to storage/password_test.go index ff9c71c5c3935c19d4fd4e8122978ce1c45a162d..24f1ed035197a1856c9f1750d2072609d9feb9c1 100644 --- a/creds/password_test.go +++ b/storage/password_test.go @@ -7,14 +7,13 @@ //go:build js && wasm -package creds +package storage import ( "bytes" "crypto/rand" "encoding/base64" "fmt" - "gitlab.com/elixxir/xxdk-wasm/utils" "gitlab.com/xx_network/crypto/csprng" "strings" "testing" @@ -78,7 +77,7 @@ func Test_changeExternalPassword(t *testing.T) { // Tests that verifyPassword returns true for a valid password and false for an // invalid password func Test_verifyPassword(t *testing.T) { - utils.GetLocalStorage().Clear() + GetLocalStorage().Clear() externalPassword := "myPassword" if _, err := getOrInit(externalPassword); err != nil { @@ -98,7 +97,7 @@ func Test_verifyPassword(t *testing.T) { // the encrypted one saved to local storage. func Test_initInternalPassword(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() rng := csprng.NewSystemRNG() internalPassword, err := initInternalPassword( @@ -139,7 +138,7 @@ func Test_initInternalPassword(t *testing.T) { // error when read. func Test_initInternalPassword_CsprngReadError(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() b := bytes.NewBuffer([]byte{}) expectedErr := strings.Split(readInternalPasswordErr, "%")[0] @@ -155,7 +154,7 @@ func Test_initInternalPassword_CsprngReadError(t *testing.T) { // return enough bytes. func Test_initInternalPassword_CsprngReadNumBytesError(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() b := bytes.NewBuffer(make([]byte, internalPasswordLen/2)) expectedErr := fmt.Sprintf( @@ -172,7 +171,7 @@ func Test_initInternalPassword_CsprngReadNumBytesError(t *testing.T) { // to local storage by initInternalPassword. func Test_getInternalPassword(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() rng := csprng.NewSystemRNG() internalPassword, err := initInternalPassword( @@ -197,7 +196,7 @@ func Test_getInternalPassword(t *testing.T) { // loaded from local storage. func Test_getInternalPassword_LocalStorageGetPasswordError(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() ls.Clear() expectedErr := strings.Split(getPasswordStorageErr, "%")[0] @@ -213,7 +212,7 @@ func Test_getInternalPassword_LocalStorageGetPasswordError(t *testing.T) { // loaded from local storage. func Test_getInternalPassword_LocalStorageGetError(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() ls.Clear() ls.SetItem(passwordKey, []byte("password")) @@ -230,7 +229,7 @@ func Test_getInternalPassword_LocalStorageGetError(t *testing.T) { // decrypted. func Test_getInternalPassword_DecryptPasswordError(t *testing.T) { externalPassword := "myPassword" - ls := utils.GetLocalStorage() + ls := GetLocalStorage() ls.Clear() ls.SetItem(saltKey, []byte("salt")) ls.SetItem(passwordKey, []byte("password")) diff --git a/utils/version.go b/storage/version.go similarity index 99% rename from utils/version.go rename to storage/version.go index ab26b463c72f958700840212795c6df63258d6c9..263ad6a9c4c17762d84b6229f50b5c371fea2e65 100644 --- a/utils/version.go +++ b/storage/version.go @@ -7,7 +7,7 @@ //go:build js && wasm -package utils +package storage import ( "github.com/pkg/errors" diff --git a/utils/version_test.go b/storage/version_test.go similarity index 99% rename from utils/version_test.go rename to storage/version_test.go index f54465033749f094b03a705a552e464933bb04d5..596034090ba07fd5bcf71f42b44e16e9517774c5 100644 --- a/utils/version_test.go +++ b/storage/version_test.go @@ -7,7 +7,7 @@ //go:build js && wasm -package utils +package storage import ( "testing" diff --git a/wasm/channels.go b/wasm/channels.go index 51e4b296620ef3eae8a210004964589c7bb797bd..8391e2fcbd45b61d3e27da78dc33506965041d06 100644 --- a/wasm/channels.go +++ b/wasm/channels.go @@ -36,12 +36,11 @@ func newChannelsManagerJS(api *bindings.ChannelsManager) map[string]interface{} cm := ChannelsManager{api} channelsManagerMap := map[string]interface{}{ // Basic Channel API - "GetID": js.FuncOf(cm.GetID), - "JoinChannel": js.FuncOf(cm.JoinChannel), - "JoinChannelFromURL": js.FuncOf(cm.JoinChannelFromURL), - "GetChannels": js.FuncOf(cm.GetChannels), - "LeaveChannel": js.FuncOf(cm.LeaveChannel), - "ReplayChannel": js.FuncOf(cm.ReplayChannel), + "GetID": js.FuncOf(cm.GetID), + "JoinChannel": js.FuncOf(cm.JoinChannel), + "GetChannels": js.FuncOf(cm.GetChannels), + "LeaveChannel": js.FuncOf(cm.LeaveChannel), + "ReplayChannel": js.FuncOf(cm.ReplayChannel), // Share URL "GetShareURL": js.FuncOf(cm.GetShareURL), @@ -449,13 +448,85 @@ func GenerateChannel(_ js.Value, args []js.Value) interface{} { return utils.CopyBytesToJS(gen) } +// DecodePublicURL decodes the channel URL into a channel pretty print. This +// function can only be used for public channel URLs. To get the privacy level +// of a channel URL, use [GetShareUrlType]. +// +// Parameters: +// - args[0] - The channel's share URL (string). Should be received from +// another user or generated via [GetShareURL]. +// +// Returns: +// - The channel pretty print (string). +func DecodePublicURL(_ js.Value, args []js.Value) interface{} { + c, err := bindings.DecodePublicURL(args[0].String()) + if err != nil { + utils.Throw(utils.TypeError, err) + return nil + } + + return c +} + +// DecodePrivateURL decodes the channel URL, using the password, into a channel +// pretty print. This function can only be used for private or secret channel +// URLs. To get the privacy level of a channel URL, use [GetShareUrlType]. +// +// Parameters: +// - args[0] - The channel's share URL (string). Should be received from +// another user or generated via [GetShareURL]. +// - args[1] - The password needed to decrypt the secret data in the URL +// (string). +// +// Returns: +// - The channel pretty print (string) +func DecodePrivateURL(_ js.Value, args []js.Value) interface{} { + c, err := bindings.DecodePrivateURL(args[0].String(), args[1].String()) + if err != nil { + utils.Throw(utils.TypeError, err) + return nil + } + + return c +} + +// GetChannelJSON returns the JSON of the channel for the given pretty print. +// +// Parameters: +// - args[0] - The pretty print of the channel (string). +// +// Returns: +// - JSON of the [broadcast.Channel] object (Uint8Array). +// +// Example JSON of [broadcast.Channel]: +// { +// "ReceptionID": "Ja/+Jh+1IXZYUOn+IzE3Fw/VqHOscomD0Q35p4Ai//kD", +// "Name": "My_Channel", +// "Description": "Here is information about my channel.", +// "Salt": "+tlrU/htO6rrV3UFDfpQALUiuelFZ+Cw9eZCwqRHk+g=", +// "RsaPubKeyHash": "PViT1mYkGBj6AYmE803O2RpA7BX24EjgBdldu3pIm4o=", +// "RsaPubKeyLength": 5, +// "RSASubPayloads": 1, +// "Secret": "JxZt/wPx2luoPdHY6jwbXqNlKnixVU/oa9DgypZOuyI=", +// "Level": 0 +// } +func GetChannelJSON(_ js.Value, args []js.Value) interface{} { + c, err := bindings.GetChannelJSON(args[0].String()) + if err != nil { + utils.Throw(utils.TypeError, err) + return nil + } + + return c +} + // GetChannelInfo returns the info about a channel from its public description. // // Parameters: // - args[0] - The pretty print of the channel (string). // // The pretty print will be of the format: -// <Speakeasy-v1:Test Channel,description:This is a test channel,secrets:YxHhRAKy2D4XU2oW5xnW/3yaqOeh8nO+ZSd3nUmiQ3c=,6pXN2H9FXcOj7pjJIZoq6nMi4tGX2s53fWH5ze2dU1g=,493,1,MVjkHlm0JuPxQNAn6WHsPdOw9M/BUF39p7XB/QEkQyc=> +// <Speakeasy-v2:Test_Channel|description:Channel description.|level:Public|secrets:+oHcqDbJPZaT3xD5NcdLY8OjOMtSQNKdKgLPmr7ugdU=|rCI0wr01dHFStjSFMvsBzFZClvDIrHLL5xbCOPaUOJ0=|493|1|7cBhJxVfQxWo+DypOISRpeWdQBhuQpAZtUbQHjBm8NQ=> // // Returns: // - JSON of [bindings.ChannelInfo], which describes all relevant channel info @@ -479,7 +550,7 @@ func GetChannelInfo(_ js.Value, args []js.Value) interface{} { // or generated via GenerateChannel (string). // // The pretty print will be of the format: -// <Speakeasy-v1:Test Channel,description:This is a test channel,secrets:YxHhRAKy2D4XU2oW5xnW/3yaqOeh8nO+ZSd3nUmiQ3c=,6pXN2H9FXcOj7pjJIZoq6nMi4tGX2s53fWH5ze2dU1g=,493,1,MVjkHlm0JuPxQNAn6WHsPdOw9M/BUF39p7XB/QEkQyc=> +// <Speakeasy-v2:Test_Channel|description:Channel description.|level:Public|secrets:+oHcqDbJPZaT3xD5NcdLY8OjOMtSQNKdKgLPmr7ugdU=|rCI0wr01dHFStjSFMvsBzFZClvDIrHLL5xbCOPaUOJ0=|493|1|7cBhJxVfQxWo+DypOISRpeWdQBhuQpAZtUbQHjBm8NQ=> // // Returns: // - JSON of [bindings.ChannelInfo], which describes all relevant channel info @@ -495,32 +566,6 @@ func (ch *ChannelsManager) JoinChannel(_ js.Value, args []js.Value) interface{} return utils.CopyBytesToJS(ci) } -// JoinChannelFromURL joins the given channel from a URL. It will fail if the -// channel has already been joined. A password is required unless it is of the -// privacy level [broadcast.Public], in which case it can be left empty. To get -// the privacy level of a channel URL, use [GetShareUrlType]. -// -// Parameters: -// - args[0] - The channel's share URL. Should be received from another user -// or generated via [ChannelsManager.GetShareURL] (string). -// - args[1] - The password needed to decrypt the secret data in the URL -// (string). Only required for private or secret channels. Use empty string -// ("") for public channels. -// -// Returns: -// - JSON of [bindings.ChannelInfo], which describes all relevant channel info -// (Uint8Array). -// - Throws a TypeError if joining the channel fails. -func (ch *ChannelsManager) JoinChannelFromURL(_ js.Value, args []js.Value) interface{} { - ci, err := ch.api.JoinChannelFromURL(args[0].String(), args[1].String()) - if err != nil { - utils.Throw(utils.TypeError, err) - return nil - } - - return utils.CopyBytesToJS(ci) -} - // GetChannels returns the IDs of all channels that have been joined. // // Returns: diff --git a/wasm/version.go b/wasm/version.go index 0ffab9a2814c96fad9f2c8db37fd2064de922611..27388fad345b55f90bbe511d07dbf3b4a15ee8f1 100644 --- a/wasm/version.go +++ b/wasm/version.go @@ -11,7 +11,7 @@ package wasm import ( "gitlab.com/elixxir/client/bindings" - "gitlab.com/elixxir/xxdk-wasm/utils" + "gitlab.com/elixxir/xxdk-wasm/storage" "syscall/js" ) @@ -20,7 +20,7 @@ import ( // Returns: // - Current version (string). func GetVersion(js.Value, []js.Value) interface{} { - return utils.SEMVER + return storage.SEMVER } // GetClientVersion returns the current client xxDK semantic version