Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Decentralized Identifiers (DIDs) #498

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
12f9103
did: add data models and pubkey did
sanderpick Feb 20, 2021
282c004
did: add id tests
sanderpick Feb 20, 2021
f50b585
did: add identity tests
sanderpick Feb 20, 2021
df59cbf
did: add identity token validation
sanderpick Feb 21, 2021
0ba5a84
did: stub in pubsub registry
sanderpick Feb 21, 2021
1777bef
did: more wip on registry
sanderpick Feb 24, 2021
b8c4957
did: more wip on registry
sanderpick Feb 24, 2021
c0e74b0
did: functional roundtrip did requests
sanderpick Feb 25, 2021
64803b8
did: couple more basic tests
sanderpick Feb 25, 2021
2135d51
did: get daemon building
sanderpick Feb 28, 2021
1d8e9a2
did: replace token usage with did identity
sanderpick Mar 2, 2021
d4762c5
identity: add stringer and unmarshalstring
sanderpick Mar 6, 2021
a79cbde
net: updates for validate identity
sanderpick Mar 6, 2021
9c98c24
db: validate identities
sanderpick Mar 7, 2021
76f020b
net: expose resolve api
sanderpick Mar 9, 2021
713ba6a
chores: update proto handling w/ buf, update docker images
sanderpick Mar 10, 2021
cf51480
mod: tidy
sanderpick Mar 10, 2021
05fa08b
tools: remove bin files
sanderpick Mar 10, 2021
f869683
docker: move files to cmd
sanderpick Mar 10, 2021
ed21d82
docker: more cleanup
sanderpick Mar 10, 2021
b3c756e
docker: bingo fix
sanderpick Mar 10, 2021
7b4c069
util: switch token creation to ulid
sanderpick Mar 16, 2021
091b67e
chore: fix import cycle
sanderpick Mar 16, 2021
b2f5495
gateway: adds gateway
sanderpick Mar 17, 2021
d81391e
gateway: cleanups
sanderpick Mar 17, 2021
f1bbdd7
gateway: fixes
sanderpick Mar 19, 2021
8ba49f4
chore: mod tidy
sanderpick Mar 19, 2021
50cccc0
util: use sync.MutexWrap with the in-mem TxnMapDatastore
sanderpick Mar 23, 2021
a39696d
store: migrate to badger3
sanderpick Mar 24, 2021
d3bc1fe
manager: cleanup tests
sanderpick Mar 25, 2021
73e0ec0
identity: expose validate method
sanderpick Mar 28, 2021
3dfbcd3
nit: fix doc string
sanderpick Mar 29, 2021
c8e828a
badger: v3
sanderpick Mar 30, 2021
76f6cd6
mod: tidy
sanderpick Mar 30, 2021
3a1b7e4
util: fiz finalizer
sanderpick Mar 31, 2021
43a1673
net: adds identity validation
sanderpick Apr 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .bingo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Ignore everything
*

# But not these files:
!.gitignore
!*.mod
!README.md
!Variables.mk
!variables.env

*tmp.mod
14 changes: 14 additions & 0 deletions .bingo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Project Development Dependencies.

This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo.

* Run `bingo get` to install all tools having each own module file in this directory.
* Run `bingo get <tool>` to install <tool> that have own module file in this directory.
* For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
* For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
* For go: Import `.bingo/variables.go` to for variable names.
* See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.

## Requirements

* Go 1.14+
54 changes: 54 additions & 0 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)

# Bellow generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for buf variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(BUF)
# @echo "Running buf"
# @$(BUF) <flags/args..>
#
BUF := $(GOBIN)/buf-v0.20.5
$(BUF): .bingo/buf.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/buf-v0.20.5"
@cd .bingo && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.20.5 "github.com/bufbuild/buf/cmd/buf"

GOMPLATE := $(GOBIN)/gomplate-v3.8.0
$(GOMPLATE): .bingo/gomplate.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/gomplate-v3.8.0"
@cd .bingo && $(GO) build -mod=mod -modfile=gomplate.mod -o=$(GOBIN)/gomplate-v3.8.0 "github.com/hairyhenderson/gomplate/v3/cmd/gomplate"

GOVVV := $(GOBIN)/govvv-v0.3.0
$(GOVVV): .bingo/govvv.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/govvv-v0.3.0"
@cd .bingo && $(GO) build -mod=mod -modfile=govvv.mod -o=$(GOBIN)/govvv-v0.3.0 "github.com/ahmetb/govvv"

GOX := $(GOBIN)/gox-v1.0.1
$(GOX): .bingo/gox.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/gox-v1.0.1"
@cd .bingo && $(GO) build -mod=mod -modfile=gox.mod -o=$(GOBIN)/gox-v1.0.1 "github.com/mitchellh/gox"

PROTOC_GEN_BUF_CHECK_BREAKING := $(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5
$(PROTOC_GEN_BUF_CHECK_BREAKING): .bingo/protoc-gen-buf-check-breaking.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5"
@cd .bingo && $(GO) build -mod=mod -modfile=protoc-gen-buf-check-breaking.mod -o=$(GOBIN)/protoc-gen-buf-check-breaking-v0.20.5 "github.com/bufbuild/buf/cmd/protoc-gen-buf-check-breaking"

PROTOC_GEN_BUF_CHECK_LINT := $(GOBIN)/protoc-gen-buf-check-lint-v0.20.5
$(PROTOC_GEN_BUF_CHECK_LINT): .bingo/protoc-gen-buf-check-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-buf-check-lint-v0.20.5"
@cd .bingo && $(GO) build -mod=mod -modfile=protoc-gen-buf-check-lint.mod -o=$(GOBIN)/protoc-gen-buf-check-lint-v0.20.5 "github.com/bufbuild/buf/cmd/protoc-gen-buf-check-lint"

5 changes: 5 additions & 0 deletions .bingo/buf.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/bufbuild/buf v0.20.5 // cmd/buf
3 changes: 3 additions & 0 deletions .bingo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.

go 1.14
5 changes: 5 additions & 0 deletions .bingo/gomplate.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/hairyhenderson/gomplate/v3 v3.8.0 // cmd/gomplate
5 changes: 5 additions & 0 deletions .bingo/govvv.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/ahmetb/govvv v0.3.0
5 changes: 5 additions & 0 deletions .bingo/gox.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/mitchellh/gox v1.0.1
5 changes: 5 additions & 0 deletions .bingo/protoc-gen-buf-check-breaking.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/bufbuild/buf v0.20.5 // cmd/protoc-gen-buf-check-breaking
5 changes: 5 additions & 0 deletions .bingo/protoc-gen-buf-check-lint.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.14

require github.com/bufbuild/buf v0.20.5 // cmd/protoc-gen-buf-check-lint
22 changes: 22 additions & 0 deletions .bingo/variables.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
local gobin=$(go env GOBIN)

if [ -z "$gobin" ]; then
gobin="$(go env GOPATH)/bin"
fi


BUF="${gobin}/buf-v0.20.5"

GOMPLATE="${gobin}/gomplate-v3.8.0"

GOVVV="${gobin}/govvv-v0.3.0"

GOX="${gobin}/gox-v1.0.1"

PROTOC_GEN_BUF_CHECK_BREAKING="${gobin}/protoc-gen-buf-check-breaking-v0.20.5"

PROTOC_GEN_BUF_CHECK_LINT="${gobin}/protoc-gen-buf-check-lint-v0.20.5"

6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

6 changes: 0 additions & 6 deletions .github/weekly-digest.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
buf:
name: Buf
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
with:
ref: master
- name: checkout-master
run: git checkout master
- name: checkout
uses: actions/checkout@v1
- name: make local
run: make buf-local
threadsd:
name: Threads Daemon
runs-on: ubuntu-latest
steps:
- name: setup
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: checkout
uses: actions/checkout@v1
- name: build
run: make build-threadsd
90 changes: 0 additions & 90 deletions .github/workflows/publish-grpc-libs.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/publish-js-libs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish JS Libs
on:
release:
types: [published]
jobs:
publish-js-libs:
name: Publish JS libs
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Setup env
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"
- name: Generate JS libs
run: |
make js-protos
- name: Publish JS libs
run: |
./scripts/publish_js_protos.bash -v ${{ github.event.release.tag_name }} -t ${{ secrets.NPM_AUTH_TOKEN }} -p ${{ github.event.release.prerelease }}
40 changes: 6 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15
go-version: 1.16
- name: Check out code
uses: actions/checkout@v1
- name: Cache dependencies
Expand All @@ -26,40 +26,12 @@ jobs:
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go get -v -t -d ./...
- name: Install gox
- name: Build release artifacts
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go get github.com/mitchellh/gox
- name: Compile
run: |
export PATH=${PATH}:`go env GOPATH`/bin
gox -osarch="linux/amd64 linux/386 linux/arm darwin/amd64 windows/amd64" -output="threadsd-{{.OS}}-{{.Arch}}" ./threadsd
- name: Collect artifacts
run: |
VERSION=${GITHUB_REF##*/}
OUT=release
mkdir -p ${OUT}
rm threadsd/main.go
cp LICENSE threadsd/
cp dist/README.md threadsd/
cp dist/install threadsd/
declare -a arr=("darwin-amd64" "windows-amd64.exe" "linux-amd64" "linux-386" "linux-arm")
for i in "${arr[@]}"
do
OSARCH=${i%.*}
EXT=$([[ "$i" = *.* ]] && echo ".${i##*.}" || echo '')
cp threadsd-${i} threadsd/threadsd${EXT}
if [ "${EXT}" == ".exe" ]; then
zip -r threadsd_${VERSION}_${OSARCH}.zip threadsd
mv threadsd_${VERSION}_${OSARCH}.zip ${OUT}/
else
tar -czvf threadsd_${VERSION}_${OSARCH}.tar.gz threadsd
mv threadsd_${VERSION}_${OSARCH}.tar.gz ${OUT}/
fi
done
echo $(ls ./release)
- name: Upload assets to release
BIN_VERSION=${{ github.event.release.tag_name }} make build-releases
echo $(ls ./build/dist/)
- name: Upload multiple assets to release
uses: AButler/[email protected]
with:
files: 'release/threadsd_*'
files: "build/dist/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}
Loading