diff --git a/.bazelrc b/.bazelrc deleted file mode 100644 index 1ece1e3..0000000 --- a/.bazelrc +++ /dev/null @@ -1,10 +0,0 @@ -# Show us information about failures. -build --verbose_failures -test --test_output=errors - -# Make /tmp hermetic -build --sandbox_tmpfs_path=/tmp - -# Enable go race detection. -build:unit --features=race -test:unit --features=race diff --git a/.bazelrc-travis b/.bazelrc-travis deleted file mode 100644 index 7c9c09a..0000000 --- a/.bazelrc-travis +++ /dev/null @@ -1,4 +0,0 @@ -# Some Travis specific tuning -startup --host_jvm_args=-Xmx2500m -startup --host_jvm_args=-Xms2500m -test --ram_utilization_factor=10 diff --git a/.bazelrc-travis-cache b/.bazelrc-travis-cache deleted file mode 100644 index 8cb9910..0000000 --- a/.bazelrc-travis-cache +++ /dev/null @@ -1,8 +0,0 @@ -# Some Travis specific tuning -startup --host_jvm_args=-Xmx2500m -startup --host_jvm_args=-Xms2500m -test --ram_utilization_factor=10 - -# Remote cache -build --remote_http_cache=https://storage.googleapis.com/trisa-bazel-cache/travis --google_credentials=/workspace/.remote-cache-sa.json --experimental_guard_against_concurrent_changes -test --remote_http_cache=https://storage.googleapis.com/trisa-bazel-cache/travis --google_credentials=/workspace/.remote-cache-sa.json --experimental_guard_against_concurrent_changes diff --git a/.bazelversion b/.bazelversion deleted file mode 100644 index e3a4f19..0000000 --- a/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -2.2.0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index a6a7e4d..cc68996 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,25 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Environment configuration +.env +tmp/ + +# Code droppings .vscode/ -.bazel/ + +# OS Droppings .DS_Store -bazel-workspace -out -/bazel-bin -/bazel-genfiles -/bazel-out -/bazel-testlogs -/bazel-trisa -/artifacts -/docs/public -server.crt -server.key -trust.chain -.remote-cache-sa.json -.idea/ -*.code-workspace -!docs/static/** \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 76c1b78..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "docs/themes/hugo-theme-techdoc"] - path = docs/themes/hugo-theme-techdoc - url = https://github.com/thingsym/hugo-theme-techdoc.git diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 13c576d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,59 +0,0 @@ -services: - - docker - -language: go - -git: - submodules: true - quiet: true - -addons: - # Required for demo testing - hosts: - - vasp1 - - vasp2 - - vasp3 - -jobs: - include: - - stage: Pre-build - if: fork = false # We can only use encrypted ENV vars from trusted source (non-forks) - name: Bake dockerized tooling - script: - - echo "$DOCKER_ACCESS_TOKEN" | docker login --username "$DOCKER_USERNAME" --password-stdin - - hack/exec/travis-tooling-bootstrap.sh - - stage: Build - name: Documentation generation - script: - - hack/exec/docs-generate.sh - deploy: - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN_DOCS - local_dir: docs/public - repo: trisacrypto/trisacrypto.github.io - target_branch: master - keep_history: false - committer_from_gh: true - on: - branch: master - - name: Build and testing - script: - - hack/exec/travis-build-bootstrap.sh - - name: Build and publish PR image - if: fork = false AND type = pull_request - script: - - echo "$DOCKER_ACCESS_TOKEN" | docker login --username "$DOCKER_USERNAME" --password-stdin - - hack/exec/travis-publish-bootstrap.sh - - name: Build and publish latest image - if: fork = false AND type = push AND branch = master - script: - - echo "$DOCKER_ACCESS_TOKEN" | docker login --username "$DOCKER_USERNAME" --password-stdin - - hack/exec/travis-publish-bootstrap.sh - -notifications: - email: false - -branches: - only: - - master diff --git a/BUILD.bazel b/BUILD.bazel deleted file mode 100644 index cc5db48..0000000 --- a/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -load("@bazel_gazelle//:def.bzl", "gazelle") - -# gazelle:prefix github.com/trisacrypto/trisa -# gazelle:build_file_name BUILD.bazel -# gazelle:proto disable -gazelle(name = "gazelle") diff --git a/LICENSE b/LICENSE index bfc92fa..a2ed45d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2019 CipherTrace, Inc. https://ciphertrace.com +Copyright (c) 2021 TRISA https://trisa.io Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Makefile b/Makefile deleted file mode 100644 index d6b3384..0000000 --- a/Makefile +++ /dev/null @@ -1,146 +0,0 @@ -.PHONY: all -all: build test build-docker - -# Build TRISA server. -.PHONY: build -build: - hack/exec/build.sh - -# Build docker container for TRISA server. The resulting images will be pushed -# to the local docker instance as "bazel/cmd/trisa:docker". -.PHONY: build-docker -build-docker: - hack/exec/build-docker.sh - -# Bake dokerized tooling. -.PHONY: bake-tooling -bake-tooling: - hack/exec/bake-tooling.sh - -# Pull dokerized tooling. -.PHONY: pull-tooling -pull-tooling: - hack/exec/pull-tooling.sh - -# Run test suites. -.PHONY: test -test: - hack/exec/test.sh - -# Update/rebuild BUILD.bazel files for Go dependency management. -.PHONY: gazelle -gazelle: - hack/exec/gazelle.sh - -# Run 'go mod' to update vendor. Implicitly runs the gazelle target as well. -.PHONY: dependencies -dependencies: - hack/exec/dependencies.sh - -# Start local documentation service, see https://trisacrypto.github.io/contributing/documentation/. -.PHONY: docs-dev -docs-dev: - hack/exec/docs-dev.sh - -# Generate documentation website, usually run from CI only. -.PHONY: docs-generate -docs-generate: - hack/exec/docs-generate.sh - -# Initialize the PKI environment for local development. This create a new root CA, -# two subordinate CA's and 3 VASP certificates. -.PHONY: pki-dev-init -pki-dev-init: - hack/exec/pki-dev-init.sh - ls -l hack/etc/pki/dev/out - -# Execute TRISA server in docker container. Requires the "build-docker" target to -# be execute first to produce the docker image. -.PHONY: docker-run -docker-run: - docker run -it --rm bazel/cmd/trisa:docker - -# Publish docker release as trisacrypto/trisa:latest. -.PHONY: docker-release -docker-release: - skaffold build -p latest - -# Initialize the demo environment. This requires "pki-dev-init" to be executed as -# it relies on the PKI setup to generate the demo system. -.PHONY: demo-init -demo-init: - hack/exec/demo-init.sh - -# Run the 3 demo VAPs locally. -.PHONY: demo-run -demo-run: - hack/exec/demo-run.sh - -# Rebuild TRISA server and restart the running demo VASPs. -.PHONY: demo-rebuild -demo-rebuild: - hack/exec/demo-rebuild.sh - -# Stop all running (demo) TRISA server processes. -.PHONY: demo-stop -demo-stop: - hack/exec/demo-stop.sh - -# Demo using docker and docker-compose only. This does not require setting up any -# build system and solely relies the dockerized tooling and published trisa image. -# -# This target should not be used for development as it will blow away the PKI dev -# setup, regenerate the configs and will not rely on any locally made code changes. -# -# Once the VASP containers are up and running, message exchanges can be triggered -# by hitting the admin port on each VASP server. The admin ports for each VASP are -# follows: -# -# vasp1 --> 8591 -# vasp2 --> 8592 -# vasp3 --> 8593 -# -# The TRISA mesh ports are as follows: -# -# vasp1 --> 8091 -# vasp2 --> 8092 -# vasp3 --> 8093 -# -# To trigger a transaction exchange from VASP1 to VASP2: -# curl -ks "https://127.0.0.1:8591/send?target=vasp3:8093" > /dev/null -# -# Replace the ?target parameter with any of the following: -# -# vasp1:8591 -# vasp2:8592 -# vasp3:8593 -# -.PHONY: demo-docker -demo-docker: - hack/exec/demo-docker.sh - -# Cleanup running VASP containers. -.PHONY: demo-docker-cleanup -demo-docker-cleanup: - hack/exec/demo-docker-cleanup.sh - -# Start local k8s cluster. To make use of (local) Kubernetes deployments the following -# binaries are required to be available: kubectl, skaffold and kind. -.PHONY: k8s-cluster-start -k8s-cluster-start: - hack/exec/k8s-cluster-start.sh - -# Destroy local k8s cluster. -.PHONY: k8s-cluster-destroy -k8s-cluster-destroy: - hack/exec/k8s-cluster-destroy.sh - -# Startup the VASPs in k8s. -.PHONY: k8s-vasps-run -k8s-vasps-run: - hack/exec/k8s-vasps-run.sh - -# Stop the VASPs in k8s. -.PHONY: k8s-vasps-delete -k8s-vasps-delete: - hack/exec/k8s-vasps-delete.sh \ No newline at end of file diff --git a/README.md b/README.md index 43edf14..b40dbc4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# Travel Rule Information Sharing Architecture for Virtual Asset Service Providers (TRISA) +# Travel Rule Information Sharing Architecture (TRISA) for Virtual Asset Service Providers -[![Build Status](https://travis-ci.com/trisacrypto/trisa.svg?branch=master)](https://travis-ci.com/trisacrypto/trisa) - -Please visit [TRISA documentation](https://trisacrypto.github.io/) for more information. +Please visit the [TRISA website](https://trisa.io) for more information and the [TRISA documentation](https://trisatest.net) for developer docs and integration. diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index 05db125..0000000 --- a/WORKSPACE +++ /dev/null @@ -1,483 +0,0 @@ -workspace(name = "com_trisacrypto_trisa") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -http_archive( - name = "bazel_skylib", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -load("@bazel_skylib//lib:versions.bzl", "versions") - -versions.check(minimum_bazel_version = "2.0.0") - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") - -git_repository( - name = "com_google_protobuf", - commit = "d0bfd5221182da1a7cc280f3337b5e41a89539cf", # v3.11.4 - remote = "https://github.com/protocolbuffers/protobuf", - shallow_since = "1581711200 -0800", -) - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") - -protobuf_deps() - -http_archive( - name = "io_bazel_rules_go", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.22.1/rules_go-v0.22.1.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.22.1/rules_go-v0.22.1.tar.gz", - ], - sha256 = "e6a6c016b0663e06fa5fccf1cd8152eab8aa8180c583ec20c872f4f9953a7ac5", -) - -http_archive( - name = "bazel_gazelle", - urls = [ - "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz", - ], - sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10", -) - -load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") - -go_rules_dependencies() - -go_register_toolchains( - go_version = "1.13.8", -) - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") - -gazelle_dependencies() - -http_archive( - name = "io_bazel_rules_docker", - sha256 = "dc97fccceacd4c6be14e800b2a00693d5e8d07f69ee187babfd04a80a9f8e250", - strip_prefix = "rules_docker-0.14.1", - urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.1/rules_docker-v0.14.1.tar.gz"], -) - -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) - -container_repositories() - -load( - "@io_bazel_rules_docker//go:image.bzl", - _go_image_repos = "repositories", -) - -_go_image_repos() - -go_repository( - name = "co_honnef_go_tools", - importpath = "honnef.co/go/tools", - sum = "h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=", - version = "v0.0.0-20190523083050-ea95bdfd59fc", -) - -go_repository( - name = "com_github_armon_consul_api", - importpath = "github.com/armon/consul-api", - sum = "h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA=", - version = "v0.0.0-20180202201655-eb2c6b5be1b6", -) - -go_repository( - name = "com_github_burntsushi_toml", - importpath = "github.com/BurntSushi/toml", - sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=", - version = "v0.3.1", -) - -go_repository( - name = "com_github_client9_misspell", - importpath = "github.com/client9/misspell", - sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", - version = "v0.3.4", -) - -go_repository( - name = "com_github_coreos_etcd", - importpath = "github.com/coreos/etcd", - sum = "h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=", - version = "v3.3.10+incompatible", -) - -go_repository( - name = "com_github_coreos_go_etcd", - importpath = "github.com/coreos/go-etcd", - sum = "h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=", - version = "v2.0.0+incompatible", -) - -go_repository( - name = "com_github_coreos_go_semver", - importpath = "github.com/coreos/go-semver", - sum = "h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_cpuguy83_go_md2man", - importpath = "github.com/cpuguy83/go-md2man", - sum = "h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=", - version = "v1.0.10", -) - -go_repository( - name = "com_github_davecgh_go_spew", - importpath = "github.com/davecgh/go-spew", - sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_fsnotify_fsnotify", - importpath = "github.com/fsnotify/fsnotify", - sum = "h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=", - version = "v1.4.7", -) - -go_repository( - name = "com_github_golang_glog", - importpath = "github.com/golang/glog", - sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=", - version = "v0.0.0-20160126235308-23def4e6c14b", -) - -go_repository( - name = "com_github_golang_mock", - importpath = "github.com/golang/mock", - sum = "h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_golang_protobuf", - importpath = "github.com/golang/protobuf", - sum = "h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=", - version = "v1.3.3", -) - -go_repository( - name = "com_github_google_go_cmp", - importpath = "github.com/google/go-cmp", - sum = "h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=", - version = "v0.2.0", -) - -go_repository( - name = "com_github_google_uuid", - importpath = "github.com/google/uuid", - sum = "h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=", - version = "v1.1.1", -) - -go_repository( - name = "com_github_gorilla_mux", - importpath = "github.com/gorilla/mux", - sum = "h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=", - version = "v1.7.3", -) - -go_repository( - name = "com_github_hashicorp_hcl", - importpath = "github.com/hashicorp/hcl", - sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_inconshreveable_mousetrap", - importpath = "github.com/inconshreveable/mousetrap", - sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_jinzhu_copier", - importpath = "github.com/jinzhu/copier", - sum = "h1:mGIXW/lubQ4B+3bXTLxcTMTjUNDqoF6T/HUW9LbFx9s=", - version = "v0.0.0-20190625015134-976e0346caa8", -) - -go_repository( - name = "com_github_konsorten_go_windows_terminal_sequences", - importpath = "github.com/konsorten/go-windows-terminal-sequences", - sum = "h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=", - version = "v1.0.1", -) - -go_repository( - name = "com_github_magiconair_properties", - importpath = "github.com/magiconair/properties", - sum = "h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=", - version = "v1.8.0", -) - -go_repository( - name = "com_github_mitchellh_go_homedir", - importpath = "github.com/mitchellh/go-homedir", - sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", - version = "v1.1.0", -) - -go_repository( - name = "com_github_mitchellh_mapstructure", - importpath = "github.com/mitchellh/mapstructure", - sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=", - version = "v1.1.2", -) - -go_repository( - name = "com_github_pelletier_go_toml", - importpath = "github.com/pelletier/go-toml", - sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", - version = "v1.2.0", -) - -go_repository( - name = "com_github_pmezard_go_difflib", - importpath = "github.com/pmezard/go-difflib", - sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_russross_blackfriday", - importpath = "github.com/russross/blackfriday", - sum = "h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=", - version = "v1.5.2", -) - -go_repository( - name = "com_github_sirupsen_logrus", - importpath = "github.com/sirupsen/logrus", - sum = "h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=", - version = "v1.4.2", -) - -go_repository( - name = "com_github_spf13_afero", - importpath = "github.com/spf13/afero", - sum = "h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=", - version = "v1.1.2", -) - -go_repository( - name = "com_github_spf13_cast", - importpath = "github.com/spf13/cast", - sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", - version = "v1.3.0", -) - -go_repository( - name = "com_github_spf13_cobra", - importpath = "github.com/spf13/cobra", - sum = "h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=", - version = "v0.0.5", -) - -go_repository( - name = "com_github_spf13_jwalterweatherman", - importpath = "github.com/spf13/jwalterweatherman", - sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", - version = "v1.0.0", -) - -go_repository( - name = "com_github_spf13_pflag", - importpath = "github.com/spf13/pflag", - sum = "h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=", - version = "v1.0.3", -) - -go_repository( - name = "com_github_spf13_viper", - importpath = "github.com/spf13/viper", - sum = "h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M=", - version = "v1.3.2", -) - -go_repository( - name = "com_github_stretchr_objx", - importpath = "github.com/stretchr/objx", - sum = "h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=", - version = "v0.1.1", -) - -go_repository( - name = "com_github_stretchr_testify", - importpath = "github.com/stretchr/testify", - sum = "h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=", - version = "v1.2.2", -) - -go_repository( - name = "com_github_ugorji_go_codec", - importpath = "github.com/ugorji/go/codec", - sum = "h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648=", - version = "v0.0.0-20181204163529-d75b2dcb6bc8", -) - -go_repository( - name = "com_github_xordataexchange_crypt", - importpath = "github.com/xordataexchange/crypt", - sum = "h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=", - version = "v0.0.3-0.20170626215501-b2862e3d0a77", -) - -go_repository( - name = "com_google_cloud_go", - importpath = "cloud.google.com/go", - sum = "h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=", - version = "v0.26.0", -) - -go_repository( - name = "in_gopkg_check_v1", - importpath = "gopkg.in/check.v1", - sum = "h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=", - version = "v0.0.0-20161208181325-20d25e280405", -) - -go_repository( - name = "in_gopkg_yaml_v2", - importpath = "gopkg.in/yaml.v2", - sum = "h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=", - version = "v2.2.2", -) - -go_repository( - name = "org_golang_google_appengine", - importpath = "google.golang.org/appengine", - sum = "h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=", - version = "v1.4.0", -) - -go_repository( - name = "org_golang_google_genproto", - importpath = "google.golang.org/genproto", - sum = "h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=", - version = "v0.0.0-20190819201941-24fa4b261c55", -) - -go_repository( - name = "org_golang_x_crypto", - importpath = "golang.org/x/crypto", - sum = "h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=", - version = "v0.0.0-20190308221718-c2843e01d9a2", -) - -go_repository( - name = "org_golang_x_lint", - importpath = "golang.org/x/lint", - sum = "h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=", - version = "v0.0.0-20190313153728-d0100b6bd8b3", -) - -go_repository( - name = "org_golang_x_oauth2", - importpath = "golang.org/x/oauth2", - sum = "h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=", - version = "v0.0.0-20180821212333-d2e6202438be", -) - -go_repository( - name = "org_golang_x_sync", - importpath = "golang.org/x/sync", - sum = "h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=", - version = "v0.0.0-20190423024810-112230192c58", -) - -go_repository( - name = "org_golang_x_tools", - importpath = "golang.org/x/tools", - sum = "h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=", - version = "v0.0.0-20190524140312-2c0ae7006135", -) - -go_repository( - name = "org_golang_google_grpc", - importpath = "google.golang.org/grpc", - sum = "h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4=", - version = "v1.28.0", -) - -go_repository( - name = "org_golang_x_net", - importpath = "golang.org/x/net", - sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=", - version = "v0.0.0-20190311183353-d8887717615a", -) - -go_repository( - name = "org_golang_x_sys", - importpath = "golang.org/x/sys", - sum = "h1:LCxigP8q3fPRGNVYndYsyHnF0zRrvcoVwZMfb8iQZe4=", - version = "v0.0.0-20190825160603-fb81701db80f", -) - -go_repository( - name = "org_golang_x_text", - importpath = "golang.org/x/text", - sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=", - version = "v0.3.0", -) - -go_repository( - name = "com_github_census_instrumentation_opencensus_proto", - importpath = "github.com/census-instrumentation/opencensus-proto", - sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=", - version = "v0.2.1", -) - -go_repository( - name = "com_github_cncf_udpa_go", - importpath = "github.com/cncf/udpa/go", - sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=", - version = "v0.0.0-20191209042840-269d4d468f6f", -) - -go_repository( - name = "com_github_envoyproxy_go_control_plane", - importpath = "github.com/envoyproxy/go-control-plane", - sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=", - version = "v0.9.4", -) - -go_repository( - name = "com_github_envoyproxy_protoc_gen_validate", - importpath = "github.com/envoyproxy/protoc-gen-validate", - sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=", - version = "v0.1.0", -) - -go_repository( - name = "com_github_prometheus_client_model", - importpath = "github.com/prometheus/client_model", - sum = "h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=", - version = "v0.0.0-20190812154241-14fe0d1b01d4", -) - -go_repository( - name = "org_golang_x_exp", - importpath = "golang.org/x/exp", - sum = "h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA=", - version = "v0.0.0-20190121172915-509febef88a4", -) diff --git a/cmd/trisa/BUILD.bazel b/cmd/trisa/BUILD.bazel deleted file mode 100644 index 85d0545..0000000 --- a/cmd/trisa/BUILD.bazel +++ /dev/null @@ -1,28 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") -load("@io_bazel_rules_docker//go:image.bzl", "go_image") - -go_library( - name = "go_default_library", - srcs = ["trisa.go"], - importpath = "github.com/trisacrypto/trisa/cmd/trisa", - visibility = ["//visibility:private"], - deps = [ - "//cmd/trisa/app:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - ], -) - -go_image( - name = "docker", - embed = [":go_default_library"], - goarch = "amd64", - goos = "linux", - pure = "on", - visibility = ["//visibility:public"], -) - -go_binary( - name = "trisa", - embed = [":go_default_library"], - visibility = ["//visibility:public"], -) diff --git a/cmd/trisa/app/BUILD.bazel b/cmd/trisa/app/BUILD.bazel deleted file mode 100644 index 192f76c..0000000 --- a/cmd/trisa/app/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["trisa.go"], - importpath = "github.com/trisacrypto/trisa/cmd/trisa/app", - visibility = ["//visibility:public"], - deps = ["//cmd/trisa/app/cmd:go_default_library"], -) diff --git a/cmd/trisa/app/cmd/BUILD.bazel b/cmd/trisa/app/cmd/BUILD.bazel deleted file mode 100644 index f465a05..0000000 --- a/cmd/trisa/app/cmd/BUILD.bazel +++ /dev/null @@ -1,32 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "config.go", - "root.go", - "server.go", - ], - importpath = "github.com/trisacrypto/trisa/cmd/trisa/app/cmd", - visibility = ["//visibility:public"], - deps = [ - "//pkg/ca:go_default_library", - "//pkg/trisa/config:go_default_library", - "//pkg/trisa/handler:go_default_library", - "//pkg/trisa/server:go_default_library", - "//pkg/trisa/trust:go_default_library", - "//proto/ivms101:go_default_library", - "//proto/trisa/data/bitcoin/v1alpha1:go_default_library", - "//proto/trisa/identity/us/v1alpha1:go_default_library", - "//proto/trisa/protocol/v1alpha1:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - "@com_github_golang_protobuf//ptypes:go_default_library_gen", - "@com_github_google_uuid//:go_default_library", - "@com_github_gorilla_mux//:go_default_library", - "@com_github_jinzhu_copier//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", - "@com_github_spf13_cobra//:go_default_library", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - ], -) diff --git a/cmd/trisa/app/cmd/config.go b/cmd/trisa/app/cmd/config.go deleted file mode 100644 index 51ab1c1..0000000 --- a/cmd/trisa/app/cmd/config.go +++ /dev/null @@ -1,94 +0,0 @@ -package cmd - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "github.com/spf13/cobra" - "github.com/trisacrypto/trisa/pkg/ca" - "github.com/trisacrypto/trisa/pkg/trisa/config" -) - -var ( - csrPath = "/etc/trisa" - keyFile = "server.key" - crtFile = "server.crt" - trustFile = "trust.chain" - - listenAddr string - listenAddrAdmin string -) - -func NewConfigCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "config", - Short: "Config management", - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - stat, err := os.Stat(csrPath) - if err != nil { - return err - } - if !stat.IsDir() { - return fmt.Errorf("%s is not a directory", csrPath) - } - return nil - }, - } - - cmd.AddCommand( - NewConfigGenerateCmd(), - ) - - cmd.PersistentFlags().StringVar(&csrPath, "path", csrPath, "Path where private key and CSR is created") - - return cmd -} - -func NewConfigGenerateCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "generate", - Short: "Generate configuration", - RunE: runConfigGenerateCmd, - } - - cmd.Flags().StringVar(&listenAddr, "listen", listenAddr, "Listen address") - cmd.Flags().StringVar(&listenAddrAdmin, "listen-admin", listenAddrAdmin, "Listen address admin") - - return cmd -} - -func runConfigGenerateCmd(cmd *cobra.Command, args []string) error { - - // Decode certificate so we can deduct the hostname from CN. - crtPEM, err := ioutil.ReadFile(filepath.Join(csrPath, crtFile)) - if err != nil { - return err - } - - crt, err := ca.PEMDecodeCertificate(crtPEM) - if err != nil { - return err - } - - c := &config.Config{ - TLS: &config.TLS{ - CertificateFile: crtFile, - PrivateKeyFile: keyFile, - TrustChainFile: trustFile, - }, - Server: &config.Server{ - ListenAddress: listenAddr, - ListenAddressAdmin: listenAddrAdmin, - Hostname: crt.Subject.CommonName, - }, - } - - if err := c.Save(configFile); err != nil { - return err - } - - fmt.Printf("config stored in %s\n", configFile) - return nil -} diff --git a/cmd/trisa/app/cmd/root.go b/cmd/trisa/app/cmd/root.go deleted file mode 100644 index b06033d..0000000 --- a/cmd/trisa/app/cmd/root.go +++ /dev/null @@ -1,27 +0,0 @@ -package cmd - -import ( - "io" - - "github.com/spf13/cobra" -) - -var ( - configFile string -) - -func NewTRISACommand(out, err io.Writer) *cobra.Command { - root := &cobra.Command{ - Use: "trisa", - Long: "VASP Travel Rule Information Sharing Architecture", - } - - root.PersistentFlags().StringVarP(&configFile, "config", "c", "/etc/trisa/config.yaml", "Configuration file") - - root.AddCommand( - NewServerCmd(), - NewConfigCmd(), - ) - - return root -} diff --git a/cmd/trisa/app/cmd/server.go b/cmd/trisa/app/cmd/server.go deleted file mode 100644 index 549c2d8..0000000 --- a/cmd/trisa/app/cmd/server.go +++ /dev/null @@ -1,444 +0,0 @@ -package cmd - -import ( - "context" - "crypto/tls" - "crypto/x509" - "encoding/json" - "fmt" - "io/ioutil" - "net" - "net/http" - "net/url" - "time" - - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/proto" - "github.com/google/uuid" - "github.com/gorilla/mux" - "github.com/jinzhu/copier" - log "github.com/sirupsen/logrus" - "github.com/spf13/cobra" - "github.com/trisacrypto/trisa/pkg/trisa/config" - "github.com/trisacrypto/trisa/pkg/trisa/handler" - "github.com/trisacrypto/trisa/pkg/trisa/server" - "github.com/trisacrypto/trisa/pkg/trisa/trust" - bitcoin "github.com/trisacrypto/trisa/proto/trisa/data/bitcoin/v1alpha1" - us "github.com/trisacrypto/trisa/proto/trisa/identity/us/v1alpha1" - pb "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1" - ivms101 "github.com/trisacrypto/trisa/proto/ivms101" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" -) - -func NewServerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "server", - Short: "Start VASP TRISA server", - Run: runServerCmd, - } - - return cmd -} - -func runServerCmd(cmd *cobra.Command, args []string) { - - c, err := config.FromFile(configFile) - if err != nil { - log.Fatalf("load config: %v", err) - } - - chain, err := ioutil.ReadFile(c.TLS.TrustChainFile) - if err != nil { - log.Fatalf("load trust chain: %v", err) - } - tp := trust.NewProvider(chain) - - crt, err := tls.LoadX509KeyPair(c.TLS.CertificateFile, c.TLS.PrivateKeyFile) - if err != nil { - log.Fatalf("load x509 key pair: %v", err) - } - - baseTLSCfg := &tls.Config{ - Certificates: []tls.Certificate{crt}, - MinVersion: tls.VersionTLS12, - CurvePreferences: []tls.CurveID{ - tls.CurveP521, - tls.CurveP384, - tls.CurveP256, - }, - PreferServerCipherSuites: true, - CipherSuites: []uint16{ - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_RSA_WITH_AES_128_GCM_SHA256, - }, - } - - handler := handler.NewDemoHandler() - pServer := server.New(handler, crt, tp.GetCertPool()) - - errs := make(chan error, 2) - - go func() { - - r := mux.NewRouter() - - r.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - w.Header().Add("Content-Type", "application/json") - out, _ := json.Marshal(struct { - Hello string - }{ - Hello: "World", - }) - w.Write(out) - }) - - r.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) { - ctx, _ := context.WithTimeout(context.Background(), 2*time.Second) - out, _ := json.Marshal(mTLSConnectionTest( - ctx, - r.URL.Query(), - crt, - tp.GetCertPool(), - )) - w.Write(out) - }) - - r.HandleFunc("/send", func(w http.ResponseWriter, r *http.Request) { - - var identity proto.Message - switch r.URL.Query().Get("example") { - case "ivms101_1": - identity = ivms101Example1() - case "ivms101_2": - identity = ivms101Example2() - case "trisa": - fallthrough - default: - identity = trisaExample() - } - - identity2, _ := ptypes.MarshalAny(identity) - data, _ := ptypes.MarshalAny(&bitcoin.Data{ - Source: uuid.New().String(), - Destination: uuid.New().String(), - }) - - tData := &pb.TransactionData{ - Identity: identity2, - Data: data, - } - - if err := pServer.SendRequest(r.Context(), r.URL.Query().Get("target"), uuid.New().String(), tData); err != nil { - fmt.Fprintf(w, "error: %v", err) - return - } - - fmt.Fprint(w, ".") - }) - - srv := &http.Server{ - Addr: c.Server.ListenAddressAdmin, - Handler: r, - TLSConfig: baseTLSCfg, - } - - log.WithFields(log.Fields{ - "component": "admin", - "tls": "listening", - "port": c.Server.ListenAddressAdmin, - }).Info("starting TRISA admin server") - - errs <- srv.ListenAndServeTLS(c.TLS.CertificateFile, c.TLS.PrivateKeyFile) - }() - - /*go func() { - - r := mux.NewRouter() - - r.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { - - w.Header().Add("Content-Type", "application/json") - params := r.URL.Query() - response := &PingResponse{ - Message: params.Get("msg"), - ClientCN: r.TLS.PeerCertificates[0].Subject.CommonName, - ServerCN: r.TLS.ServerName, - } - out, _ := json.Marshal(response) - w.Write(out) - }) - - mTLSCfg := &tls.Config{} - copier.Copy(&mTLSCfg, &baseTLSCfg) - - mTLSCfg.ClientAuth = tls.RequireAndVerifyClientCert - mTLSCfg.ClientCAs = tp.GetCertPool() - - srv := &http.Server{ - Addr: c.Server.ListenAddress, - Handler: r, - TLSConfig: mTLSCfg, - } - - log.WithFields(log.Fields{ - "component": "service", - "tls": "listening", - "port": c.Server.ListenAddress, - }).Info("starting TRISA server") - - errs <- srv.ListenAndServeTLS(c.TLS.CertificateFile, c.TLS.PrivateKeyFile) - - }()*/ - - go func() { - lis, err := net.Listen("tcp", c.Server.ListenAddress) - if err != nil { - errs <- err - } - - mTLSCfg := &tls.Config{} - copier.Copy(&mTLSCfg, &baseTLSCfg) - - mTLSCfg.ClientAuth = tls.RequireAndVerifyClientCert - mTLSCfg.ClientCAs = tp.GetCertPool() - - tc := credentials.NewTLS(mTLSCfg) - s := grpc.NewServer(grpc.Creds(tc)) - pb.RegisterTrisaPeer2PeerServer(s, pServer) - - log.WithFields(log.Fields{ - "component": "grpc", - "tls": "listening", - "port": c.Server.ListenAddress, - }).Info("starting TRISA server") - - errs <- s.Serve(lis) - }() - - log.Fatalf("terminated %v", <-errs) -} - -func trisaExample() *us.Identity { - return &us.Identity{ - FirstName: "Jane", - LastName: "Crock", - Ssn: "001-0434-4983", - DriverLicense: "FA-387463", - State: "CA", - } -} - -func ivms101Example1() *ivms101.IdentityPayload { - return &ivms101.IdentityPayload{ - Originator: &ivms101.Originator{ - OriginatorPersons: []*ivms101.Person{ - &ivms101.Person{ - Person: &ivms101.Person_NaturalPerson{ - &ivms101.NaturalPerson{ - Name: &ivms101.NaturalPersonName{ - NameIdentifiers: []*ivms101.NaturalPersonNameId{ - &ivms101.NaturalPersonNameId{ - PrimaryIdentifier: "Smith", - SecondaryIdentifier: "Dr Alice", - NameIdentifierType: ivms101.NaturalPersonNameTypeCode_NATURAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - }, - GeographicAddresses: []*ivms101.Address{ - &ivms101.Address{ - AddressType: ivms101.AddressTypeCode_ADDRESS_TYPE_CODE_GEOG, - StreetName: "Potential Street", - BuildingNumber: "24", - BuildingName: "Weathering Views", - PostCode: "91765", - TownName: "Walnut", - CountrySubDivision: "California", - Country: "US", - }, - }, - CustomerIdentification: "1002390", - }, - }, - }, - }, - AccountNumbers: []string{"10023909"}, - }, - Beneficiary: &ivms101.Beneficiary{ - BeneficiaryPersons: []*ivms101.Person{ - &ivms101.Person{ - Person: &ivms101.Person_NaturalPerson{ - &ivms101.NaturalPerson{ - Name: &ivms101.NaturalPersonName{ - NameIdentifiers: []*ivms101.NaturalPersonNameId{ - &ivms101.NaturalPersonNameId{ - PrimaryIdentifier: "Barnes", - SecondaryIdentifier: "Robert", - NameIdentifierType: ivms101.NaturalPersonNameTypeCode_NATURAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - }, - }, - }, - }, - }, - AccountNumbers: []string{"1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"}, - }, - OriginatingVasp: &ivms101.OriginatingVasp{ - OriginatingVasp: &ivms101.Person{ - Person: &ivms101.Person_LegalPerson{ - &ivms101.LegalPerson{ - Name: &ivms101.LegalPersonName{ - NameIdentifiers: []*ivms101.LegalPersonNameId{ - &ivms101.LegalPersonNameId{ - LegalPersonName: "VASP A", - LegalPersonNameIdentifierType: ivms101.LegalPersonNameTypeCode_LEGAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - }, - NationalIdentification: &ivms101.NationalIdentification{ - NationalIdentifier: "3M5E1GQKGL17HI8CPN20", - NationalIdentifierType: ivms101.NationalIdentifierTypeCode_NATIONAL_IDENTIFIER_TYPE_CODE_LEIX, - }, - }, - }, - }, - }, - } -} - -func ivms101Example2() *ivms101.IdentityPayload { - return &ivms101.IdentityPayload{ - Originator: &ivms101.Originator{ - OriginatorPersons: []*ivms101.Person{ - &ivms101.Person{ - Person: &ivms101.Person_NaturalPerson{ - &ivms101.NaturalPerson{ - Name: &ivms101.NaturalPersonName{ - NameIdentifiers: []*ivms101.NaturalPersonNameId{ - &ivms101.NaturalPersonNameId{ - PrimaryIdentifier: "Wu", - SecondaryIdentifier: "Xinli", - NameIdentifierType: ivms101.NaturalPersonNameTypeCode_NATURAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - LocalNameIdentifiers: []*ivms101.LocalNaturalPersonNameId{ - &ivms101.LocalNaturalPersonNameId{ - PrimaryIdentifier: "吴", - SecondaryIdentifier: "信利", - NameIdentifierType: ivms101.NaturalPersonNameTypeCode_NATURAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - }, - NationalIdentification: &ivms101.NationalIdentification{ - NationalIdentifier: "446005", - NationalIdentifierType: ivms101.NationalIdentifierTypeCode_NATIONAL_IDENTIFIER_TYPE_CODE_RAID, - RegistrationAuthority: "RA000553", - }, - CountryOfResidence: "TZ", - }, - }, - }, - }, - }, - Beneficiary: &ivms101.Beneficiary{ - BeneficiaryPersons: []*ivms101.Person{ - &ivms101.Person{ - Person: &ivms101.Person_LegalPerson{ - &ivms101.LegalPerson{ - Name: &ivms101.LegalPersonName{ - NameIdentifiers: []*ivms101.LegalPersonNameId{ - &ivms101.LegalPersonNameId{ - LegalPersonName: "ABC Limited", - LegalPersonNameIdentifierType: ivms101.LegalPersonNameTypeCode_LEGAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - &ivms101.LegalPersonNameId{ - LegalPersonName: "CBA Trading", - LegalPersonNameIdentifierType: ivms101.LegalPersonNameTypeCode_LEGAL_PERSON_NAME_TYPE_CODE_TRAD, - }, - }, - }, - }, - }, - }, - }, - AccountNumbers: []string{"00010190CBATRAD"}, - }, - PayloadMetadata: &ivms101.PayloadMetadata{ - TransliterationMethod: []ivms101.TransliterationMethodCode{ - ivms101.TransliterationMethodCode_TRANSLITERATION_METHOD_CODE_HANI, - }, - }, - TransferPath: &ivms101.TransferPath{ - TransferPath: []*ivms101.IntermediaryVasp{ - &ivms101.IntermediaryVasp{ - IntermediaryVasp: &ivms101.Person{ - Person: &ivms101.Person_LegalPerson{ - &ivms101.LegalPerson{ - Name: &ivms101.LegalPersonName{ - NameIdentifiers: []*ivms101.LegalPersonNameId{ - &ivms101.LegalPersonNameId{ - LegalPersonName: "VASP E", - LegalPersonNameIdentifierType: ivms101.LegalPersonNameTypeCode_LEGAL_PERSON_NAME_TYPE_CODE_LEGL, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -type PingResponse struct { - Status string `json:"status,omitempty"` - Message string `json:"message,omitempty"` - ServerCN string `json:"server_cn,omitempty"` - ClientCN string `json:"client_cn,omitempty"` -} - -func mTLSConnectionTest(ctx context.Context, params url.Values, crt tls.Certificate, certPool *x509.CertPool) *PingResponse { - - client := &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{ - Certificates: []tls.Certificate{crt}, - RootCAs: certPool, - }, - }, - } - - url := fmt.Sprintf("https://%s/ping?msg=%s", params.Get("target"), params.Get("msg")) - - req, err := http.NewRequest("GET", url, nil) - - if err != nil { - return responseFailure(err) - } - - res, err := client.Do(req.WithContext(ctx)) - if err != nil { - return responseFailure(err) - } - - body, err := ioutil.ReadAll(res.Body) - if err != nil { - return responseFailure(err) - } - - out := &PingResponse{} - json.Unmarshal(body, out) - - return out -} - -func responseFailure(err error) *PingResponse { - return &PingResponse{ - Message: "something went wrong", - Status: err.Error(), - } -} diff --git a/cmd/trisa/app/trisa.go b/cmd/trisa/app/trisa.go deleted file mode 100644 index 305511b..0000000 --- a/cmd/trisa/app/trisa.go +++ /dev/null @@ -1,12 +0,0 @@ -package app - -import ( - "io" - - "github.com/trisacrypto/trisa/cmd/trisa/app/cmd" -) - -func Run(out, err io.Writer) error { - c := cmd.NewTRISACommand(out, err) - return c.Execute() -} diff --git a/cmd/trisa/trisa.go b/cmd/trisa/trisa.go deleted file mode 100644 index fe9d47e..0000000 --- a/cmd/trisa/trisa.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "os" - - log "github.com/sirupsen/logrus" - "github.com/trisacrypto/trisa/cmd/trisa/app" -) - -func main() { - if err := app.Run(os.Stdout, os.Stderr); err != nil { - log.Fatal(err) - } -} diff --git a/docs/archetypes/default.md b/docs/archetypes/default.md deleted file mode 100644 index 00e77bd..0000000 --- a/docs/archetypes/default.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "{{ replace .Name "-" " " | title }}" -date: {{ .Date }} -draft: true ---- - diff --git a/docs/config.toml b/docs/config.toml deleted file mode 100644 index 906dd69..0000000 --- a/docs/config.toml +++ /dev/null @@ -1,67 +0,0 @@ -baseURL = "https://trisacrypto.github.io/" - -languageCode = "en-us" -DefaultContentLanguage = "en" -title = "TRISA" -theme = "hugo-theme-techdoc" - -hasCJKLanguage = true -metaDataFormat = "yaml" - -pygmentsCodeFences = true -pygmentsUseClasses = true - -defaultContentLanguage = "en" -defaultContentLanguageInSubdir= false -enableMissingTranslationPlaceholders = false - -[Params] - - # Souce Code repository section - description = "Travel Rule Information Sharing Architecture for Virtual Asset Service Providers" - github_repository = "https://github.com/trisacrypto/trisa" - version = "" - - # Documentation repository section - # documentation repository (set edit link to documentation repository) - github_doc_repository = "https://github.com/trisacrypto/trisa" - - # Analytic section - google_analytics_id = "UA-151235008-1" # Your Google Analytics tracking id - tag_manager_container_id = "" # Your Google Tag Manager container id - google_site_verification = "Uq_WB2I4Iq5X-NDnR3rdosrdqgp0TabzVtuDxAKTBRE" # Your Google Site Verification for Search Console - - # Theme settings section - # Theme color - custom_font_color = "" - custom_background_color = "" - - # Documentation Menu section - # Menu style settings - menu_style = "open-menu" # "open-menu" or "slide-menu" - - # Theme settings section - dateformat = "" # default "2 Jan 2006" - # See the format reference https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference - - # path name excluded from documentation menu - menu_exclusion = [] - -# Global menu section -[[menu.main]] - name = "Home" - url = "/" - weight = 5 - -[[menu.main]] - name = "White Paper" - url = "/white-papers/white-paper-trisa-v5.pdf" - weight = 5 - -[[menu.main]] - name = "Architecture" - url = "/architecture" - weight = 10 - -[markup.goldmark.renderer] - unsafe = true \ No newline at end of file diff --git a/docs/content/_index.md b/docs/content/_index.md deleted file mode 100644 index debf529..0000000 --- a/docs/content/_index.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: Home -draft: false ---- - -# TRISA [![Build Status](https://travis-ci.com/trisacrypto/trisa.svg?branch=master)](https://travis-ci.com/trisacrypto/trisa) - -The goal of the Travel Rule Information Sharing Architecture (TRISA) is to enable -compliance with the FATF and FinCEN Travel Rules for cryptocurrency transaction -identity information without modifying the core blockchain protocols, and without -incurring increased transaction costs or modifying virtual currency peer-to-peer -transaction flows. - -{{% button icon="fas fa-download" url="/white-papers/white-paper-trisa-v8.pdf" %}}Download TRISA White Paper v8{{% /button %}} - -## About the Financial Action Task Force (FATF) - -The Financial Action Task Force was founded to address concerns about money laundering -and the threat it poses to the world financial system. The inter-governmental body -advises 36 member countries and two regional organizations, and is one of the most -influential voices globally on combating financial crimes. The FATF’s mandate was expanded -in 2001 to include efforts to combat terrorist financing (CFT). Its influence also extends -beyond its member countries, as a number of regional Financial Action Task Forces around -the world provide guidance to regulators in the Caribbean, Latin America, the Middle East, -and North Africa. Its MoneyVal associate provides guidance to countries of Europe outside -the EU, including Malta. diff --git a/docs/content/architecture/_index.md b/docs/content/architecture/_index.md deleted file mode 100644 index f35ce04..0000000 --- a/docs/content/architecture/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Architecture" -draft: false -weight: 20 ---- - -{{< figure src="/architecture/trisa-pki.png" >}} - -{{< figure src="/architecture/trisa-message-format.png" >}} \ No newline at end of file diff --git a/docs/content/conference/_index.md b/docs/content/conference/_index.md deleted file mode 100644 index 6b2cff7..0000000 --- a/docs/content/conference/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "TRISA Conference 2019" -draft: false -weight: 20 ---- - diff --git a/docs/content/conference/hackathon.md b/docs/content/conference/hackathon.md deleted file mode 100644 index c5855eb..0000000 --- a/docs/content/conference/hackathon.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: "Hackathon" -draft: false -weight: 30 ---- - -{{% button icon="fas fa-download" url="/conference-2019/trisa-conference-hackathon-2019.pdf" %}}Hackathon Slide Deck{{% /button %}} - -## Projects & Slide Decks - -* [VASP Adress Resolution](/conference-2019/trisa_vasp_address_resolution.pdf) -* [Enhancement of PII privacy for TRISA transactions](/conference-2019/trisa_pii_enhancement.pdf) -* [Red Flagging](/conference-2019/trisa_redflagging.pdf) -* [Travel Rule Extension TrisaScan](/conference-2019/trisa_travel_rule_extension_trisascan.pdf) -* [Zero Knowledge TRISA](/conference-2019/trisa_zk.pdf) - -### VASP Adress Resolution - -VASPs need to transfer some required data when sending value to another VASP. -One problem that the current implementation of TRISA does not address is recognizing or -identifying an address as belonging to a VASP. This proposal complements the TRISA protocol. - -### Enhancement of PII privacy for TRISA transactions - -TRISA suggests a VASP to expose the PII of any account holder listed in a proposed transaction. -This runs directly contrary to one of the key benefits of digital currency which is the ability -execute low-value transactions with low friction. - -### Red Flagging - -Determine and return transactions (incl participants) where the use of mixers or other obfuscation techniques (e.g. transaction segmentation, 'hawallah', etc.) are detected - which we refere to as "red flagged" transactions. - -### Travel Rule Extension TrisaScan - -We want to make Travel Rule benefit to user, make it more simple for user to see -VASP, individual information in etherscan. This solution integrates with TRISA library. - -### Zero Knowledge TRISA - -Our constraints: - -* We want all VASPs to use TRISA -* Travel Rule: Counterparty PII recorded before a Tx is sent -* All ICOs accepting Fiat etc. are VASPs -* … How many ICOs in 2018 were Scams... - -So we’s have to bottleneck access to TRISA, but -* this limits adoption of TRISA -* This delegates trust to the TRISA gatekeepers -* who may have different incentives than users & VASPs -* Small Exchanges can be sold... - -## Results - - -Team | Score -------|----- -VASP Adress Resolution | 45.5 -Enhancement of PII privacy for TRISA transactions | 52 -Red Flagging | 48 -Travel Rule Extension TrisaScan | 45 -Zero Knowledge TRISA | 49.5 - - -## Follow-up - -* Monthly online meetup -* Elect board members -* Bylaws proposal -* Setup trisacrypto organization -* Workout production PKI -* Formalize design (issue tracking) diff --git a/docs/content/contributing/_index.md b/docs/content/contributing/_index.md deleted file mode 100644 index cefd1ca..0000000 --- a/docs/content/contributing/_index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Contributing" -draft: false -weight: 50 ---- - -The Contribution section contains the details on the workflow to submit contributions, how issues are -tracked and which procedures to follow to collaborate on the design of the TRISA framework. - diff --git a/docs/content/contributing/bylaws.md b/docs/content/contributing/bylaws.md deleted file mode 100644 index 8df3e5d..0000000 --- a/docs/content/contributing/bylaws.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Bylaws" -draft: false -weight: 30 ---- diff --git a/docs/content/contributing/documentation.md b/docs/content/contributing/documentation.md deleted file mode 100644 index 9335c58..0000000 --- a/docs/content/contributing/documentation.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: "Documentation" -draft: false -weight: 50 ---- - -## Overview - -All TRISA related documentation is maintained at [Github](https://github.com/trisacrypto/trisa/tree/master/docs). -From there the documentation website is automatically generated and hosted on [Github Pages](https://trisacrypto.github.io/). - -For quick edits to fix typos or make minor changes, there is a convenience link at the bottom of each page to directly -edit the content on Github directly. From there you can follow the prompts to submit your pull request for review. - -## Prerequisites - -The TRISA repository contains the necessary tooling to run the documentation website on your machine. This will allow -you to make updates to the content and inspect the results before submitting your changes. - -You only need to have [Git](https://git-scm.com/) and [Docker](https://docs.docker.com/) installed on your system: - -* [Docker Engine Community for Linux](https://docs.docker.com/install/) -* [Install Docker Desktop on Mac](https://docs.docker.com/docker-for-mac/install/) -* [Install Docker Desktop on Windows](https://docs.docker.com/docker-for-windows/install/) - -## Setup your git directory - -Browse to the [TRISA repository](https://github.com/trisacrypto/trisa) and click on `fork` on the right top. Github -will create the fork for you and will be available on `https://github.com//trisa`. - -Follow these steps to setup your git directory using your fork (`origin`) and the main repository (`upstream`). The -example commands are executed from your home directory. - -``` -git clone git@github.com:/trisa.git/trisa -cd trisa -git remote add upstream git@github.com:trisacrypto/trisa.git -git fetch upstream -git submodule init -git submodule update -``` - -## Running the doc website - -Before making any changes, make sure you have the latest version from the upstream repository. To do so, -perform the following steps from within the `trisa` directory. - -``` -git fetch upstream -git rebase upstream/master -``` - -To run and preview the documentation website on your machine: - -* Run `make docs-dev` to start the web server -* Browse to `http://127.0.0.1:1313` - -The development web server will automatically reload when you make changes to the content files which are -located under `docs/content`. If the preview becomes cluttered, you can always termianted the web server -using `CTRL+C` and running the `make docs-dev` command again to reinitialize. - - -## Formatting - -We are making us of [Gohugo](https://gohugo.io/) to generate the content using markdown `md` files. You can -use existing pages as an example to format your text. Additional information is available on the -[Gohugo documentation section](https://gohugo.io/content-management/). - -This website is powered by the [techdoc theme](https://themes.gohugo.io/hugo-theme-techdoc/). The -[example website](https://themes.gohugo.io//theme/hugo-theme-techdoc/sample/build-in-shortcodes/) contains -a rich set of available formatting options. The code for these pages can be found under -`docs/themes/hugo-theme-techdoc/exampleSite` for your reference. - -## Creating your pull request - -Once you are happy with your changes, you can stop the documentation web server and push the changes to -your fork. Perform the following steps from your `trisa` directory: - -``` -git add docs/content -git commit -m "Your commit message, i.e. adding new diagram" -git push origin master:my-doc-changes -``` - -Now you can browse to `https://github.com//trisa` and click on "Create Pull Request" from -the yellow popup box. Make sure to create the pull request against the `master` branch of the upstream -`trisacrypto/trisa` repository. - -Your pull request will be reviewed and merged when approved. When your pull request is merged, the changes -are automatically pushed the the [TRISA website](https://trisacrypto.github.io/). diff --git a/docs/content/contributing/license.md b/docs/content/contributing/license.md deleted file mode 100644 index 9c0cc18..0000000 --- a/docs/content/contributing/license.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: "License" -draft: false -weight: 100 ---- - -``` -The MIT License - -Copyright (c) 2019 CipherTrace, Inc. https://ciphertrace.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -``` \ No newline at end of file diff --git a/docs/content/getting_started/_index.md b/docs/content/getting_started/_index.md deleted file mode 100644 index 01aa638..0000000 --- a/docs/content/getting_started/_index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Getting Started" -draft: false -weight: 30 ---- diff --git a/docs/content/getting_started/demo.md b/docs/content/getting_started/demo.md deleted file mode 100644 index 431a060..0000000 --- a/docs/content/getting_started/demo.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -title: "Demo" -draft: false -weight: 10 ---- - -## Overview - -The demo environment can be run in two different modes: - -1. In standalone mode using docker -2. In development mode running locally - -Both environments will handle the setup of a root CA, two subordinate issuing CA's and -3 different VASP configuration. The first two VASP certificates are issues by the first -subordinate CA, the third one by the second subordinate CA. - - -## Standalone Mode - -This is the easiest way to get a demo environment up-and-running as the only requirement -is having `docker` and `docker-compose` installed on your system. No additional build tools -are necessary. - -Note that the standalone mode does not have the ability to make local code changes and test -drive them locally. To accomplish that, refer to Development Mode below. - -### Starting the demo - -1. Refer to the [Setup your git directory](/contributing/documentation/) section to checkout the -code repository. -2. Make sure you have `docker` and `docker-compose` installed on your system. -3. Execute `make demo-docker` to spool up the VASP servers - -Be patient as your system will download some docker images to setup the PKI environment and -prepare the VASP configurations. Wait until the VASP servers are reporting they are running. - -Example output: - -``` -Creating trisa_vasp1_1 ... done -Creating trisa_vasp2_1 ... done -Creating trisa_vasp3_1 ... done -Attaching to trisa_vasp2_1, trisa_vasp1_1, trisa_vasp3_1 -vasp2_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA admin server" component=admin port=":8592" tls=listening -vasp2_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA server" component=grpc port=":8092" tls=listening -vasp1_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA admin server" component=admin port=":8591" tls=listening -vasp1_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA server" component=grpc port=":8091" tls=listening -vasp3_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA admin server" component=admin port=":8593" tls=listening -vasp3_1 | time="2019-11-06T17:02:45Z" level=info msg="starting TRISA server" component=grpc port=":8093" tls=listening -``` - -Leave this terminal running. Any output generated by the VASP containers will be printed on your screen. Checkout -the "Transaction Exchange" paragraph below how to trigger traffic. - -### Cleanup - -You can terminate the containers by using `CTRL+C`. When you are done test driving the demo environment you can clean -everything up by simply running `make demo-docker-cleanup`. - - -## Development Mode - -The development mode is very similar to the Standalone Mode described above, with the only difference that the code on your -local machine will be used. To be able to run this mode, you will need to have your development environment setup properly first. -Refer to the [Development section](/getting_started/dev/) for more details. - -### Setup - -As this mode is more flexible and tailored to be used during development, it takes a couple of additional steps which can -be executed separately from each other to be able to develop locally using the demo setup. The steps are: - -1. Initialize the PKI environment as explained in the overview above. -2. Initialize the VASP configurations -3. Prepare your `/etc/hosts` file -4. Start (and restart) the VASP servers using your local code - -### PKI Environment - -To initialize the PKI environment, execute `make pki-dev-init`. The resulting certificates can be found in the directory -`hack/etc/pki/dev/out`. This is only required once. - -Example output: - -``` -2019/11/06 17:30:58 [INFO] generating a new CA key and certificate from CSR -2019/11/06 17:30:58 [INFO] generate received request -2019/11/06 17:30:58 [INFO] received CSR -2019/11/06 17:30:58 [INFO] generating key: rsa-2048 -2019/11/06 17:30:58 [INFO] encoded CSR -2019/11/06 17:30:58 [INFO] signed certificate with serial number 359764710305891275363215006319074091388411046281 -2019/11/06 17:30:59 [INFO] generate received request -2019/11/06 17:30:59 [INFO] received CSR -2019/11/06 17:30:59 [INFO] generating key: rsa-2048 -2019/11/06 17:31:00 [INFO] encoded CSR -2019/11/06 17:31:02 [INFO] signed certificate with serial number 336448881919945689928409804424509488290433562755 -2019/11/06 17:31:03 [INFO] generate received request -2019/11/06 17:31:03 [INFO] received CSR -2019/11/06 17:31:03 [INFO] generating key: rsa-2048 -2019/11/06 17:31:03 [INFO] encoded CSR -2019/11/06 17:31:05 [INFO] signed certificate with serial number 324094491831031348264189587264902595950544179050 -2019/11/06 17:31:07 [INFO] generate received request -2019/11/06 17:31:07 [INFO] received CSR -2019/11/06 17:31:07 [INFO] generating key: rsa-2048 -2019/11/06 17:31:07 [INFO] encoded CSR -2019/11/06 17:31:09 [INFO] signed certificate with serial number 103772199174043563903751416274680967299043738918 -2019/11/06 17:31:10 [INFO] generate received request -2019/11/06 17:31:10 [INFO] received CSR -2019/11/06 17:31:10 [INFO] generating key: rsa-2048 -2019/11/06 17:31:11 [INFO] encoded CSR -2019/11/06 17:31:12 [INFO] signed certificate with serial number 363687821928556513700781888500231552873147929246 -2019/11/06 17:31:14 [INFO] generate received request -2019/11/06 17:31:14 [INFO] received CSR -2019/11/06 17:31:14 [INFO] generating key: rsa-2048 -2019/11/06 17:31:14 [INFO] encoded CSR -2019/11/06 17:31:16 [INFO] signed certificate with serial number 20094890818264606042704470361038414783018091041 -``` - -### Generate VASP configs - -Each VASP server needs its own configuration file. By executing `make demo-init` those are automatically created -for you under the `artifacts/demo/vasp*` directories. You can use those as a reference if you want to manually -spool up a VASP server. - -Note that it is advized to use the built-in PKI tooling as also the demo environment requires properly issued -certificates. If you run into any issues down the line regarding TLS authentication errors, you probably need to -re-initialize the PKI environment. - -Example VASP config file: - -``` -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8091 - listenAddressAdmin: :8591 - hostname: vasp1 -``` - -The main `listenAddress` is the port used for the gRPC peer-to-peer communication between the VASPs. The -`listenAddressAdmin` port has a simple HTTP endpoint to trigger transaction exchanges for demo purposes. - -Next to the config generation, this step will also produce a binary `artifacts/bin/trisa` which you can use -to spool up a VASP server manually if you feel for it. This binary in combination with the generated config -files will be used by the next step. - -### DNS Resolution - -As we are simulating multiple VASP servers on your local machine, we will bind them to different port numbers. -However for the mutual TLS authentication to work properly (and be able to test CRL or OSCP), we need to make -use of distinct DNS names for each VASP. - -The easiest way is to add the following entries to your `/etc/hosts` file: - -``` -127.0.0.1 vasp1 -127.0.0.1 vasp2 -127.0.0.1 vasp3 -``` - -### Starting VASP servers - -Now that we are setup, we can use `make demo-run` to start the 3 VASP servers. - -Example output: - -``` -VASP servers started. Log output can be found under github.com/trisacrypto/trisa/artifacts/demo/logs -total 0 --rw-r--r-- 1 skymeyer staff 0 Nov 6 09:43 vasp1.log --rw-r--r-- 1 skymeyer staff 0 Nov 6 09:43 vasp2.log --rw-r--r-- 1 skymeyer staff 0 Nov 6 09:43 vasp3.log -``` - -The log output of each VASP process is redirected to the above mentioned log files which you can tail. -See the next paragraph on how to trigger transaction exchanges. - - -## Transaction Exchange - -The procedure to trigger transaction exchanges is the same for both Standalone as Development mode. Each -VASP has a simplistic HTTP endpoint (admin port) which you can trigger to send a transaction. Note that -the message are currently hardcoded, but you can decide between which VAPs to create the exchange. - -The VASPs are using the following ports: - -* vasp1: gRPC `:8091`, admin `:8591` -* vasp2: gRPC `:8092`, admin `:8592` -* vasp3: gRPC `:8093`, admin `:8593` - -To trigger an exchange from VASP1 to VASP2: - -`curl -ks "https://127.0.0.1:8591/send?target=vasp3:8093" > /dev/null` - -By changing the admin port number `8592` you can specific which VASP will initiate the exchange. The -`target` parameter specifies to which VASP to send the transaction. To send a transaction from VASP3 -to VASP2, use: - -`curl -ks "https://127.0.0.1:8593/send?target=vasp2:8092" > /dev/null` - -Observer the log output of each VASP server to see how the exchange went. - -Example sending VAPS: - -``` -msg="protocol envelope for incomingtransaction 32b25cb3-7db5-47be-b16a-326116614791" direction=incoming enc_algo=AES256_GCM enc_blob="[...]" hmac="[...]" hmac_algo=HMAC_SHA256 -msg="received transaction 32b25cb3-7db5-47be-b16a-326116614791 from vasp1" identity="first_name:\"John\" last_name:\"Doe\" ssn:\"001-0434-4983\" state:\"CA\" driver_license:\"FA-387463\" " identity-type=trisa.identity.us.v1alpha1.Identity network="source:\"38cf76d0-fcb8-4e3a-b5e9-bd65e3f1808b\" destination:\"3412377b-22dd-4f69-a456-9722fce95c8a\" " network-type=trisa.data.bitcoin.v1alpha1.Data -msg="sent transaction response for 32b25cb3-7db5-47be-b16a-326116614791 to vasp1" identity="first_name:\"Jane\" last_name:\"Foe\" national_number:\"109-800211-69\" city_of_birth:\"Zwevezele\" " identity-type=trisa.identity.be.v1alpha1.Identity -msg="protocol envelope for incomingtransaction 32b25cb3-7db5-47be-b16a-326116614791" direction=outgoing enc_algo=AES256_GCM enc_blob="[...]" hmac="[...]" hmac_algo=HMAC_SHA256 -``` diff --git a/docs/content/getting_started/dev.md b/docs/content/getting_started/dev.md deleted file mode 100644 index 1c7ae0f..0000000 --- a/docs/content/getting_started/dev.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "Development" -draft: false -weight: 20 ---- - -## Build System - -The TRISA server is currently written in Go. The code repository is setup with Bazel for the compilation -and dockerization. Installing Bazel is the primary requirement to get started with development. Bazel will -install all the necessary tooling and dependencies completely sandboxed on your system. There is no real -need to install Go, protobuf or any other requirements. As everything is sandboxed, Bazel will not disturb -any existing tooling on your local machine either. - -### Bazelisk - -The TRISA repository is compatible to use `bazelisk`, which is a Bazel launcher. The usage of `bazelisk` is -recommended as it will take care of using the proper Bazel version regardless if Bazel is already installed -on your system. - -Grab the latest release binary from the [bazelisk repository](https://github.com/bazelbuild/bazelisk/releases) -and put it in your `$PATH`. Once the binary is available, the TRISA build system will automatically use the -`bazelisk` launcher for all your build tasks. The launcher will always use the correct Bazel version which -is current for the TRISA build system. - -#### Bazel - -You can skip this step when using `bazelisk` as described above. If you choose to maintain your own bazel -installation, you can install Bazel on OSX as follows. Mind that you will need to ensure your Bazel version -is compatible with the TRISA repository. - -1. Make sure you don't have bazel intalled using core brew: `brew uninstall bazel` -2. Install bazel using `brew tap bazelbuild/tap` followed by `brew install bazelbuild/tap/bazel` - -Verify your installation using `bazel --version`. - -For other platforms, consult the [Bazel Installation Instructions](https://docs.bazel.build/versions/master/install.html). - -### Additional Requirements - -* Ensure `docker` and `docker-compose` are installed -* A regular build environment with `make` is advized as that will make it easier to consume the convenience targets we have setup. - -## Building the Code - -**NOTE: it can take a while the first time bazel runs as it needs to download and compile the dependencies** - -The `Makefile` has some additional documentation for each available target. The primary targets for building are: - -* `make build` -* `make test` \ No newline at end of file diff --git a/docs/content/getting_started/testnet.md b/docs/content/getting_started/testnet.md deleted file mode 100644 index 9ed4d42..0000000 --- a/docs/content/getting_started/testnet.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: "TRISA TESTNET" -draft: false -weight: 40 ---- - -## Introduction - -For testing purposes to develop new clients and integrations, we have a test PKI available and some VASP nodes -running the latest version of TRISA server. This allows for full integration testing without disturbing the -production TRISA network mesh. - -## Test VASP nodes - -The following VASP nodes are available for testing: - -* vasp1.testnet.trisa.io -* vasp2.testnet.trisa.io -* vasp3.testnet.trisa.io - -Each VASP uses port _**8888**_ for the _**gRPC peer-to-peer**_ communication and port _**9999**_ for its _**admin**_ endpoints. - - -## Connecting your own node to the TRISA TESTNET - -### Configuration - -The TRISA server node accepts a `--config` command line argument with the path and filename of a configuration file which -specifies where the node can find its private key, certificate and the trust chain as well as what ports and -hostname to use. - -Here is a sample configuration file: **[config.yaml](/testnet/config/config.yaml)** - -```yaml -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8888 - listenAddressAdmin: :9999 - hostname: myOwnVasp -``` - -The tls entries are all reference to filenames in which to find the artificats. We suggest creating a small directory -for this purpose for instance under the subdirectory `artifacts/testnet/myOwnVasp` to hold all these files and this config.yaml. - -Though strictly not required to connect to the TESTNET, it is suggested to use the same gRPC and admin ports than those -that the TESTNET nodes use, namely 8888 for gRPC traffic and 9999 for admin HTTPS calls. - -The hostname is not relevant for connecting to the TESTNET. - - - - -### Test certificate, private key and chain of trust - -Note that the TESTNET PKI is currently in flux, so the root and issuing CA's may still change. To retrieve your -test certificate and private key, visit our TESTNET certificate portal page: - -> [TESTNET Portal Page](http://testnet.trisa.io) - -You will need to login using your Github account. You can generate as many test certificates as you want, -there are currently no rate limits implemented. Please read the rest of this section before generating your -key and certificate. - -> ##### NOTE -> TRISA **PRODUCTION** SSL certificates will be issued following standard industry practices and artifacts. -> I.e. VASPs will have to submit a SSL CSR as part of their TRISA certification process. -> This TESTNET setup is merely a convenience to get developers up and running as quickly as possible. - - -#### server.crt - -Create a certificate file, e.g. **server.crt** in the before established directory and copy everything between -``` ------BEGIN CERTIFICATE----- -``` -and -``` ------END CERTIFICATE----- -``` -including both tags from the newcert portal page and paste it into this certificate file. - -#### server.key - -Create a key file, e.g. **server.key** in the before established directory and copy everything between -``` ------BEGIN RSA PRIVATE KEY----- -``` -and -``` ------END RSA PRIVATE KEY----- -``` -including both tags from the newcert portal page and paste it into this key file. - -#### trust.chain - -Lastly, your TRISA node needs to know who to trust. For the production systems, the chain of trust will be retrieved -from embedded root CAs and external services they host. However for development purpose the chain of trust is passed -to the node in the form of a file containing the certificates of the trusted CAs. - -[**Click here to download and save the trust.chain file**](/testnet/config/trust.chain) containing the list of the 3 CA certificates that are being used for the TRISA TESTNET and save it to your VASP configuration directory. - - -### Verifying the configuration - -At this point the VASP configuration directory, e.g. `artifacts/testnet/myOwnVasp`, you created should have the following files: -```bash -config.yaml -server.crt -server.key -trust.chain -``` - -And each of them should have their respective, configuration, certificate, private key and chain of trust. - - - - -## Running your VASP node - -Running the following command in the root of the cloned repo and assuming you created the above files in the -`artifacts/testnet/myOwnVasp` subdirectory, should start your VASP node and allow it to connect to the TRISA -TESTNET: - -```bash -bazel run --run_under="cd $PWD/artifacts/testnet/myOwnVasp && " //cmd/trisa -- server --config config.yaml -``` - -The output should look something like this: - -``` -INFO: Build option --run_under has changed, discarding analysis cache. -INFO: Analyzed target //cmd/trisa:trisa (0 packages loaded, 7874 targets configured). -INFO: Found 1 target... -Target //cmd/trisa:trisa up-to-date: - bazel-bin/cmd/trisa/darwin_amd64_stripped/trisa -INFO: Elapsed time: 0.538s, Critical Path: 0.02s -INFO: 0 processes. -INFO: Build completed successfully, 1 total action -INFO: Running command line: /bin/bash -c 'cd /Users/frank/go/src/github.com/trisacrypto/trisa/artifacts/testnet/myOwnVasp && bazel-bINFO: Build completed successfully, 1 total action -INFO[0000] starting TRISA admin server component=admin port=":9999" tls=listening -INFO[0000] starting TRISA server component=grpc port=":8888" tls=listening -``` - - - -## Testing your TESTNET connected VASP -While your node is running, let's see if we can connect to it and have it send a command to one of the TRISA -TESTNET vasps. Open another terminal window and execute the following command: - -```bash -curl -ks "https://127.0.0.1:9999/send?target=vasp3.testnet.trisa.io:8888" -``` -This command will connect to your local machine on port 9999 (the admin port) and send a test message to vasp3.testnet.trisa.io -using gRPC port 8888. The curl command output will be a `'.%'` if everything went fine. - -Your node should have logged some output like this: - -``` -INFO[1028] sent transaction dadb719d-261f-47b1-a5b7-99326b90419a to vasp3.testnet.trisa.io:8888 identity="first_name:\"John\" last_name:\"Doe\" ssn:\"001-0434-4983\" state:\"CA\" driver_license:\"FA-387463\" " identity-type=trisa.identity.us.v1alpha1.Identity network="source:\"ae8a7287-78ef-4b09-a71f-71d38f929127\" destination:\"9baee60d-36b6-4dbc-8c9a-6216bb04fadf\" " network-type=trisa.data.bitcoin.v1alpha1.Data -INFO[1028] protocol envelope for incomingtransaction dadb719d-261f-47b1-a5b7-99326b90419a direction=incoming enc_algo=AES256_GCM enc_blob="[206 225 79 54 251 177 103 181 203 81 108 253 28 45 93 142 203 111 242 142 104 29 168 106 81 73 14 229 47 206 247 163 227 108 79 165 3 217 190 188 185 13 175 97 6 121 181 87 200 245 138 91 79 216 193 92 232 76 15 214 211 66 157 205 61 100 79 86 69 144 130 107 186 31 155 118 240 183 192 113 136 250 41 169 131 112 192 183 30 88 107 144 125 60 8 242 204 223 109 57 240 70 249 180 142 95 92 141 227 109 18 32 26 175 9 223 31 68 22 40 100 252 237 120 6 136]" hmac="[223 69 96 218 116 1 202 106 4 50 98 71 166 254 125 210 18 17 184 212 147 204 160 67 74 115 227 192 134 99 120 90]" hmac_algo=HMAC_SHA256 -INFO[1028] received transaction confirmation for dadb719d-261f-47b1-a5b7-99326b90419a identity="first_name:\"Jane\" last_name:\"Foe\" national_number:\"109-800211-69\" city_of_birth:\"Zwevezele\" " identity-type=trisa.identity.be.v1alpha1.Identity -``` - -If you see some output like this, your local VASP node is able to connect to the TRISA TESTNET and you can start developing. diff --git a/docs/content/trisa_improvement_proposal/_index.md b/docs/content/trisa_improvement_proposal/_index.md deleted file mode 100644 index 80d6529..0000000 --- a/docs/content/trisa_improvement_proposal/_index.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "TRISA Improvement Proposals" -draft: false -weight: 40 ---- - -TRISA is following a process similar to other organizations to propose and communicate -ideas, modifications and enhancements. The vehicle for this is a document called a TRISA -Improvement Proposal or TIP for short. - -## List of current TRISA Improvement Proposals - -TIP # | Title | Date -------|-------|------ -TIP-1 | Add Transaction details exchange between VASPs post-transaction | Nov 5, 2019 -TIP-2 | Add Life Cycle Events based Plug-in system | Nov 5, 2019 -TIP-2 | Create VASP Directory Service Protocol | Nov 5, 2019 -TIP-3 | Create Address Directory Service Protocol | Nov 5, 2019 -TIP-4 | Create DNS Guidelines | Nov 5, 2019 -TIP-5 | Add compliance configurability | Nov 5, 2019 -TIP-6 | Add FATF and Regulation Business Logic and configurability | Nov 5, 2019 diff --git a/docs/layouts/partials/edit-page.html b/docs/layouts/partials/edit-page.html deleted file mode 100644 index d3b3c3c..0000000 --- a/docs/layouts/partials/edit-page.html +++ /dev/null @@ -1,3 +0,0 @@ -{{- with .Site.Params.github_doc_repository -}} - Edit on GitHub -{{- end -}} diff --git a/docs/static/architecture/trisa-mesh.png b/docs/static/architecture/trisa-mesh.png deleted file mode 100644 index cf32f38..0000000 Binary files a/docs/static/architecture/trisa-mesh.png and /dev/null differ diff --git a/docs/static/architecture/trisa-message-format.png b/docs/static/architecture/trisa-message-format.png deleted file mode 100644 index 673167f..0000000 Binary files a/docs/static/architecture/trisa-message-format.png and /dev/null differ diff --git a/docs/static/architecture/trisa-pki.png b/docs/static/architecture/trisa-pki.png deleted file mode 100644 index 400d82c..0000000 Binary files a/docs/static/architecture/trisa-pki.png and /dev/null differ diff --git a/docs/static/conference-2019/Trisa PII privacy.pdf b/docs/static/conference-2019/Trisa PII privacy.pdf deleted file mode 100644 index 40de60a..0000000 Binary files a/docs/static/conference-2019/Trisa PII privacy.pdf and /dev/null differ diff --git a/docs/static/conference-2019/trisa-conference-hackathon-2019.pdf b/docs/static/conference-2019/trisa-conference-hackathon-2019.pdf deleted file mode 100644 index 57af2d3..0000000 Binary files a/docs/static/conference-2019/trisa-conference-hackathon-2019.pdf and /dev/null differ diff --git a/docs/static/conference-2019/trisa_redflagging.pdf b/docs/static/conference-2019/trisa_redflagging.pdf deleted file mode 100644 index b4e7e87..0000000 Binary files a/docs/static/conference-2019/trisa_redflagging.pdf and /dev/null differ diff --git a/docs/static/conference-2019/trisa_travel_rule_extension_trisascan.pdf b/docs/static/conference-2019/trisa_travel_rule_extension_trisascan.pdf deleted file mode 100644 index 9ad516d..0000000 Binary files a/docs/static/conference-2019/trisa_travel_rule_extension_trisascan.pdf and /dev/null differ diff --git a/docs/static/conference-2019/trisa_vasp_address_resolution.pdf b/docs/static/conference-2019/trisa_vasp_address_resolution.pdf deleted file mode 100644 index 3ff71c3..0000000 Binary files a/docs/static/conference-2019/trisa_vasp_address_resolution.pdf and /dev/null differ diff --git a/docs/static/conference-2019/trisa_zk.pdf b/docs/static/conference-2019/trisa_zk.pdf deleted file mode 100644 index b27c914..0000000 Binary files a/docs/static/conference-2019/trisa_zk.pdf and /dev/null differ diff --git a/docs/static/testnet/config/config.yaml b/docs/static/testnet/config/config.yaml deleted file mode 100755 index d3ad8bc..0000000 --- a/docs/static/testnet/config/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8888 - listenAddressAdmin: :9999 - hostname: myOwnVasp diff --git a/docs/static/testnet/config/trust.chain b/docs/static/testnet/config/trust.chain deleted file mode 100644 index 148808a..0000000 --- a/docs/static/testnet/config/trust.chain +++ /dev/null @@ -1,93 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFQDCCAyigAwIBAgIUE87m4cufCbdffDpup1WeHOZxIGkwDQYJKoZIhvcNAQEN -BQAwODEWMBQGA1UEChMNVFJJU0EgVGVzdE5ldDEeMBwGA1UEAxMVVFJJU0EgVGVz -dG5ldCBSb290IENBMB4XDTIwMDQwNjAyNDcwMFoXDTMwMDQwNDAyNDcwMFowODEW -MBQGA1UEChMNVFJJU0EgVGVzdE5ldDEeMBwGA1UEAxMVVFJJU0EgVGVzdG5ldCBS -b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtWawb42ZnPZi -yD8G8F8dakNJaHXWEYZL/Sx/yDNeWgmeDu74Q5mEB/H9R85yyf+M9mWHT13F2SGf -akHnPdGolPUqBKdrCunke/cKsDjvytMBUUqWDh/jQgzZLwdc4WLUkYLXwJsjgSjj -zVcBeXJn4xk0RYiLTN6RDbgS7BOm458U3b2DvFWjoPa94NUj3jLMDnnHmPLkgw6M -FPLGnYVPRkJbaiv95sws4Jigy0iBdqtnB3Twoxml+l4vEqiQEu08gz+ujXz3i7Zj -Q2DkGob5y52DcskGH9H4tZAkXwS6gyL5pkEpdcFuv9bbSWznxQxJNfgmsGlm3Abd -flHFaoxzrl63dxh5Ea/hNl52/dz7qZ3MBrZqGsinL0jvdruO4vdhnB/s1aotOD+h -r17iXP+tfFmmpWjFjG0o+VUpWO6OmbKF72SGvRxoFWPTgKMLU+a75NwQTfSDTwME -EsqQgKq20lRc6oOi5niZbqlQZKlUuPQhHLsJIDu3GlANd7/lE2PMUiyzeP6xq0aN -6ye9sS63+AIqArFUF2nx8Lg2pZNHXWUriwTlCObf01/RukGE5f4pz62PEmO7DlT4 -58xX/d0TUxVH8+6+638B+tMBiRK+0CAeNIiculNjMTrH+IYu6sXabzay10qubR0t -ZHB6Ro1cmz4r4B98Lo7+SoVPxPMTjWUCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEG -MA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFHug4sSTGfPzmp+KPhtpjWgmISB3 -MA0GCSqGSIb3DQEBDQUAA4ICAQAkhs0kURn9Jsv/0G7npna46Xawo7WbMRPsNek4 -4ueeG+7wMGCjOc8W3+wGMgqI0lqCiUDRh69chYmUPZX0Husg0cQL9rZebL9Fsg2q -cGkOFnDJJcnoOQaiJpqsLbq+aL/AZun22DDdik8pZqEtCK0TYK4wsP/F3UrgJDTY -vxz6IiDE2PrWA/IevIk5gskowhg0ZVXlGcADT7HQ42d0SARdJ46c0BvXhn8V1B4K -udSv+rJAfzAFJsvX9VGB0wSuqMqd91nkGieeS7Wddw5gj0smr+XtcVz7YKOtV5Tc -yQIvva7HMYK8wWsIqURn3Z14LhxtPa2CdWeJ2fEo3YAhUxuW1F4OwsemwGy6erx8 -ER80Y4HJrVY/cDpGjhDoVAFfOboeAiICdYJFBHWqiWTUEHJyIHR4QUOyLEsyMByL -Adhd+4fZGW9CbXxRD6iTVWCv9Tv5oOZjXeqwuKZ7aaBYspuNPKqY5yKip/dMpqB7 -X/8v5YHBTkUAylcv46XWahfON39KYer05757hXJXIqwHklOxQPOGyHi1sr6XxYer -FMYoR9O392e2YDx0FOrFFzJFsYrBPchB8VttDJAMmIqHCxIYG396xNNfy86cK3rE -hJaNebXn1lI1+L26fkCsvAksw6v0ShGkphOC09Q/S7zO/chAv2F4DqYnjrMCwcOL -affP/w== ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFZjCCA06gAwIBAgIUDymOMrDn6XjmlRj/IT6fZtkT1EQwDQYJKoZIhvcNAQEN -BQAwODEWMBQGA1UEChMNVFJJU0EgVGVzdE5ldDEeMBwGA1UEAxMVVFJJU0EgVGVz -dG5ldCBSb290IENBMB4XDTIwMDQwNjAyNDcwMFoXDTIxMDQwNjAyNDcwMFowPTEW -MBQGA1UEChMNVFJJU0EgVGVzdE5ldDEjMCEGA1UEAxMaVFJJU0EgVGVzdE5ldCBJ -c3N1aW5nIENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC0Vf+r -xUmMKRAgr8xR6BfdDeSn/lrbIryCSPJTIBB/NjGluvmHoH29gVrvU99aTKwkbL0W -Qw04jS2eGuMUM/dJnIT9g2B0Fa5eP1rFTB/zE5YFExySEvY4h6JjZ/ab4XybZIVS -YnYEudbZ2jZQBWMM+JWdgTO6HWi3yBk8siODmkTDkS5ZBNbqnEtNPYgi1qUHfMMb -kJ/BIGGevv2gOy+hrnjMpV6AXexGifdzDCoYIA6WIlXRHEh6CqyRGnvssYswWAER -uxLEf+HTPMX2N0cRAbg4wcPrYgJmnTVF/hzn54raajgB/6fVICC5nREOeszk75d+ -z/jM9smVPDhDdyFzbZED6wt9Yf5g4TL9WHZGmhakO9Dy6BXt/fAhLwiVxm3nSYM4 -iFKHnJYN9juN0A3bX0JMuoRm1XvVUOVoUSULsLYDzmEv6dYkgiDQrnjNsSw6Z/1O -Or78rsFIb6wsTwlystcdHzoQYjY7gXjp85204EKIhEGNMMirfKbtFNdV+pDq10gD -JqkFTSC7yoIoFkyZ1U1tBr7fCYqdymAHGzQaqmRWmvrWGu049upYv5Es57dIJ/o4 -b8mspSLE835Mjk7jy1MmmksP3+ZeGV6rJzz8r4PWrI9v/y83zNBWJtc6YuTU87om -H4RQAyyAGePBeKWWTzz2YCtAefuFi5zGkp84IwIDAQABo2MwYTAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU/jo1K6Uqh/kM8tPwGeOn -mEEqLYQwHwYDVR0jBBgwFoAUe6DixJMZ8/Oan4o+G2mNaCYhIHcwDQYJKoZIhvcN -AQENBQADggIBACYv/kFjfgauDPWJXSb+XMPT6bfsJztC55bX2tpaLpV9u6QNH72r -t79PvOSQQ3eV72Gw1tfaiWbPRKIY9SGELjp/G7vcOS4pF8BTesJnHva7aEsHqtLL -fqw+ZkrKW+ZyvY0vefdBh5hrJIMKDgGkuKayiaIzHzkBBSdBPJEOg818cVErmNX2 -dLAu3o5xl7v20sQmK9j0gEDYxj7tuhOWVYZmcog8bQWxXtCs14znNut00Gn6CSRI -CsdwWFvrbZlfiv4OqTEZjsmqx/aSf6IwjfUYjATGVaX9Uwb+YMjp+PyADMbaj81K -XKP0gBvaoBiKXOmRl3/xQmVgYZfV24UEv1tPlY5ueKw+3zVZei/OQG1gpdieK4Tm -fq+yRkR23PLXcrGoUWw519+AJHu0Uiq1ZFf7UTZIq8Y/4ZPDyIkgP2TycxcBJEEy -vwMdsbchzpGbd7OqWFEWIjAAza0zc9kRkqVuygbTNYSC5PzeeolcS2l7+BG5lyG2 -7rXed0PxMbz4wHYclHuuI6EKYJRVWpm8Uku60mgzSDMdVVxy5ccYCTvJ/VuW0Xff -Cluk2LyVAvi+DoViS5QABDA1duMvYs8YmwwYo00xhSsjsTg+BVlULqsQH/AMqX21 -iFzTSfl43xduyUb7zT2mxq0iVUP0K16jXgVa10CCW4dcrK7hPpXGd9A9 ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- -MIIFZjCCA06gAwIBAgIUO+nNG89+qVKI2E45gcKBehhWVaowDQYJKoZIhvcNAQEN -BQAwODEWMBQGA1UEChMNVFJJU0EgVGVzdE5ldDEeMBwGA1UEAxMVVFJJU0EgVGVz -dG5ldCBSb290IENBMB4XDTIwMDQwNjAyNDcwMFoXDTIxMDQwNjAyNDcwMFowPTEW -MBQGA1UEChMNVFJJU0EgVGVzdE5ldDEjMCEGA1UEAxMaVFJJU0EgVGVzdE5ldCBJ -c3N1aW5nIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDLzfww -hDHETRYL2/+nfcthBju09h9i2T72w+VAEFLMwDVQvXfnEGdToznx8Robt1SCRglj -Y4zN7vaqWHEtnz/76UMIinLzjz3BGaMsyiFeQ7q/ZEoQ7SsHOJzuHaUVTFydtQfQ -jWMPn/5GqfUGiftEvtwhsMnFaQ7CbeucV6KwfU7nuZBHBxZKFDxclZmfFxLyAdAp -mSo4Y9/XRnfGv3hAl8+1VhhYmZl7pSC2uNnPy2cply87J7EChUpIFhL5PplEQa7n -Hj95AuEv8Axj1iHw/W4wwfG4JnDdJPVDaXnZuEfHuAHxMd+ZgId/vRjkYQtk6wEF -3b4/HSMgwV2HOr4HnsBuSu5hw5yhTjVDpCALbgSg3DojzeZiftJtkJD2zcDu2WYU -KZxLSuu0iMw8E2xbptdx4AoOeTkJxvcBqGFqvdATFwbn1AoRmN2NDuANlqWvInMz -JEa8HMmBAhBje9WNc+hOnRVcmzIDDm6U8JFIUz+A20x6NpmYKUkIJa0KxAl19G8T -rdhIXCyW2lGYKXc37JJQbK7CtS3O7Ba/Cdrse4WocQmu/XtO5oPVI3nDmbwstxFN -yh2++ZZW4l72eqStW12PUCzF1eok23T7ppNkj64FZZwTIxygTVNeXEdQTp4axjM+ -iP6X8XOCABCtJMBy7t7XMsI6jjZ+PzdM0J8bjQIDAQABo2MwYTAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUev4c5lKpxHbn8iZ7R75+ -tS4daLAwHwYDVR0jBBgwFoAUe6DixJMZ8/Oan4o+G2mNaCYhIHcwDQYJKoZIhvcN -AQENBQADggIBAFXWbKI0lyQ7Jx9iNXXAuGG8gena7HP814PksJQi7xqwITR5pLy2 -gcenMSWmLQc4678zjt9HyhjDkkwwxYlCFSP4Kq2G0m+qSb8tCc4HwvY3P8o2EqgE -mcy5Z4Lbm8uPJqh2BW6fwlSXxYH/NRoi170VgEDW1DVbnjBuxvOtp66U5mFlM9MB -DTKWfb6SyIyGwN7AzqZE5F1FdNkZskJQB67kUY3faJ0XdK8yEBczL71TZM9nPVv8 -hCmS3SJCCkv/6pt4q6/WdowAYFvae3rIJDr70zivbisqRLr/wiNKwFugSsYHA/6M -4uCV6DdM6tibAFm+C/ezpdlX47rnzzs65yUR0diiSzK5KH/zhEqGGVOquzo8NOUW -7rMs/oBdJlNwDKm26ypUx0wz/1CW4MPezqG8/rRUjT+My+uzoqK2RHZKx8CWZqYy -HsAoog69KjlJ3CbXZaP+4zyZvDYjsu45Zbg+7z2wrljKhthkR8iBy+yEsn/f1D+B -4ZDZgzBhBSpdIydLxNo+q9xNUm3WjkX1ZLJpweNgTMbD0Iysx5C9U2hF2B0jjwRB -t7XgwQbOEHdoyDMTFnvdoGqT6lWZMmtvBlCD7XK1OaPZk6K9ZeAUbVz1H2L1Lc7y -37LmfptkDXVthqPXuLgrFoKRPN4F/sQ/5VJ98cZmrw7mt2utidjxYltu ------END CERTIFICATE----- diff --git a/docs/static/white-papers/white-paper-trisa-v4.pdf b/docs/static/white-papers/white-paper-trisa-v4.pdf deleted file mode 100644 index 97c5086..0000000 Binary files a/docs/static/white-papers/white-paper-trisa-v4.pdf and /dev/null differ diff --git a/docs/static/white-papers/white-paper-trisa-v5.pdf b/docs/static/white-papers/white-paper-trisa-v5.pdf deleted file mode 100644 index 3009ca1..0000000 Binary files a/docs/static/white-papers/white-paper-trisa-v5.pdf and /dev/null differ diff --git a/docs/static/white-papers/white-paper-trisa-v8.pdf b/docs/static/white-papers/white-paper-trisa-v8.pdf deleted file mode 100644 index 9989940..0000000 Binary files a/docs/static/white-papers/white-paper-trisa-v8.pdf and /dev/null differ diff --git a/docs/themes/hugo-theme-techdoc b/docs/themes/hugo-theme-techdoc deleted file mode 160000 index d6d3a93..0000000 --- a/docs/themes/hugo-theme-techdoc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d6d3a9370b4a89a6e5c81f4a5778f940b11daa14 diff --git a/go.mod b/go.mod deleted file mode 100644 index 260c83b..0000000 --- a/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/trisacrypto/trisa - -go 1.13 - -require ( - github.com/golang/protobuf v1.3.3 - github.com/google/uuid v1.1.1 - github.com/gorilla/mux v1.7.3 - github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 - github.com/sirupsen/logrus v1.4.2 - github.com/spf13/cobra v0.0.5 - github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20190825160603-fb81701db80f // indirect - google.golang.org/grpc v1.28.0 - gopkg.in/yaml.v2 v2.2.2 -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 48f85f1..0000000 --- a/go.sum +++ /dev/null @@ -1,107 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -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/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/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -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/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/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 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8 h1:mGIXW/lubQ4B+3bXTLxcTMTjUNDqoF6T/HUW9LbFx9s= -github.com/jinzhu/copier v0.0.0-20190625015134-976e0346caa8/go.mod h1:yL958EeXv8Ylng6IfnvG4oflryUi3vgA3xPs9hmII1s= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -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_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -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-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -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-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/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-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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190825160603-fb81701db80f h1:LCxigP8q3fPRGNVYndYsyHnF0zRrvcoVwZMfb8iQZe4= -golang.org/x/sys v0.0.0-20190825160603-fb81701db80f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -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/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/hack/etc/demo/docker-compose.yml b/hack/etc/demo/docker-compose.yml deleted file mode 100644 index 8fd102c..0000000 --- a/hack/etc/demo/docker-compose.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: "3" -services: - vasp1: - image: trisacrypto/trisa:latest - command: server - working_dir: /etc/trisa - ports: - - "8091:8091" - - "8591:8591" - volumes: - - ./artifacts/demo/vasp1:/etc/trisa - vasp2: - image: trisacrypto/trisa:latest - command: server - working_dir: /etc/trisa - ports: - - "8092:8092" - - "8592:8592" - volumes: - - ./artifacts/demo/vasp2:/etc/trisa - vasp3: - image: trisacrypto/trisa:latest - command: server - working_dir: /etc/trisa - ports: - - "8093:8093" - - "8593:8593" - volumes: - - ./artifacts/demo/vasp3:/etc/trisa \ No newline at end of file diff --git a/hack/etc/k8s/vasps/kustomization.yaml b/hack/etc/k8s/vasps/kustomization.yaml deleted file mode 100644 index c492f40..0000000 --- a/hack/etc/k8s/vasps/kustomization.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: default - -resources: - - vasp1-deployment.yaml - - vasp1-service.yaml - - vasp2-deployment.yaml - - vasp2-service.yaml - - vasp3-deployment.yaml - - vasp3-service.yaml - -secretGenerator: - - - name: vasp1 - files: - - vasp1/config.yaml - - vasp1/server.crt - - vasp1/server.key - - vasp1/trust.chain - - name: vasp2 - files: - - vasp2/config.yaml - - vasp2/server.crt - - vasp2/server.key - - vasp2/trust.chain - - name: vasp3 - files: - - vasp3/config.yaml - - vasp3/server.crt - - vasp3/server.key - - vasp3/trust.chain \ No newline at end of file diff --git a/hack/etc/k8s/vasps/vasp1-deployment.yaml b/hack/etc/k8s/vasps/vasp1-deployment.yaml deleted file mode 100644 index 666d082..0000000 --- a/hack/etc/k8s/vasps/vasp1-deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vasp1 - labels: - app: trisa - entity: vasp1 -spec: - replicas: 1 - selector: - matchLabels: - app: trisa - entity: vasp1 - template: - metadata: - labels: - app: trisa - entity: vasp1 - spec: - containers: - - name: vasp - image: trisacrypto/trisa - imagePullPolicy: Never - workingDir: /etc/trisa - args: ["server"] - ports: - - name: grpc - containerPort: 8091 - - name: admin - containerPort: 8591 - volumeMounts: - - name: config - mountPath: /etc/trisa - readOnly: true - readinessProbe: - tcpSocket: - port: grpc - failureThreshold: 3 - periodSeconds: 10 - initialDelaySeconds: 5 - resources: - requests: - cpu: "100m" - memory: "128Mi" - limits: - cpu: "500m" - memory: "256Mi" - volumes: - - name: config - secret: - secretName: vasp1 - diff --git a/hack/etc/k8s/vasps/vasp1-service.yaml b/hack/etc/k8s/vasps/vasp1-service.yaml deleted file mode 100644 index f8ff36c..0000000 --- a/hack/etc/k8s/vasps/vasp1-service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: vasp1 - labels: - app: trisa - entity: vasp1 -spec: - type: NodePort - selector: - app: trisa - entity: vasp1 - ports: - - name: grpc - port: 8091 - targetPort: grpc - nodePort: 30091 - - name: admin - port: 8591 - targetPort: admin - nodePort: 30591 diff --git a/hack/etc/k8s/vasps/vasp1/config.yaml b/hack/etc/k8s/vasps/vasp1/config.yaml deleted file mode 100755 index a331288..0000000 --- a/hack/etc/k8s/vasps/vasp1/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8091 - listenAddressAdmin: :8591 - hostname: vasp1 diff --git a/hack/etc/k8s/vasps/vasp2-deployment.yaml b/hack/etc/k8s/vasps/vasp2-deployment.yaml deleted file mode 100644 index e119b2e..0000000 --- a/hack/etc/k8s/vasps/vasp2-deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vasp2 - labels: - app: trisa - entity: vasp2 -spec: - replicas: 1 - selector: - matchLabels: - app: trisa - entity: vasp2 - template: - metadata: - labels: - app: trisa - entity: vasp2 - spec: - containers: - - name: vasp - image: trisacrypto/trisa:latest - imagePullPolicy: Never - workingDir: /etc/trisa - args: ["server"] - ports: - - name: grpc - containerPort: 8092 - - name: admin - containerPort: 8592 - volumeMounts: - - name: config - mountPath: /etc/trisa - readOnly: true - readinessProbe: - tcpSocket: - port: grpc - failureThreshold: 3 - periodSeconds: 10 - initialDelaySeconds: 5 - resources: - requests: - cpu: "100m" - memory: "128Mi" - limits: - cpu: "500m" - memory: "256Mi" - volumes: - - name: config - secret: - secretName: vasp2 - diff --git a/hack/etc/k8s/vasps/vasp2-service.yaml b/hack/etc/k8s/vasps/vasp2-service.yaml deleted file mode 100644 index 48a67df..0000000 --- a/hack/etc/k8s/vasps/vasp2-service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: vasp2 - labels: - app: trisa - entity: vasp2 -spec: - type: NodePort - selector: - app: trisa - entity: vasp2 - ports: - - name: grpc - port: 8092 - targetPort: grpc - nodePort: 30092 - - name: admin - port: 8592 - targetPort: admin - nodePort: 30592 diff --git a/hack/etc/k8s/vasps/vasp2/config.yaml b/hack/etc/k8s/vasps/vasp2/config.yaml deleted file mode 100755 index 68f915e..0000000 --- a/hack/etc/k8s/vasps/vasp2/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8092 - listenAddressAdmin: :8592 - hostname: vasp2 diff --git a/hack/etc/k8s/vasps/vasp3-deployment.yaml b/hack/etc/k8s/vasps/vasp3-deployment.yaml deleted file mode 100644 index 7aa8bd3..0000000 --- a/hack/etc/k8s/vasps/vasp3-deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: vasp3 - labels: - app: trisa - entity: vasp3 -spec: - replicas: 1 - selector: - matchLabels: - app: trisa - entity: vasp3 - template: - metadata: - labels: - app: trisa - entity: vasp3 - spec: - containers: - - name: vasp - image: trisacrypto/trisa:latest - imagePullPolicy: Never - workingDir: /etc/trisa - args: ["server"] - ports: - - name: grpc - containerPort: 8093 - - name: admin - containerPort: 8593 - volumeMounts: - - name: config - mountPath: /etc/trisa - readOnly: true - readinessProbe: - tcpSocket: - port: grpc - failureThreshold: 3 - periodSeconds: 10 - initialDelaySeconds: 5 - resources: - requests: - cpu: "100m" - memory: "128Mi" - limits: - cpu: "500m" - memory: "256Mi" - volumes: - - name: config - secret: - secretName: vasp3 - diff --git a/hack/etc/k8s/vasps/vasp3-service.yaml b/hack/etc/k8s/vasps/vasp3-service.yaml deleted file mode 100644 index a9e9a8f..0000000 --- a/hack/etc/k8s/vasps/vasp3-service.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: vasp3 - labels: - app: trisa - entity: vasp3 -spec: - type: NodePort - selector: - app: trisa - entity: vasp3 - ports: - - name: grpc - port: 8093 - targetPort: grpc - nodePort: 30093 - - name: admin - port: 8593 - targetPort: admin - nodePort: 30593 diff --git a/hack/etc/k8s/vasps/vasp3/config.yaml b/hack/etc/k8s/vasps/vasp3/config.yaml deleted file mode 100755 index a469715..0000000 --- a/hack/etc/k8s/vasps/vasp3/config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -tls: - privateKeyFile: server.key - certificateFile: server.crt - trustChain: trust.chain -server: - listenAddress: :8093 - listenAddressAdmin: :8593 - hostname: vasp3 diff --git a/hack/etc/kind/trisa-cluster-one-worker.yaml b/hack/etc/kind/trisa-cluster-one-worker.yaml deleted file mode 100644 index a3caf64..0000000 --- a/hack/etc/kind/trisa-cluster-one-worker.yaml +++ /dev/null @@ -1,21 +0,0 @@ -kind: Cluster -apiVersion: kind.sigs.k8s.io/v1alpha3 -nodes: - - role: control-plane - - role: worker - extraPortMappings: - # VASP1 - - containerPort: 30091 - hostPort: 8091 - - containerPort: 30591 - hostPort: 8591 - # VASP2 - - containerPort: 30092 - hostPort: 8092 - - containerPort: 30592 - hostPort: 8592 - # VASP3 - - containerPort: 30093 - hostPort: 8093 - - containerPort: 30593 - hostPort: 8593 \ No newline at end of file diff --git a/hack/etc/pki/dev/end-entity-config.json b/hack/etc/pki/dev/end-entity-config.json deleted file mode 100644 index e2b10be..0000000 --- a/hack/etc/pki/dev/end-entity-config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "signing": { - "default": { - "expiry": "1440h", - "usages": [ - "signing", - "key encipherment", - "server auth", - "client auth" - ], - "ca_constraint": { - "is_ca": false - } - } - } -} \ No newline at end of file diff --git a/hack/etc/pki/dev/root-csr.json b/hack/etc/pki/dev/root-csr.json deleted file mode 100644 index ac8b235..0000000 --- a/hack/etc/pki/dev/root-csr.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "CN": "TRISA Dev Root CA", - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "O": "TRISA Dev" - } - ], - "ca": { - "expiry": "87600h" - } -} \ No newline at end of file diff --git a/hack/etc/pki/dev/server-csr.json b/hack/etc/pki/dev/server-csr.json deleted file mode 100644 index fd2be43..0000000 --- a/hack/etc/pki/dev/server-csr.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "CN": "localhost", - "hosts": [ - "127.0.0.1" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "O": "TRISA Dev" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/dev/subca-config.json b/hack/etc/pki/dev/subca-config.json deleted file mode 100644 index bd54d1f..0000000 --- a/hack/etc/pki/dev/subca-config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "signing": { - "default": { - "expiry": "8760h", - "usages": [ - "cert sign", - "crl sign" - ], - "ca_constraint": { - "is_ca": true - } - } - }, - "auth_keys": { - "default": { - "key": "%%KEY%%", - "type": "standard" - } - } -} \ No newline at end of file diff --git a/hack/etc/pki/dev/subca-csr.json b/hack/etc/pki/dev/subca-csr.json deleted file mode 100644 index 3e5cae2..0000000 --- a/hack/etc/pki/dev/subca-csr.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "CN": "TRISA Dev %%NAME%%", - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "O": "TRISA Dev" - } - ] - } \ No newline at end of file diff --git a/hack/etc/pki/dev/vasp1-csr.json b/hack/etc/pki/dev/vasp1-csr.json deleted file mode 100644 index 3cba49b..0000000 --- a/hack/etc/pki/dev/vasp1-csr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "CN": "vasp1", - "hosts": [ - "vasp1", - "vasp1.example.com", - "localhost", - "127.0.0.1" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "US", - "L": "San Francisco", - "O": "VASP 1" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/dev/vasp2-csr.json b/hack/etc/pki/dev/vasp2-csr.json deleted file mode 100644 index 3f1f890..0000000 --- a/hack/etc/pki/dev/vasp2-csr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "CN": "vasp2", - "hosts": [ - "vasp2", - "vasp2.example.com", - "localhost", - "127.0.0.1" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "BE", - "L": "Brussels", - "O": "VASP 2" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/dev/vasp3-csr.json b/hack/etc/pki/dev/vasp3-csr.json deleted file mode 100644 index 0bc4edd..0000000 --- a/hack/etc/pki/dev/vasp3-csr.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "CN": "vasp3", - "hosts": [ - "vasp3", - "vasp3.example.com", - "localhost", - "127.0.0.1" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "NL", - "L": "Amsterdam", - "O": "VASP 3" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/end-entity-config.json b/hack/etc/pki/testnet/end-entity-config.json deleted file mode 100644 index e2b10be..0000000 --- a/hack/etc/pki/testnet/end-entity-config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "signing": { - "default": { - "expiry": "1440h", - "usages": [ - "signing", - "key encipherment", - "server auth", - "client auth" - ], - "ca_constraint": { - "is_ca": false - } - } - } -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/root-csr.json b/hack/etc/pki/testnet/root-csr.json deleted file mode 100644 index 644dc0d..0000000 --- a/hack/etc/pki/testnet/root-csr.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "CN": "TRISA Testnet Root CA", - "key": { - "algo": "rsa", - "size": 4096 - }, - "names": [ - { - "O": "TRISA TestNet" - } - ], - "ca": { - "expiry": "87600h" - } -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/server-csr.json b/hack/etc/pki/testnet/server-csr.json deleted file mode 100644 index c873c2c..0000000 --- a/hack/etc/pki/testnet/server-csr.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "CN": "testnet.trisa.io", - "hosts": [ - "127.0.0.1" - ], - "key": { - "algo": "rsa", - "size": 4096 - }, - "names": [ - { - "O": "TRISA Testnet Portal" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/subca-config.json b/hack/etc/pki/testnet/subca-config.json deleted file mode 100644 index bd54d1f..0000000 --- a/hack/etc/pki/testnet/subca-config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "signing": { - "default": { - "expiry": "8760h", - "usages": [ - "cert sign", - "crl sign" - ], - "ca_constraint": { - "is_ca": true - } - } - }, - "auth_keys": { - "default": { - "key": "%%KEY%%", - "type": "standard" - } - } -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/subca-csr.json b/hack/etc/pki/testnet/subca-csr.json deleted file mode 100644 index 442b65a..0000000 --- a/hack/etc/pki/testnet/subca-csr.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "CN": "TRISA TestNet %%NAME%%", - "key": { - "algo": "rsa", - "size": 4096 - }, - "names": [ - { - "O": "TRISA TestNet" - } - ] - } \ No newline at end of file diff --git a/hack/etc/pki/testnet/vasp1-csr.json b/hack/etc/pki/testnet/vasp1-csr.json deleted file mode 100644 index b29c136..0000000 --- a/hack/etc/pki/testnet/vasp1-csr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CN": "vasp1.testnet.trisa.io", - "hosts": [ - "vasp1.testnet.trisa.io" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "US", - "L": "San Francisco", - "O": "VASP 1" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/vasp2-csr.json b/hack/etc/pki/testnet/vasp2-csr.json deleted file mode 100644 index 1879b96..0000000 --- a/hack/etc/pki/testnet/vasp2-csr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CN": "vasp2.testnet.trisa.io", - "hosts": [ - "vasp2.testnet.trisa.io" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "BE", - "L": "Brussels", - "O": "VASP 2" - } - ] -} \ No newline at end of file diff --git a/hack/etc/pki/testnet/vasp3-csr.json b/hack/etc/pki/testnet/vasp3-csr.json deleted file mode 100644 index 801e884..0000000 --- a/hack/etc/pki/testnet/vasp3-csr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "CN": "vasp3.testnet.trisa.io", - "hosts": [ - "vasp3.testnet.trisa.io" - ], - "key": { - "algo": "rsa", - "size": 2048 - }, - "names": [ - { - "C": "NL", - "L": "Amsterdam", - "O": "VASP 3" - } - ] -} \ No newline at end of file diff --git a/hack/exec/bake-tooling.sh b/hack/exec/bake-tooling.sh deleted file mode 100755 index 7ab3cfa..0000000 --- a/hack/exec/bake-tooling.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -tooling::bake diff --git a/hack/exec/build-docker.sh b/hack/exec/build-docker.sh deleted file mode 100755 index 657b12a..0000000 --- a/hack/exec/build-docker.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::bazel::exec run --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 //cmd/trisa:docker -- --norun \ No newline at end of file diff --git a/hack/exec/build.sh b/hack/exec/build.sh deleted file mode 100755 index 93aade5..0000000 --- a/hack/exec/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::bazel::exec build //cmd/trisa \ No newline at end of file diff --git a/hack/exec/demo-docker-cleanup.sh b/hack/exec/demo-docker-cleanup.sh deleted file mode 100755 index ae49095..0000000 --- a/hack/exec/demo-docker-cleanup.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::demo::docker::down -trisa::artifacts::clear diff --git a/hack/exec/demo-docker.sh b/hack/exec/demo-docker.sh deleted file mode 100755 index bb3d261..0000000 --- a/hack/exec/demo-docker.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -pki::init::ca -pki::issue::subca 1 -pki::issue::subca 2 -pki::issue::end-entity::local vasp1 ../vasp1-csr.json subca1 -pki::issue::end-entity::local vasp2 ../vasp2-csr.json subca1 -pki::issue::end-entity::local vasp3 ../vasp3-csr.json subca2 - -trisa::demo::init -trisa::demo::vasp::config-gen-docker -trisa::demo::docker::up diff --git a/hack/exec/demo-init.sh b/hack/exec/demo-init.sh deleted file mode 100755 index 8a1e747..0000000 --- a/hack/exec/demo-init.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::artifacts::clear - -trisa::demo::init -trisa::demo::build -trisa::demo::vasp::config-gen \ No newline at end of file diff --git a/hack/exec/demo-rebuild.sh b/hack/exec/demo-rebuild.sh deleted file mode 100755 index 68d0825..0000000 --- a/hack/exec/demo-rebuild.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::demo::build -trisa::demo::start::vasps \ No newline at end of file diff --git a/hack/exec/demo-run.sh b/hack/exec/demo-run.sh deleted file mode 100755 index b6175e5..0000000 --- a/hack/exec/demo-run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::demo::start::vasps \ No newline at end of file diff --git a/hack/exec/demo-stop.sh b/hack/exec/demo-stop.sh deleted file mode 100755 index 846b299..0000000 --- a/hack/exec/demo-stop.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::demo::stop::vasps \ No newline at end of file diff --git a/hack/exec/dependencies.sh b/hack/exec/dependencies.sh deleted file mode 100755 index abbcb11..0000000 --- a/hack/exec/dependencies.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -go mod tidy - -trisa::bazel::exec run //:gazelle -- fix -trisa::bazel::exec run //:gazelle -- update-repos -from_file=go.mod diff --git a/hack/exec/docs-dev.sh b/hack/exec/docs-dev.sh deleted file mode 100755 index 64436dd..0000000 --- a/hack/exec/docs-dev.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::docs::dev \ No newline at end of file diff --git a/hack/exec/docs-generate.sh b/hack/exec/docs-generate.sh deleted file mode 100755 index 7af696d..0000000 --- a/hack/exec/docs-generate.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::docs::generate \ No newline at end of file diff --git a/hack/exec/gazelle.sh b/hack/exec/gazelle.sh deleted file mode 100755 index 5b07a87..0000000 --- a/hack/exec/gazelle.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::bazel::exec run //:gazelle -- fix \ No newline at end of file diff --git a/hack/exec/k8s-cluster-destroy.sh b/hack/exec/k8s-cluster-destroy.sh deleted file mode 100755 index be70ad3..0000000 --- a/hack/exec/k8s-cluster-destroy.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -kind::cluster::destroy \ No newline at end of file diff --git a/hack/exec/k8s-cluster-start.sh b/hack/exec/k8s-cluster-start.sh deleted file mode 100755 index ea630d8..0000000 --- a/hack/exec/k8s-cluster-start.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -kind::cluster::start \ No newline at end of file diff --git a/hack/exec/k8s-vasps-delete.sh b/hack/exec/k8s-vasps-delete.sh deleted file mode 100755 index 85f87af..0000000 --- a/hack/exec/k8s-vasps-delete.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -kind::ensure-ctx -skaffold delete -p kind \ No newline at end of file diff --git a/hack/exec/k8s-vasps-run.sh b/hack/exec/k8s-vasps-run.sh deleted file mode 100755 index 307f720..0000000 --- a/hack/exec/k8s-vasps-run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -kind::ensure-ctx -kind::vasp::prepare-certificates -skaffold run -p kind \ No newline at end of file diff --git a/hack/exec/pki-dev-init.sh b/hack/exec/pki-dev-init.sh deleted file mode 100755 index 4daad0a..0000000 --- a/hack/exec/pki-dev-init.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -# Force dev profile only -PKI_PROFILE="dev" - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -pki::init::ca -pki::issue::subca 1 -pki::issue::subca 2 -pki::issue::end-entity::local vasp1 ../vasp1-csr.json subca1 -pki::issue::end-entity::local vasp2 ../vasp2-csr.json subca1 -pki::issue::end-entity::local vasp3 ../vasp3-csr.json subca2 diff --git a/hack/exec/pki-server.sh b/hack/exec/pki-server.sh deleted file mode 100755 index 8c27b0e..0000000 --- a/hack/exec/pki-server.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -# Force dev profile only -PKI_PROFILE="dev" - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -# pki-dev-init is required, this multirootca is just for local testing purposes. -pki::issue::server subca1 -pki::server diff --git a/hack/exec/pki-testnet.sh b/hack/exec/pki-testnet.sh deleted file mode 100755 index de3affe..0000000 --- a/hack/exec/pki-testnet.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -PKI_PROFILE="testnet" - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -pki::init::ca - -pki::issue::subca 1 -pki::issue::subca 2 - -pki::issue::end-entity::local server ../server-csr.json subca1 - -pki::issue::end-entity::local vasp1 ../vasp1-csr.json subca1 -pki::issue::end-entity::local vasp2 ../vasp2-csr.json subca1 -pki::issue::end-entity::local vasp3 ../vasp3-csr.json subca2 \ No newline at end of file diff --git a/hack/exec/pull-tooling.sh b/hack/exec/pull-tooling.sh deleted file mode 100755 index b628a4a..0000000 --- a/hack/exec/pull-tooling.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -tooling::pull diff --git a/hack/exec/test.sh b/hack/exec/test.sh deleted file mode 100755 index f12c3ea..0000000 --- a/hack/exec/test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -trisa::bazel::exec test //pkg/... \ No newline at end of file diff --git a/hack/exec/travis-build-bootstrap.sh b/hack/exec/travis-build-bootstrap.sh deleted file mode 100755 index 469a347..0000000 --- a/hack/exec/travis-build-bootstrap.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# Dockerized build stage used by Travis - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -tooling::travis::run hack/exec/travis-build.sh - -# Initialize PKI using two subcas and 3 VASPS. -pki::init::ca -pki::issue::subca 1 -pki::issue::subca 2 -pki::issue::end-entity::local vasp1 ../vasp1-csr.json subca1 -pki::issue::end-entity::local vasp2 ../vasp2-csr.json subca1 -pki::issue::end-entity::local vasp3 ../vasp3-csr.json subca2 - -# Demo environment initialization. Ensure no artifacts are cleaned as -# the trisa binary has already been built in the tooling container context. -trisa::demo::init -trisa::demo::vasp::config-gen -trisa::demo::start::vasps - -# Generate some traffic. -curl -ks "https://127.0.0.1:8591/send?target=vasp3:8093" > /dev/null -curl -ks "https://127.0.0.1:8592/send?target=vasp3:8093" > /dev/null -curl -ks "https://127.0.0.1:8593/send?target=vasp1:8091" > /dev/null - -# Dump traffic logs. -echo "*** VASP1 logs ***" -cat artifacts/demo/logs/vasp1.log -echo "*** VASP2 logs ***" -cat artifacts/demo/logs/vasp2.log -echo "*** VASP3 logs ***" -cat artifacts/demo/logs/vasp3.log - -# Cleanup. -trisa::demo::stop::vasps diff --git a/hack/exec/travis-build.sh b/hack/exec/travis-build.sh deleted file mode 100755 index db5c96a..0000000 --- a/hack/exec/travis-build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Dockerized build stage used by Travis - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -# Same as `make all`. -hack/exec/build.sh -hack/exec/test.sh -hack/exec/build-docker.sh - -# Build demo binary for later consumption. -trisa::artifacts::clear -trisa::demo::build diff --git a/hack/exec/travis-publish-bootstrap.sh b/hack/exec/travis-publish-bootstrap.sh deleted file mode 100755 index 2058669..0000000 --- a/hack/exec/travis-publish-bootstrap.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# Dockerized build stage used by Travis - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -tooling::travis::run hack/exec/travis-publish.sh \ No newline at end of file diff --git a/hack/exec/travis-publish.sh b/hack/exec/travis-publish.sh deleted file mode 100755 index 92f7821..0000000 --- a/hack/exec/travis-publish.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# Dockerized build stage used by Travis - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -# The profile has activation rules using TRAVIS_ env vars. -skaffold build \ No newline at end of file diff --git a/hack/exec/travis-tooling-bootstrap.sh b/hack/exec/travis-tooling-bootstrap.sh deleted file mode 100755 index 38d5910..0000000 --- a/hack/exec/travis-tooling-bootstrap.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# Dockerized build stage used by Travis - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" -source "${REPO_ROOT}/hack/lib/init.sh" - -# Build tooling in bazel container context as skaffold is available there. -tooling::travis::run-latest hack/exec/bake-tooling.sh - -# Quick test on the resulting containers. -tooling::test diff --git a/hack/lib/artifacts.sh b/hack/lib/artifacts.sh deleted file mode 100644 index cdf653e..0000000 --- a/hack/lib/artifacts.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -ARTIFACTS=${REPO_ROOT}/artifacts -ARTIFACTS_CLEAR_MODE="clear" - -mkdir -p ${ARTIFACTS} - -trisa::artifacts::clear() { - if [ "${ARTIFACTS_CLEAR_MODE}" == "clear" ]; then - rm -rf ${ARTIFACTS}/* - fi -} diff --git a/hack/lib/bazel.sh b/hack/lib/bazel.sh deleted file mode 100644 index ca60f79..0000000 --- a/hack/lib/bazel.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -trisa::bazel::exec() { - local bin=bazel - if hash bazelisk 2> /dev/null; then - bin=bazelisk - fi - ${bin} "${@}" -} - -trisa::bazel::info::workspace() { - printf $(trisa::bazel::exec info workspace) -} - -trisa::bazel::info::bazel-bin() { - printf $(trisa::bazel::exec info bazel-bin) -} diff --git a/hack/lib/demo.sh b/hack/lib/demo.sh deleted file mode 100644 index 3d9b61d..0000000 --- a/hack/lib/demo.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -DEMO_LOGS=${ARTIFACTS}/demo/logs - -trisa::demo::init() { - - local pki=${REPO_ROOT}/hack/etc/pki/dev/out - - if [ ! -f ${pki}/vasp1.pem ]; then - echo "Run 'make pki-dev-init' first" - exit 1 - fi - - mkdir -p ${ARTIFACTS}/demo/vasp1 - mkdir -p ${ARTIFACTS}/demo/vasp2 - mkdir -p ${ARTIFACTS}/demo/vasp3 - - mkdir -p ${DEMO_LOGS} - - cat ${pki}/root.pem > ${ARTIFACTS}/demo/vasp1/trust.chain - cat ${pki}/subca1.pem >> ${ARTIFACTS}/demo/vasp1/trust.chain - cat ${pki}/subca2.pem >> ${ARTIFACTS}/demo/vasp1/trust.chain - - cp ${ARTIFACTS}/demo/vasp1/trust.chain ${ARTIFACTS}/demo/vasp2/trust.chain - cp ${ARTIFACTS}/demo/vasp1/trust.chain ${ARTIFACTS}/demo/vasp3/trust.chain - - cp -f ${pki}/vasp1.pem ${ARTIFACTS}/demo/vasp1/server.crt - cp -f ${pki}/vasp1-key.pem ${ARTIFACTS}/demo/vasp1/server.key - - cp -f ${pki}/vasp2.pem ${ARTIFACTS}/demo/vasp2/server.crt - cp -f ${pki}/vasp2-key.pem ${ARTIFACTS}/demo/vasp2/server.key - - cp -f ${pki}/vasp3.pem ${ARTIFACTS}/demo/vasp3/server.crt - cp -f ${pki}/vasp3-key.pem ${ARTIFACTS}/demo/vasp3/server.key -} - -trisa::demo::build() { - trisa::bazel::exec build //cmd/trisa - mkdir -p ${ARTIFACTS}/bin - cp -f $(trisa::bazel::info::bazel-bin)/cmd/trisa/${PLATFORM}_amd64_stripped/trisa ${ARTIFACTS}/bin -} - -trisa::demo::vasp::config-gen() { - ${ARTIFACTS}/bin/trisa config generate --path=${ARTIFACTS}/demo/vasp1 --config ${ARTIFACTS}/demo/vasp1/config.yaml --listen=":8091" --listen-admin=":8591" - ${ARTIFACTS}/bin/trisa config generate --path=${ARTIFACTS}/demo/vasp2 --config ${ARTIFACTS}/demo/vasp2/config.yaml --listen=":8092" --listen-admin=":8592" - ${ARTIFACTS}/bin/trisa config generate --path=${ARTIFACTS}/demo/vasp3 --config ${ARTIFACTS}/demo/vasp3/config.yaml --listen=":8093" --listen-admin=":8593" -} - -trisa::demo::vasp::config-gen-docker() { - docker run -it --rm -v ${ARTIFACTS}/demo/vasp1:/etc/trisa trisacrypto/trisa:latest config generate --listen=":8091" --listen-admin=":8591" - docker run -it --rm -v ${ARTIFACTS}/demo/vasp2:/etc/trisa trisacrypto/trisa:latest config generate --listen=":8092" --listen-admin=":8592" - docker run -it --rm -v ${ARTIFACTS}/demo/vasp3:/etc/trisa trisacrypto/trisa:latest config generate --listen=":8093" --listen-admin=":8593" -} - -trisa::demo::start::vasps() { - trisa::demo::stop::vasps - cd ${ARTIFACTS}/demo/vasp1 && ../../bin/trisa server --config config.yaml &> ${DEMO_LOGS}/vasp1.log & - cd ${ARTIFACTS}/demo/vasp2 && ../../bin/trisa server --config config.yaml &> ${DEMO_LOGS}/vasp2.log & - cd ${ARTIFACTS}/demo/vasp3 && ../../bin/trisa server --config config.yaml &> ${DEMO_LOGS}/vasp3.log & - sleep 5 - echo "VASP servers started. Log output can be found under ${ARTIFACTS}/demo/logs" - ls -l ${ARTIFACTS}/demo/logs -} - -trisa::demo::stop::vasps() { - killall trisa &> /dev/null || true -} - -trisa::demo::docker::up() { - docker-compose --project-directory . -f hack/etc/demo/docker-compose.yml up -} - -trisa::demo::docker::down() { - docker-compose --project-directory . -f hack/etc/demo/docker-compose.yml down -} \ No newline at end of file diff --git a/hack/lib/docs.sh b/hack/lib/docs.sh deleted file mode 100644 index b4839de..0000000 --- a/hack/lib/docs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -trisa::docs::dev() { - docker run --rm -it -v ${REPO_ROOT}/docs:/docs -w /docs -p 1313:1313 \ - --user $(id -u) ${TOOLING_GOHUGO} server --bind 0.0.0.0 -} - -trisa::docs::generate() { - docker run --rm -it -v ${REPO_ROOT}/docs:/docs -w /docs \ - --user $(id -u) ${TOOLING_GOHUGO} -} diff --git a/hack/lib/init.sh b/hack/lib/init.sh deleted file mode 100644 index 72605e2..0000000 --- a/hack/lib/init.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)" - -init::get_platform() { - local platform - case "$(uname -s)" in - Linux*) platform=linux;; - Darwin*) platform=darwin;; - *) platform=unknown;; - esac - echo ${platform} -} - -PLATFORM=$(init::get_platform) - -source "${REPO_ROOT}/hack/lib/artifacts.sh" -source "${REPO_ROOT}/hack/lib/bazel.sh" -source "${REPO_ROOT}/hack/lib/docs.sh" -source "${REPO_ROOT}/hack/lib/tooling.sh" -source "${REPO_ROOT}/hack/lib/pki.sh" -source "${REPO_ROOT}/hack/lib/demo.sh" -source "${REPO_ROOT}/hack/lib/kind.sh" diff --git a/hack/lib/kind.sh b/hack/lib/kind.sh deleted file mode 100644 index 1d66855..0000000 --- a/hack/lib/kind.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -set -o nounset -set -o pipefail - -KIND_CLUSTER=kind -KIND_CTX="kind-${KIND_CLUSTER}@kind" -KIND_IMAGE=kindest/node:v1.14.6 -KIND_CONFIG=trisa-cluster-one-worker.yaml - -# Start our local kind k8s cluster. -kind::cluster::start() { - kind create cluster \ - --name ${KIND_CLUSTER} \ - --image ${KIND_IMAGE} \ - --config ${REPO_ROOT}/hack/etc/kind/${KIND_CONFIG} - - # Workaround until skaffold supports newer kind 0.6.0 ctx. When available, we can - # also rename our `kind` cluster to `trisa` as KIND_CLUSTER name. - kubectl config unset contexts.${KIND_CTX} - kubectl config rename-context kind-${KIND_CLUSTER} ${KIND_CTX} - - kubectl config use-context ${KIND_CTX} - kubectl cluster-info -} - -# Destroy our local kind k8s cluster. -kind::cluster::destroy() { - kind delete cluster --name ${KIND_CLUSTER} -} - -# Ensure kubectl context is pointing to kind cluster -kind::ensure-ctx() { - local current=$(kubectl config view -o template --template='{{ index . "current-context" }}') - - if [ "${KIND_CTX}" != "${current}" ]; then - echo "Incorrect kubectl context: '${current}', expecting '${KIND_CTX}'" - exit 1 - fi - - echo "Detected correct kubectl context '${KIND_CTX}'" -} - -# Setup VASP configs collecting the server certificates and private keys and create the trust -# chain for kustomize to be able to pick them up when deploying to k8s. -kind::vasp::prepare-certificates() { - cp hack/etc/pki/dev/out/vasp1.pem hack/etc/k8s/vasps/vasp1/server.crt - cp hack/etc/pki/dev/out/vasp1-key.pem hack/etc/k8s/vasps/vasp1/server.key - - cp hack/etc/pki/dev/out/vasp2.pem hack/etc/k8s/vasps/vasp2/server.crt - cp hack/etc/pki/dev/out/vasp2-key.pem hack/etc/k8s/vasps/vasp2/server.key - - cp hack/etc/pki/dev/out/vasp3.pem hack/etc/k8s/vasps/vasp3/server.crt - cp hack/etc/pki/dev/out/vasp3-key.pem hack/etc/k8s/vasps/vasp3/server.key - - cat hack/etc/pki/dev/out/root.pem > hack/etc/k8s/vasps/vasp1/trust.chain - cat hack/etc/pki/dev/out/subca1.pem >> hack/etc/k8s/vasps/vasp1/trust.chain - cat hack/etc/pki/dev/out/subca2.pem >> hack/etc/k8s/vasps/vasp1/trust.chain - - cp hack/etc/k8s/vasps/vasp1/trust.chain hack/etc/k8s/vasps/vasp2 - cp hack/etc/k8s/vasps/vasp1/trust.chain hack/etc/k8s/vasps/vasp3 -} \ No newline at end of file diff --git a/hack/lib/pki.sh b/hack/lib/pki.sh deleted file mode 100644 index b7641fc..0000000 --- a/hack/lib/pki.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash -# PKI Management for local and testing using the TRISA Testnet - -set -o errexit -set -o nounset -set -o pipefail - -# The PKI_PROFILE defines from which directory the PKI configs are read -# under hack/etc/pki. Defaults to "dev" for local development. -PKI_DIR=${REPO_ROOT}/hack/etc/pki/${PKI_PROFILE:-dev} -PKI_OUT=${PKI_DIR}/out - -# Initialize a new root CA. -pki::init::ca() { - mkdir -p ${PKI_OUT} - rm -rf ${PKI_OUT}/* - - echo "Generating CA from ${PKI_DIR}" - - pki::cfssl::run "cfssl gencert -initca ../root-csr.json | cfssljson -bare root" -} - -# Issue a new issuing CA (aka intermediate/subordinate CA). -pki::issue::subca() { - local number=${1} - - # Generate CSR from template - sed -e "s/%%NAME%%/Issuing CA ${number}/" ${PKI_DIR}/subca-csr.json > ${PKI_OUT}/subca${number}-csr.json - - # Setup API keys and generate config from template - local key=$(pki::generate-key) - echo ${key} > ${PKI_OUT}/subca${number}-key.api - sed -e "s/%%KEY%%/${key}/" ${PKI_DIR}/subca-config.json > ${PKI_OUT}/subca${number}-config.json - - # Generate private key and CSR - pki::cfssl::run "cfssl genkey subca${number}-csr.json | cfssljson -bare subca${number}" - - # Sign CSR from root CA - pki::cfssl::run "cfssl sign -ca root.pem -ca-key root-key.pem --config subca${number}-config.json subca${number}.csr | cfssljson -bare subca${number}" - - # Certificate chain - cat ${PKI_OUT}/subca${number}.pem > ${PKI_OUT}/subca${number}-chain.pem - cat ${PKI_OUT}/root.pem >> ${PKI_OUT}/subca${number}-chain.pem - - # Attach profle to server - cat << EOF >> ${PKI_OUT}/server.ini -[subca${number}] -private = file://subca${number}-key.pem -certificate = subca${number}.pem -config = subca${number}-config.json -EOF -} - -# Issue server certificate -pki::issue::server() { - local subca=${1} - - pki::cfssl::run "cfssl genkey ../server-csr.json | cfssljson -bare server" - pki::cfssl::run "cfssl sign -ca ${subca}.pem -ca-key ${subca}-key.pem --config ../end-entity-config.json server.csr | cfssljson -bare server" -} - -# Issue end-entity certicate locally -pki::issue::end-entity::local() { - local name=${1} - local csr=${2} - local subca=${3} - - pki::cfssl::run "cfssl genkey ${csr} | cfssljson -bare ${name}" - pki::cfssl::run "cfssl sign -ca ${subca}.pem -ca-key ${subca}-key.pem --config ../end-entity-config.json ${name}.csr | cfssljson -bare ${name}" -} - -pki::issue::end-entity::remote() { - echo "not implemented" -} - -# Run a local cfssl server using multirootca config. This requires the server keys to be generated to secure the key exchange. -pki::server() { - pki::cfssl::run "multirootca -a 0.0.0.0:8765 -roots server.ini -tls-cert server.pem -tls-key server-key.pem" "--name cfssl-server -p 8765:8765" -} - -# Generate random 16 bytes hex string -pki::generate-key() { - echo $(hexdump -n 16 -e '4/4 "%08X" ' /dev/random) -} - -# Wrapper running cfssl through docker. -pki::cfssl::run() { - local cmd=${1} - local dopts=${2:-} - - docker run -it --rm --user $(id -u):$(id -g) ${dopts} \ - -v ${PKI_DIR}:/ca -w /ca/out \ - ${TOOLING_CFSSL} /bin/bash -c "${cmd}" -} diff --git a/hack/lib/tooling.sh b/hack/lib/tooling.sh deleted file mode 100644 index 4e3f337..0000000 --- a/hack/lib/tooling.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -# Build logic for dockerized tooling. - -set -o errexit -set -o nounset -set -o pipefail - -# Reference list of dockerized tools -TOOLING_GOHUGO=trisacrypto/tooling:gohugo -TOOLING_CFSSL=trisacrypto/tooling:cfssl -TOOLING_BAZEL=trisacrypto/tooling:bazel - -# Switch to PR built images when running in non-fork pull_request mode on Travis. -# This will use the newly built images to test the CI execution. -TRAVIS_PULL_REQUEST_SLUG=${TRAVIS_PULL_REQUEST_SLUG:-} -if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "trisacrypto/trisa" ]; then - TOOLING_GOHUGO=${TOOLING_GOHUGO}-pr-${TRAVIS_PULL_REQUEST} - TOOLING_CFSSL=${TOOLING_CFSSL}-pr-${TRAVIS_PULL_REQUEST} - TOOLING_BAZEL=${TOOLING_BAZEL}-pr-${TRAVIS_PULL_REQUEST} -fi - -# Bake all dockerized tooling -tooling::bake() { - for dir in $(find ${REPO_ROOT}/hack/tooling -type d -mindepth 1); do - tooling::skaffold ${dir} - done -} - -# Force a docker pull for all tooling. -# TODO: We should use explicit version tags instead and track the state in hack/etc. -tooling::pull() { - docker pull ${TOOLING_GOHUGO} - docker pull ${TOOLING_CFSSL} - docker pull ${TOOLING_BAZEL} -} - -# Some testing to make sure our tooling containers work. -tooling::test() { - echo "gohugo --> $(docker run -it --rm ${TOOLING_GOHUGO} version)" - echo "cfssl --> $(docker run -it --rm ${TOOLING_CFSSL} cfssl version)" - echo "skaffold --> $(tooling::travis::run skaffold version)" - tooling::travis::run bazel info -} - -# Build image using skaffold -tooling::skaffold() { - local dir=${1} - - if [ ! -f "${dir}/skaffold.yaml" ]; then - echo "no skaffold.yaml found in ${dir}" - return - fi - - cd ${dir} && skaffold build -} - -# Travis dockerized Bazel environment -tooling::travis::run() { - - local args="" - local bazelrc=".bazelrc-travis" - - # Attach docker credentials if injected from Travis. - if [ -f "/home/travis/.docker/config.json" ]; then - args="${args} -v /home/travis/.docker/config.json:/home/bazel/.docker/config.json" - fi - - # Google Credentials if injected from Travis. - if [ ! -z "${GOOGLE_CREDENTIALS:-}" ]; then - echo ${GOOGLE_CREDENTIALS} > .remote-cache-sa.json - bazelrc=".bazelrc-travis-cache" - fi - - # Pass TRAVIS_ env vars to container. - env | grep TRAVIS_ > travis.env || cat /dev/null > travis.env - - docker run --rm -it ${args} \ - -w /workspace \ - -v $(pwd):/workspace \ - -v $(pwd)/${bazelrc}:/home/bazel/.bazelrc \ - -v /var/run/docker.sock:/var/run/docker.sock \ - --env-file travis.env \ - ${TOOLING_BAZEL} -c "${*}" - - # Cleanup remote cache secret if any - if [ -f ".remote-cache-sa.json" ]; then - rm -f .remote-cache-sa.json - fi - - # Cleanup travis.env file - if [ -f "travis.env" ]; then - rm -f travis.env - fi -} - -# Runs latest travis tooling context regardless of TRAVIS PR overrides. -tooling::travis::run-latest() { - local restore=${TOOLING_BAZEL} - TOOLING_BAZEL=trisacrypto/tooling:bazel - tooling::travis::run ${*} - TOOLING_BAZEL=${restore} -} diff --git a/hack/tooling/bazel/Dockerfile b/hack/tooling/bazel/Dockerfile deleted file mode 100644 index 98618f8..0000000 --- a/hack/tooling/bazel/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update && apt-get install -y \ - # Generic requirements - curl bash git \ - # Bazel requirements - pkg-config zip g++ zlib1g-dev unzip python3 \ - # Docker requirements - apt-transport-https ca-certificates gnupg-agent software-properties-common \ - # Cleanup - && rm -rf /var/lib/apt/lists/* - -# Docker CE -RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ - && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ - && apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io \ - && rm -rf /var/lib/apt/lists/* - -# Bazel -ARG BAZEL_RELEASE -RUN curl -Lso /usr/local/bazel-installer.sh \ - https://github.com/bazelbuild/bazel/releases/download/${BAZEL_RELEASE}/bazel-${BAZEL_RELEASE}-installer-linux-x86_64.sh \ - && chmod +x /usr/local/bazel-installer.sh \ - && /usr/local/bazel-installer.sh \ - && rm /usr/local/bazel-installer.sh \ - && ln -s /usr/bin/python3 /usr/local/bin/python - -# Skaffold -ARG SKAFFOLD_RELEASE -RUN curl -Lso /usr/local/bin/skaffold https://storage.googleapis.com/skaffold/releases/${SKAFFOLD_RELEASE}/skaffold-linux-amd64 \ - && chmod +x /usr/local/bin/skaffold - -# Setup bazel user -RUN useradd -u 2000 -m -g docker -s /bin/bash bazel -USER bazel - -WORKDIR /workspace - -ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file diff --git a/hack/tooling/bazel/skaffold.yaml b/hack/tooling/bazel/skaffold.yaml deleted file mode 100644 index e640477..0000000 --- a/hack/tooling/bazel/skaffold.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: skaffold/v1 -kind: Config -metadata: - name: bazel -build: - artifacts: - - image: trisacrypto/tooling - context: . - docker: - dockerfile: Dockerfile - buildArgs: - BAZEL_RELEASE: 2.2.0 - SKAFFOLD_RELEASE: latest - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:bazel-dev' - local: - push: false -profiles: -- name: travis-pr - activation: - - env: TRAVIS_EVENT_TYPE=pull_request - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:bazel-pr-{{.TRAVIS_PULL_REQUEST}}' - local: - push: true -- name: travis-push - activation: - - env: TRAVIS_EVENT_TYPE=push - - env: TRAVIS_EVENT_TYPE=cron - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:bazel' - local: - push: true \ No newline at end of file diff --git a/hack/tooling/cfssl/Dockerfile b/hack/tooling/cfssl/Dockerfile deleted file mode 100644 index a5a2c7e..0000000 --- a/hack/tooling/cfssl/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM debian:stable-slim - -RUN groupadd -r nonroot && useradd -m -g nonroot -s /bin/bash nonroot - -RUN apt-get update && apt-get install -y curl \ - && rm -rf /var/lib/apt/lists/* - -ARG CFSSL_RELEASE -RUN curl -Ls -o /bin/cfssl https://github.com/cloudflare/cfssl/releases/download/v${CFSSL_RELEASE}/cfssl_${CFSSL_RELEASE}_linux_amd64 && chmod +x /bin/cfssl -RUN curl -Ls -o /bin/cfssljson https://github.com/cloudflare/cfssl/releases/download/v${CFSSL_RELEASE}/cfssljson_${CFSSL_RELEASE}_linux_amd64 && chmod +x /bin/cfssljson -RUN curl -Ls -o /bin/multirootca https://github.com/cloudflare/cfssl/releases/download/v${CFSSL_RELEASE}/multirootca_${CFSSL_RELEASE}_linux_amd64 && chmod +x /bin/multirootca - -USER nonroot diff --git a/hack/tooling/cfssl/skaffold.yaml b/hack/tooling/cfssl/skaffold.yaml deleted file mode 100644 index 32b5d55..0000000 --- a/hack/tooling/cfssl/skaffold.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: skaffold/v1 -kind: Config -metadata: - name: cfssl -build: - artifacts: - - image: trisacrypto/tooling - context: . - docker: - dockerfile: Dockerfile - buildArgs: - CFSSL_RELEASE: 1.4.1 - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:cfssl-dev' - local: - push: false -profiles: -- name: travis-pr - activation: - - env: TRAVIS_EVENT_TYPE=pull_request - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:cfssl-pr-{{.TRAVIS_PULL_REQUEST}}' - local: - push: true -- name: travis-push - activation: - - env: TRAVIS_EVENT_TYPE=push - - env: TRAVIS_EVENT_TYPE=cron - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:cfssl' - local: - push: true \ No newline at end of file diff --git a/hack/tooling/gohugo/Dockerfile b/hack/tooling/gohugo/Dockerfile deleted file mode 100644 index 3230f00..0000000 --- a/hack/tooling/gohugo/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM alpine:latest - -RUN apk --no-cache add curl -RUN addgroup -g 1001 -S nonroot && adduser -u 1001 -S nonroot -G nonroot - -ARG GOHUGO_RELEASE -RUN curl -Ls https://github.com/gohugoio/hugo/releases/download/v${GOHUGO_RELEASE}/hugo_${GOHUGO_RELEASE}_Linux-64bit.tar.gz | tar xvz -C /bin hugo - -USER nonroot - -ENTRYPOINT [ "hugo" ] \ No newline at end of file diff --git a/hack/tooling/gohugo/skaffold.yaml b/hack/tooling/gohugo/skaffold.yaml deleted file mode 100644 index 0b50286..0000000 --- a/hack/tooling/gohugo/skaffold.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: skaffold/v1 -kind: Config -metadata: - name: gohugo -build: - artifacts: - - image: trisacrypto/tooling - context: . - docker: - dockerfile: Dockerfile - buildArgs: - GOHUGO_RELEASE: 0.61.0 - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:gohugo-dev' - local: - push: false -profiles: -- name: travis-pr - activation: - - env: TRAVIS_EVENT_TYPE=pull_request - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:gohugo-pr-{{.TRAVIS_PULL_REQUEST}}' - local: - push: true -- name: travis-push - activation: - - env: TRAVIS_EVENT_TYPE=push - - env: TRAVIS_EVENT_TYPE=cron - build: - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:gohugo' - local: - push: true \ No newline at end of file diff --git a/pkg/ca/BUILD.bazel b/pkg/ca/BUILD.bazel deleted file mode 100644 index dd27eae..0000000 --- a/pkg/ca/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["util.go"], - importpath = "github.com/trisacrypto/trisa/pkg/ca", - visibility = ["//visibility:public"], -) diff --git a/pkg/ca/util.go b/pkg/ca/util.go deleted file mode 100644 index aa122c2..0000000 --- a/pkg/ca/util.go +++ /dev/null @@ -1,86 +0,0 @@ -package ca - -import ( - "bytes" - "crypto/rand" - "crypto/rsa" - "crypto/sha256" - "crypto/x509" - "crypto/x509/pkix" - "encoding/hex" - "encoding/pem" - "fmt" -) - -func PEMEncodePrivateKey(key interface{}) ([]byte, error) { - pkcs8, err := x509.MarshalPKCS8PrivateKey(key) - if err != nil { - return nil, err - } - - var b bytes.Buffer - if err := pem.Encode(&b, &pem.Block{Type: "PRIVATE KEY", Bytes: pkcs8}); err != nil { - return nil, err - } - - return b.Bytes(), nil -} - -func PEMEncodeCertificate(c *x509.Certificate) ([]byte, error) { - var b bytes.Buffer - if err := pem.Encode(&b, &pem.Block{Type: "CERTIFICATE", Bytes: c.Raw}); err != nil { - return nil, err - } - - return b.Bytes(), nil -} - -func PEMDecodeCertificate(in []byte) (*x509.Certificate, error) { - block, _ := pem.Decode(in) - if block == nil { - return nil, fmt.Errorf("error decoding pem certificate") - } - return x509.ParseCertificate(block.Bytes) -} - -func PEMEncodeCSR(c *x509.CertificateRequest) ([]byte, error) { - var b bytes.Buffer - if err := pem.Encode(&b, &pem.Block{Type: "CERTIFICATE REQUEST", Bytes: c.Raw}); err != nil { - return nil, err - } - - return b.Bytes(), nil -} - -func PEMDecodeCSR(in []byte) (*x509.CertificateRequest, error) { - block, _ := pem.Decode(in) - if block == nil { - return nil, fmt.Errorf("error decoding pem certificate") - } - return x509.ParseCertificateRequest(block.Bytes) -} - -func GenerateRSAPrivateKey(bits int) (*rsa.PrivateKey, error) { - return rsa.GenerateKey(rand.Reader, bits) -} - -func CreateCSR(subject pkix.Name, key interface{}) ([]byte, error) { - tpl := &x509.CertificateRequest{ - Subject: subject, - SignatureAlgorithm: x509.SHA512WithRSA, - } - csrDER, err := x509.CreateCertificateRequest(rand.Reader, tpl, key) - if err != nil { - return nil, err - } - csr, err := x509.ParseCertificateRequest(csrDER) - if err != nil { - return nil, err - } - return PEMEncodeCSR(csr) -} - -func Sha256Fingerprint(c *x509.Certificate) string { - sum := sha256.Sum256(c.Raw) - return hex.EncodeToString(sum[:]) -} diff --git a/pkg/trisa/config/BUILD.bazel b/pkg/trisa/config/BUILD.bazel deleted file mode 100644 index 50accd7..0000000 --- a/pkg/trisa/config/BUILD.bazel +++ /dev/null @@ -1,9 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["config.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/config", - visibility = ["//visibility:public"], - deps = ["@in_gopkg_yaml_v2//:go_default_library"], -) diff --git a/pkg/trisa/config/config.go b/pkg/trisa/config/config.go deleted file mode 100644 index b964e31..0000000 --- a/pkg/trisa/config/config.go +++ /dev/null @@ -1,56 +0,0 @@ -package config - -import ( - "io/ioutil" - "os" - - "gopkg.in/yaml.v2" -) - -// Config represents the Trisa Server configuration. -type Config struct { - TLS *TLS `yaml:"tls,omitempty"` - Server *Server `yaml:"server,omitempty"` - Wallets map[string]*Wallet `yaml:"wallets,omitempty"` -} - -type TLS struct { - PrivateKeyFile string `yaml:"privateKeyFile,omitempty"` - CertificateFile string `yaml:"certificateFile,omitempty"` - TrustChainFile string `yaml:"trustChain,omitempty"` -} - -type Server struct { - ListenAddress string `yaml:"listenAddress,omitempty"` - ListenAddressAdmin string `yaml:"listenAddressAdmin,omitempty"` - Hostname string `yaml:"hostname,omitempty"` -} - -type Wallet struct { - FirstName string - LastName string -} - -func FromFile(file string) (*Config, error) { - data, err := ioutil.ReadFile(file) - if err != nil { - return nil, err - } - - var c Config - - err = yaml.UnmarshalStrict(data, &c) - if err != nil { - return nil, err - } - - return &c, nil -} - -func (c *Config) Save(file string) error { - out, err := yaml.Marshal(c) - if err != nil { - return err - } - return ioutil.WriteFile(file, out, os.ModePerm) -} diff --git a/pkg/trisa/crypto/BUILD.bazel b/pkg/trisa/crypto/BUILD.bazel deleted file mode 100644 index 887f044..0000000 --- a/pkg/trisa/crypto/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["crypto.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/crypto", - visibility = ["//visibility:public"], -) diff --git a/pkg/trisa/crypto/aesgcm/BUILD.bazel b/pkg/trisa/crypto/aesgcm/BUILD.bazel deleted file mode 100644 index 6de1d13..0000000 --- a/pkg/trisa/crypto/aesgcm/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["aesgcm.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/crypto/aesgcm", - visibility = ["//visibility:public"], - deps = ["//pkg/trisa/crypto:go_default_library"], -) - -go_test( - name = "go_default_test", - srcs = ["aesgcm_test.go"], - embed = [":go_default_library"], - deps = ["@com_github_stretchr_testify//assert:go_default_library"], -) diff --git a/pkg/trisa/crypto/aesgcm/aesgcm.go b/pkg/trisa/crypto/aesgcm/aesgcm.go deleted file mode 100644 index 8f84b8f..0000000 --- a/pkg/trisa/crypto/aesgcm/aesgcm.go +++ /dev/null @@ -1,104 +0,0 @@ -package aesgcm - -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "crypto/hmac" - "crypto/sha256" - "errors" - "fmt" - - "github.com/trisacrypto/trisa/pkg/trisa/crypto" -) - -// return vals -// * cipher text -// * cipher secret (encrypted secret using pub key of receiver) -// * hmac signature -// * hmac secret (encrypted secret using pub key of receiver) -func Encrypt(plainText []byte) ([]byte, []byte, []byte, []byte, error) { - - key, err := crypto.GenRandom(32) - if err != nil { - return nil, nil, nil, nil, err - } - - block, err := aes.NewCipher(key) - if err != nil { - return nil, nil, nil, nil, err - } - - aesgcm, err := cipher.NewGCM(block) - if err != nil { - return nil, nil, nil, nil, err - } - - nonce, err := crypto.GenRandom(12) - if err != nil { - return nil, nil, nil, nil, err - } - - cipherText := aesgcm.Seal(nil, nonce, plainText, nil) - - sig, err := createHMAC(key, cipherText) - if err != nil { - return nil, nil, nil, nil, err - } - - cipherText = append(cipherText, nonce...) - - return cipherText, key, sig, key, nil -} - -// Decrypt validates mac and returns decoded data. -func Decrypt(cipherText, sig, key []byte) ([]byte, error) { - - if len(cipherText) == 0 { - return nil, errors.New("empty cipher text") - } - - data := cipherText[:len(cipherText)-12] - nonce := cipherText[len(cipherText)-12:] - - if err := validateHMAC(key, data, sig); err != nil { - return nil, err - } - - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - aesgcm, err := cipher.NewGCM(block) - if err != nil { - return nil, err - } - - plainText, err := aesgcm.Open(nil, nonce, data, nil) - if err != nil { - return nil, err - } - - return plainText, nil -} - -func createHMAC(key, data []byte) ([]byte, error) { - if len(data) == 0 { - return nil, fmt.Errorf("empty data") - } - hm := hmac.New(sha256.New, key) - hm.Write(data) - return hm.Sum(nil), nil -} - -func validateHMAC(key, data, sig []byte) error { - hm := hmac.New(sha256.New, key) - hm.Write(data) - - if !bytes.Equal(sig, hm.Sum(nil)) { - return fmt.Errorf("hmac mismatch") - } - - return nil -} diff --git a/pkg/trisa/crypto/aesgcm/aesgcm_test.go b/pkg/trisa/crypto/aesgcm/aesgcm_test.go deleted file mode 100644 index 9209027..0000000 --- a/pkg/trisa/crypto/aesgcm/aesgcm_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package aesgcm - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHandler(t *testing.T) { - - plainText := []byte("thisbetterworks") - cipherText, key, sig, _, err := Encrypt(plainText) - - assert.NoError(t, err) - - newPlain, err := Decrypt(cipherText, sig, key) - assert.NoError(t, err) - - assert.Equal(t, plainText, newPlain) -} diff --git a/pkg/trisa/crypto/crypto.go b/pkg/trisa/crypto/crypto.go deleted file mode 100644 index d5a7306..0000000 --- a/pkg/trisa/crypto/crypto.go +++ /dev/null @@ -1,19 +0,0 @@ -package crypto - -import "crypto/rand" - -type Handler interface { - Encrypt() - Decrypt() - Sign() - Verify() -} - -func GenRandom(n int) ([]byte, error) { - b := make([]byte, n) - _, err := rand.Read(b) - if err != nil { - return nil, err - } - return b, nil -} diff --git a/pkg/trisa/crypto/rsa/BUILD.bazel b/pkg/trisa/crypto/rsa/BUILD.bazel deleted file mode 100644 index 28ffe62..0000000 --- a/pkg/trisa/crypto/rsa/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "go_default_library", - srcs = ["rsa.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/crypto/rsa", - visibility = ["//visibility:public"], -) - -go_test( - name = "go_default_test", - srcs = ["rsa_test.go"], - embed = [":go_default_library"], - deps = ["@com_github_stretchr_testify//assert:go_default_library"], -) diff --git a/pkg/trisa/crypto/rsa/rsa.go b/pkg/trisa/crypto/rsa/rsa.go deleted file mode 100644 index 425e56f..0000000 --- a/pkg/trisa/crypto/rsa/rsa.go +++ /dev/null @@ -1,25 +0,0 @@ -package rsa - -import ( - "crypto/rand" - "crypto/rsa" - "crypto/sha512" -) - -func Encrypt(data []byte, pub *rsa.PublicKey) ([]byte, error) { - hash := sha512.New() - cipherText, err := rsa.EncryptOAEP(hash, rand.Reader, pub, data, nil) - if err != nil { - return nil, err - } - return cipherText, nil -} - -func Decrypt(cipherText []byte, priv *rsa.PrivateKey) ([]byte, error) { - hash := sha512.New() - plainText, err := rsa.DecryptOAEP(hash, rand.Reader, priv, cipherText, nil) - if err != nil { - return nil, err - } - return plainText, nil -} diff --git a/pkg/trisa/crypto/rsa/rsa_test.go b/pkg/trisa/crypto/rsa/rsa_test.go deleted file mode 100644 index db0cfb8..0000000 --- a/pkg/trisa/crypto/rsa/rsa_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package rsa - -import ( - "crypto/rand" - "crypto/rsa" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestHandler(t *testing.T) { - - privkey, _ := rsa.GenerateKey(rand.Reader, 4096) - plainText := []byte("encryptthisstuffplease") - - cipherText, err := Encrypt(plainText, &privkey.PublicKey) - assert.NoError(t, err) - - newPlain, err := Decrypt(cipherText, privkey) - assert.NoError(t, err) - - assert.Equal(t, plainText, newPlain) -} diff --git a/pkg/trisa/handler/BUILD.bazel b/pkg/trisa/handler/BUILD.bazel deleted file mode 100644 index f88d3f0..0000000 --- a/pkg/trisa/handler/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "context.go", - "demo.go", - ], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/handler", - visibility = ["//visibility:public"], - deps = [ - "//proto/trisa/identity/be/v1alpha1:go_default_library", - "//proto/trisa/protocol/v1alpha1:go_default_library", - "@com_github_golang_protobuf//ptypes:go_default_library_gen", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - "@org_golang_google_grpc//peer:go_default_library", - ], -) diff --git a/pkg/trisa/handler/context.go b/pkg/trisa/handler/context.go deleted file mode 100644 index f93385b..0000000 --- a/pkg/trisa/handler/context.go +++ /dev/null @@ -1,20 +0,0 @@ -package handler - -import "context" - -type contextKey string - -var ( - contextKeyClientSide = contextKey("client-side") -) - -func WithClientSide(ctx context.Context) context.Context { - return context.WithValue(ctx, contextKeyClientSide, true) -} - -func HasClientSideFromContext(ctx context.Context) bool { - if _, ok := ctx.Value(contextKeyClientSide).(bool); ok { - return true - } - return false -} diff --git a/pkg/trisa/handler/demo.go b/pkg/trisa/handler/demo.go deleted file mode 100644 index 4561ae7..0000000 --- a/pkg/trisa/handler/demo.go +++ /dev/null @@ -1,90 +0,0 @@ -package handler - -import ( - "context" - "fmt" - - "github.com/golang/protobuf/ptypes" - log "github.com/sirupsen/logrus" - be "github.com/trisacrypto/trisa/proto/trisa/identity/be/v1alpha1" - pb "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/peer" -) - -func NewDemoHandler() *Demo { - return &Demo{} -} - -type Demo struct { -} - -func (d *Demo) HandleRequest(ctx context.Context, id string, req *pb.TransactionData) (*pb.TransactionData, error) { - - if HasClientSideFromContext(ctx) { - identityType, _ := ptypes.AnyMessageName(req.Identity) - var identityData ptypes.DynamicAny - ptypes.UnmarshalAny(req.Identity, &identityData) - - log.WithFields(log.Fields{ - "identity-type": identityType, - "identity": fmt.Sprintf("%v", identityData), - }).Infof("received transaction confirmation for %s", id) - return nil, fmt.Errorf("EOL") - } - - p, ok := peer.FromContext(ctx) - if !ok { - return nil, fmt.Errorf("no peer found") - } - - tlsAuth, ok := p.AuthInfo.(credentials.TLSInfo) - if !ok { - return nil, fmt.Errorf("unexpected peer transport credentials") - } - - if len(tlsAuth.State.VerifiedChains) == 0 || len(tlsAuth.State.VerifiedChains[0]) == 0 { - return nil, fmt.Errorf("could not verify peer certificate") - } - - // Extract identity - identityType, _ := ptypes.AnyMessageName(req.Identity) - var identityData ptypes.DynamicAny - ptypes.UnmarshalAny(req.Identity, &identityData) - - // Extract network information - networkType, _ := ptypes.AnyMessageName(req.Data) - var networkData ptypes.DynamicAny - ptypes.UnmarshalAny(req.Data, &networkData) - - cn := tlsAuth.State.VerifiedChains[0][0].Subject.CommonName - log.WithFields(log.Fields{ - "identity-type": identityType, - "network-type": networkType, - "identity": fmt.Sprintf("%v", identityData), - "network": fmt.Sprintf("%v", networkData), - }).Infof("received transaction %s from %s", id, cn) - - // Generate demo response - identityResp := &be.Identity{ - FirstName: "Jane", - LastName: "Foe", - NationalNumber: "109-800211-69", - CityOfBirth: "Zwevezele", - } - identityRespSer, _ := ptypes.MarshalAny(identityResp) - - tData := &pb.TransactionData{ - Identity: identityRespSer, - } - - // Extract identity - identityType, _ = ptypes.AnyMessageName(identityRespSer) - - log.WithFields(log.Fields{ - "identity-type": identityType, - "identity": fmt.Sprintf("%v", identityResp), - }).Infof("sent transaction response for %s to %s", id, cn) - - return tData, nil -} diff --git a/pkg/trisa/protocol/BUILD.bazel b/pkg/trisa/protocol/BUILD.bazel deleted file mode 100644 index 9d74db1..0000000 --- a/pkg/trisa/protocol/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["protocol.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/protocol", - visibility = ["//visibility:public"], - deps = [ - "//pkg/trisa/crypto/aesgcm:go_default_library", - "//proto/trisa/protocol/v1alpha1:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - ], -) diff --git a/pkg/trisa/protocol/protocol.go b/pkg/trisa/protocol/protocol.go deleted file mode 100644 index 80a9f27..0000000 --- a/pkg/trisa/protocol/protocol.go +++ /dev/null @@ -1,46 +0,0 @@ -package protocol - -import ( - "context" - - "github.com/golang/protobuf/proto" - "github.com/trisacrypto/trisa/pkg/trisa/crypto/aesgcm" - pb "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1" -) - -func DecodeTransaction(ctx context.Context, t *pb.Transaction) (*pb.TransactionData, error) { - - plain, err := aesgcm.Decrypt(t.Transaction, t.Hmac, t.EncryptionKey) - if err != nil { - return nil, err - } - - td := &pb.TransactionData{} - if err := proto.Unmarshal(plain, td); err != nil { - return nil, err - } - return td, nil -} - -func EncodeTransactionData(ctx context.Context, id string, td *pb.TransactionData) (*pb.Transaction, error) { - serialized, err := proto.Marshal(td) - if err != nil { - return nil, err - } - - cipherText, key, sig, _, err := aesgcm.Encrypt(serialized) - if err != nil { - return nil, err - } - - t := &pb.Transaction{ - Id: id, - Transaction: cipherText, - EncryptionKey: key, - EncryptionAlgorithm: "AES256_GCM", - Hmac: sig, - HmacSecret: key, - HmacAlgorithm: "HMAC_SHA256", - } - return t, nil -} diff --git a/pkg/trisa/server/BUILD.bazel b/pkg/trisa/server/BUILD.bazel deleted file mode 100644 index b40a050..0000000 --- a/pkg/trisa/server/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["server.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/server", - visibility = ["//visibility:public"], - deps = [ - "//pkg/trisa/handler:go_default_library", - "//pkg/trisa/protocol:go_default_library", - "//proto/trisa/protocol/v1alpha1:go_default_library", - "@com_github_golang_protobuf//ptypes:go_default_library_gen", - "@com_github_sirupsen_logrus//:go_default_library", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//credentials:go_default_library", - ], -) diff --git a/pkg/trisa/server/server.go b/pkg/trisa/server/server.go deleted file mode 100644 index c130685..0000000 --- a/pkg/trisa/server/server.go +++ /dev/null @@ -1,201 +0,0 @@ -package server - -import ( - "context" - "crypto/tls" - "crypto/x509" - "fmt" - "io" - "net/url" - - "github.com/golang/protobuf/ptypes" - log "github.com/sirupsen/logrus" - "github.com/trisacrypto/trisa/pkg/trisa/handler" - "github.com/trisacrypto/trisa/pkg/trisa/protocol" - pb "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" -) - -type Handler interface { - HandleRequest(ctx context.Context, id string, td *pb.TransactionData) (*pb.TransactionData, error) -} - -func New(h Handler, c tls.Certificate, cp *x509.CertPool) *Server { - return &Server{ - handler: h, - cert: c, - certPool: cp, - streams: make(map[string]pb.TrisaPeer2Peer_TransactionStreamClient), - } -} - -type Server struct { - handler Handler - cert tls.Certificate - certPool *x509.CertPool - - streams map[string]pb.TrisaPeer2Peer_TransactionStreamClient -} - -func (s *Server) getClient(target string) (pb.TrisaPeer2Peer_TransactionStreamClient, error) { - - if stream, found := s.streams[target]; found { - return stream, nil - } - - u, _ := url.Parse(target) - - tls := credentials.NewTLS(&tls.Config{ - ServerName: u.Host, - Certificates: []tls.Certificate{s.cert}, - RootCAs: s.certPool, - }) - - conn, err := grpc.Dial(target, grpc.WithTransportCredentials(tls)) - if err != nil { - return nil, err - } - - client := pb.NewTrisaPeer2PeerClient(conn) - stream, err := client.TransactionStream(context.Background()) - if err != nil { - return nil, err - } - - s.streams[target] = stream - return stream, nil -} - -func (s *Server) SendRequest(ctx context.Context, target, id string, td *pb.TransactionData) error { - - ctx = handler.WithClientSide(ctx) - - t, err := protocol.EncodeTransactionData(ctx, id, td) - if err != nil { - return err - } - - stream, err := s.getClient(target) - - if err != nil { - return err - } - - if err := stream.Send(t); err != nil { - return err - } - - // Extract identity - identityType, _ := ptypes.AnyMessageName(td.Identity) - var identityData ptypes.DynamicAny - ptypes.UnmarshalAny(td.Identity, &identityData) - - // Extract network information - networkType, _ := ptypes.AnyMessageName(td.Data) - var networkData ptypes.DynamicAny - ptypes.UnmarshalAny(td.Data, &networkData) - - log.WithFields(log.Fields{ - "identity-type": identityType, - "network-type": networkType, - "identity": fmt.Sprintf("%v", identityData), - "network": fmt.Sprintf("%v", networkData), - }).Infof("sent transaction %s to %v", id, target) - - resp, err := stream.Recv() - if err == io.EOF { - return fmt.Errorf("premature stream exit") - } - if err != nil { - return fmt.Errorf("receive stream error: %v", err) - } - - _, err = s.handle(ctx, resp) - if err != nil && err.Error() != "EOL" { - return fmt.Errorf("response stream error: %v", err) - } - - return nil -} - -func (s *Server) TransactionStream(srv pb.TrisaPeer2Peer_TransactionStreamServer) error { - - ctx := srv.Context() - - for { - - select { - case <-ctx.Done(): - return ctx.Err() - default: - } - - req, err := srv.Recv() - if err == io.EOF { - log.Info("stream exit") - return nil - } - if err != nil { - log.Warnf("receive stream error: %v", err) - continue - } - - resp, err := s.handle(ctx, req) - if err != nil && err.Error() == "EOL" { - continue - } - if err != nil { - log.Warnf("response stream error: %v", err) - } - - if err := srv.Send(resp); err != nil { - log.Warnf("send stream error: %v", err) - } - } - return nil -} - -func (s *Server) handle(ctx context.Context, req *pb.Transaction) (*pb.Transaction, error) { - - log.WithFields(log.Fields{ - "direction": "incoming", - "enc_blob": req.Transaction, - "enc_algo": req.EncryptionAlgorithm, - "hmac": req.Hmac, - "hmac_algo": req.HmacAlgorithm, - }).Infof("protocol envelope for incomingtransaction %s", req.Id) - - if req.Id == "" { - return nil, fmt.Errorf("empty transaction identifier") - } - - reqTransactionData, err := protocol.DecodeTransaction(ctx, req) - if err != nil { - return nil, fmt.Errorf("decode request: %v", err) - } - - resTransactionData, err := s.handler.HandleRequest(ctx, req.Id, reqTransactionData) - if err != nil && err.Error() == "EOL" { - return nil, err - } - - if err != nil { - return nil, fmt.Errorf("transaction request handler request: %s", err) - } - - res, err := protocol.EncodeTransactionData(ctx, req.Id, resTransactionData) - if err != nil { - return nil, fmt.Errorf("encode response: %v", err) - } - - log.WithFields(log.Fields{ - "direction": "outgoing", - "enc_blob": res.Transaction, - "enc_algo": res.EncryptionAlgorithm, - "hmac": res.Hmac, - "hmac_algo": res.HmacAlgorithm, - }).Infof("protocol envelope for incomingtransaction %s", res.Id) - - return res, nil -} diff --git a/pkg/trisa/trust/BUILD.bazel b/pkg/trisa/trust/BUILD.bazel deleted file mode 100644 index e0353e4..0000000 --- a/pkg/trisa/trust/BUILD.bazel +++ /dev/null @@ -1,8 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["provider.go"], - importpath = "github.com/trisacrypto/trisa/pkg/trisa/trust", - visibility = ["//visibility:public"], -) diff --git a/pkg/trisa/trust/provider.go b/pkg/trisa/trust/provider.go deleted file mode 100644 index 5dca6d0..0000000 --- a/pkg/trisa/trust/provider.go +++ /dev/null @@ -1,42 +0,0 @@ -package trust - -import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" -) - -type Provider struct { - chain tls.Certificate -} - -func NewProvider(chain []byte) *Provider { - p := &Provider{} - p.AddChain(chain) - return p -} - -func (p *Provider) AddChain(in []byte) { - var block *pem.Block - for { - block, in = pem.Decode(in) - if block == nil { - break - } - if block.Type == "CERTIFICATE" { - p.chain.Certificate = append(p.chain.Certificate, block.Bytes) - } - } -} - -func (p *Provider) GetCertPool() *x509.CertPool { - pool := x509.NewCertPool() - for _, c := range p.chain.Certificate { - x509Cert, err := x509.ParseCertificate(c) - if err != nil { - panic(err) - } - pool.AddCert(x509Cert) - } - return pool -} diff --git a/proto/BUILD.bazel b/proto/BUILD.bazel deleted file mode 100644 index f87777e..0000000 --- a/proto/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ -# gazelle:proto default diff --git a/proto/ivms101/BUILD.bazel b/proto/ivms101/BUILD.bazel deleted file mode 100644 index 3922a73..0000000 --- a/proto/ivms101/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "ivms101_proto", - srcs = ["ivms101.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "ivms101_go_proto", - importpath = "github.com/trisacrypto/trisa/proto/ivms101", - proto = ":ivms101_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":ivms101_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/ivms101", - visibility = ["//visibility:public"], -) diff --git a/proto/ivms101/dummy.go b/proto/ivms101/dummy.go deleted file mode 100644 index a7179ac..0000000 --- a/proto/ivms101/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package ivms101 - -// +build ignore diff --git a/proto/ivms101/ivms101.proto b/proto/ivms101/ivms101.proto deleted file mode 100644 index 6be1667..0000000 --- a/proto/ivms101/ivms101.proto +++ /dev/null @@ -1,633 +0,0 @@ -// Specification Copyright (c) 2020 Joint Working Group on interVASP Messaging Standards https://intervasp.org/ -// https://intervasp.org/wp-content/uploads/2020/05/IVMS101-interVASP-data-model-standard-issue-1-FINAL.pdf - -// Protocol Buffer Specification Copyright (c) 2020 CipherTrace, Inc. https://ciphertrace.com - -// Licensed under MIT License - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// NOTE ON THE SPECIFICATION MAPPING -// This protocol buffers specification has applied the Protocol Buffers style guide -// https://developers.google.com/protocol-buffers/docs/style to the ISVM101 specification -// to be consistent with other Protocol Buffers specifications and to avoid common -// pitfalls when generating language specific classes. - -syntax = "proto3"; - -package ivms101; - -option go_package = "github.com/trisacrypto/trisa/proto/ivms101"; - - - -/*************************************************** - * Data Types Components - ***************************************************/ - -message Person { - - oneof person { - - // Definition: refers to a uniquely distinguishable individual; one single person. - NaturalPerson natural_person = 1; - - // Definition: refers to any entity other than a natural person that can establish - // a permanent customer relationship with an affected entity or otherwise own property. - // This can include companies, bodies corporate, foundations, anstalt, partnerships, - // or associations and other relevantly similar entities. - LegalPerson legal_person = 2; - } - -} - -// Definition: refers to a uniquely distinguishable individual; one single person -message NaturalPerson { - - // Definition: the distinct words used as identification for an individual. - // Required - NaturalPersonName name = 1; - - // Definition: the particulars of a location at which a person may be communicated with. - // Zero or More - repeated Address geographic_addresses = 2; - - // Definition: a distinct identifier used by governments of countries to uniquely identify a - // natural or legal person. - // Optional - NationalIdentification national_identification = 3; - - // Definition: a distinct identifier that uniquely identifies the person to the institution in context. - // Datatype: “Max50Text” - // Optional - string customer_identification = 4; - - // Definition: date and place of birth of a person. - // Optional - DateAndPlaceOfBirth date_and_place_of_birth = 5; - - // Definition: country in which a person resides (the place of a person's home). - // The value used for the field country must be present on the ISO-3166-1 alpha-2 codes or the value XX. - // Datatype: “CountryCode” - // Optional - string country_of_residence = 6; -} - -message NaturalPersonName { - - // At least one occurrence of naturalPersonNameID must have the value ‘LEGL’ specified in the element - // naturalPersonNameIdentifierType. - // Definition: full name separated into primary and secondary identifier. - // One or more - repeated NaturalPersonNameId name_identifiers = 1; - - // Definition: full name separated into primary and secondary identifier using local characters. - // Zero or more - repeated LocalNaturalPersonNameId local_name_identifiers = 2; - - // Definition: Alternate representation of a name that corresponds to the manner the name is pronounced. - // Zero or more - repeated LocalNaturalPersonNameId phonetic_name_identifiers = 3; -} - -message NaturalPersonNameId { - - // Definition: This may be the family name, the maiden name or the married name, the main name, the surname, - // and in some cases, the entire name where the natural person’s name cannot be divided into two parts, or - // where the sender is unable to divide the natural person’s name into two parts. - // Datatype: “Max100Text” - // Required - string primary_identifier = 1; - - // Definition: These may be the forenames, familiar names, given names, initials, prefixes, suffixes or - // Roman numerals (where considered to be legally part of the name) or any other secondary names. - // Datatype: “Max100Text” - // Optional - string secondary_identifier = 2; - - // Definition: The nature of the name specified. - // Required - NaturalPersonNameTypeCode name_identifier_type = 3; -} - -message LocalNaturalPersonNameId { - - // Definition: This may be the family name, the maiden name or the married name, the main name, the surname, - // and in some cases, the entire name where the natural person’s name cannot be divided into two parts, or - // where the sender is unable to divide the natural person’s name into two parts. - // Datatype: “LocalMax100Text” - // Required - string primary_identifier = 1; - - // Definition: These may be the forenames, familiar names, given names, initials, prefixes, suffixes or - // Roman numerals (where considered to be legally part of the name) or any other secondary names. - // Datatype: “LocalMax100Text” - // Optional - string secondary_identifier = 2; - - // Definition: The nature of the name specified. - // Required - NaturalPersonNameTypeCode name_identifier_type = 3; -} - -// Constraint: ValidAddress -// There must be at least one occurrence of the element addressLine or (streetName and buildingName -// and/or buildingNumber). -message Address { - - // Definition: Identifies the nature of the address. - // Required - AddressTypeCode address_type = 1; - - // Definition: Identification of a division of a large organisation or building. - // Datatype: “Max50Text” - // Optional - string department = 2; - - // Definition: Identification of a sub-division of a large organisation or building. - // Datatype: “Max70Text” - // Optional - string sub_department = 3; - - // Definition: Name of a street or thoroughfare. - // Datatype: “Max70Text” - // Optional - string street_name = 4; - - // Definition: Number that identifies the position of a building on a street. - // Datatype: “Max16Text” - // Optional - string building_number = 5; - - // Definition: Name of the building or house. - // Datatype: “Max35Text” - // Optional - string building_name = 6; - - // Definition: Floor or storey within a building. - // Datatype: “Max70Text” - // Optional - string floor = 7; - - // Definition: Numbered box in a post office, assigned to a person or organisation, where - // letters are kept until called for. - // Datatype: “Max16Text” - // Optional - string post_box = 8; - - // Definition: Building room number. - // Datatype: “Max70Text” - // Optional - string room = 9; - - // Definition: Identifier consisting of a group of letters and/or numbers that is added to a - // postal address to assist the sorting of mail. - // Datatype: “Max16Text” - // Optional - string post_code = 10; - - // Definition: Name of a built-up area, with defined boundaries, and a local government. - // Datatype: “Max35Text” - // Optional - string town_name = 11; - - // Definition: Specific location name within the town. - // Datatype: “Max35Text” - // Optional - string town_location_name = 12; - - // Definition: Identifies a subdivision within a country subdivision. - // Datatype: “Max35Text” - // Optional - string district_name = 13; - - // Definition: Identifies a subdivision of a country for example, state, region, province, - // départment or county. - // Datatype: “Max35Text” - // Optional - string country_sub_division = 14; - - // Definition: Information that locates and identifies a specific address, as defined by - // postal services, presented in free format text. - // Datatype: “Max70Text” - // Zero to Seven - repeated string address_line = 15; - - // Constraint: The value used for the field country must be present on the ISO-3166-1 alpha-2 codes or the value XX. - // Datatype: “CountryCode” - // Required - string country = 16; -} - -// Constraint: DateInPast -// If dateOfBirth is specified, the date specified must be a historic date (i.e. a date prior to the current date) -message DateAndPlaceOfBirth { - - // Definition: Date on which a person is born. - // Definition: A point in time, represented as a day within the calendar year. Compliant with ISO 8601. - // Type: Text - // Format: - // YYYY-MM-DD - // Regex: - // ^([0-9]{4})-([0-9]{2})-([0-9]{2})$ - // Required - string date_of_birth = 1; - - // Definition: The town and/or the city and/or the suburb and/or the country subdivision and/or the - // country where the person was born. - // Datatype: “Max70Text” - // Required - string place_of_birth = 2; -} - - -// Constraint: ValidNationalIdentifierLegalPerson -// A legal person must have a value for nationalIdentifierType of either ‘RAID’ or ‘MISC’ or ‘LEIX’ or ‘TXID’. -// Constraint: CompleteNationalIdentifierLegalPerson -// A LegalPerson must not have a value for countryOfIssue and (must have a value for the element RegistrationAuthority -// if the value for nationalIdentifierType is not ‘LEIX’ and must not have a value -// Constraint: ValidLEI -// A LegalPerson with a nationalIdentifierType of ‘LEIX’ must have a value for the element nationalIdentifier that -// adheres to the convention as stated in datatype ‘LEIText’. -message NationalIdentification { - - // Definition: An identifier issued by an appropriate issuing authority. - // Constraint: ValidLEI - // Datatype: “Max35Text” - // Required - string national_identifier = 1; - - // Definition: Specifies the type of identifier specified. - // Required - NationalIdentifierTypeCode national_identifier_type = 2; - - // Definition: Country of the issuing authority. - // Datatype: “CountryCode” - // Optional - string country_of_issue = 3; - - // Definition: A code specifying the registration authority. - // Constraint: The value used for the applicable element must be present on the GLEIF Registration Authorities List. - // Datatype: “RegistrationAuthority” - // Optional - string registration_authority = 4; -} - -// Definition: -// refers to any entity other than a natural person that can establish a permanent -// customer relationship with an affected entity or otherwise own property. This can include -// companies, bodies corporate, foundations, anstalt, partnerships, or associations and other -// relevantly similar entities. -// Constraint: OriginatorInformationLegalPerson -// If the originator is a LegalPerson either (geographicAddress with an addressType value of ‘GEOG’) -// and/or nationalIdentification and/or customerNumber is required. -message LegalPerson { - - // Definition: The name of the legal person. - // Constraint: LegalNamePresentLegalPerson - // At least one occurrence of legalPersonNameIdentifier must have the value ‘LEGL’ specified in the element - // legalPersonNameIdentifierType. - LegalPersonName name = 1; - - // Definition: The address of the legal person. - // Zero or more - repeated Address geographic_addresses = 2; - - // Definition: The unique identification number applied by the VASP to customer. - // NOTE The specification has a descrepency in that 5.2.9.3.3 specifies an element name as "customerNumber", - // while the table in 5.2.9.1 calls that element "customerIdentification" - // Datatype: “Max50Text” - // Optional - string customer_number = 3; - - // Definition: A distinct identifier used by governments of countries to uniquely identify a natural or legal person. - // Optional - NationalIdentification national_identification = 4; - - // Definition: The country in which the legal person is registered. - // Constraint: The value used for the field country must be present on the ISO-3166-1 alpha-2 codes or the value XX. - // Datatype: “CountryCode” - // Optional - string country_of_registration = 5; -} - -message LegalPersonName { - - // Definition: The name and type of name by which the legal person is known. - // Constraint: LegalNamePresent - // At least one occurrence of legalPersonNameIdentifier must have the value ‘LEGL’ specified in the - // element legalPersonNameIdentifierType. - // One or more - repeated LegalPersonNameId name_identifiers = 1; - - // Definition: The name and type of name by which the legal person is known using local characters. - // Zero or more - repeated LocalLegalPersonNameId local_name_identifiers = 2; - - // Definition: The name and type of name by which the legal person is known using local characters. - // Zero or more - repeated LocalLegalPersonNameId phonetic_name_identifiers = 3; -} - -message LegalPersonNameId { - - // Definition: Name by which the legal person is known. - // Datatype: “Max100Text” - // Required - string legal_person_name = 1; - - // Definition: The nature of the name specified. - // Required - LegalPersonNameTypeCode legal_person_name_identifier_type = 2; -} - -message LocalLegalPersonNameId { - - // Definition: Name by which the legal person is known. - // Datatype: "LocalMax100Text" - // Required - string legal_person_name = 1; - - // Definition: The nature of the name specified. - // Required - LegalPersonNameTypeCode legal_person_name_identifier_type = 2; -} - -message IntermediaryVasp { - - // Definition: the VASP in a serial chain that receives and retransmits a VA transfer on behalf of the originating VASP - // and the beneficiary VASP, or another intermediary VASP. - // Required - Person intermediary_vasp = 1; - - // Definition: the sequence in a serial chain at which the corresponding intermediary VASP participates in the transfer. - // Constraints: totalDigits: 18; fractionDigits: 0 - // Required - uint64 sequence = 2; -} - - - -/*************************************************** - * Data Types ENUMS - ***************************************************/ - - // Definition: A single value corresponding to the nature of name being adopted. - enum NaturalPersonNameTypeCode { - - // Alias name - // A name other than the legal name by which a natural person is also known. - NATURAL_PERSON_NAME_TYPE_CODE_ALIA = 0; - - // Name at birth - // The name given to a natural person at birth. - NATURAL_PERSON_NAME_TYPE_CODE_BIRT = 1; - - // Maiden name - // The original name of a natural person who has changed their name after marriage. - NATURAL_PERSON_NAME_TYPE_CODE_MAID = 2; - - // Legal name - // The name that identifies a natural person for legal, official or administrative purposes. - NATURAL_PERSON_NAME_TYPE_CODE_LEGL = 3; - - // Unspecified - // A name by which a natural person may be known but which cannot otherwise be categorized - // or the category of which the sender is unable to determine. - NATURAL_PERSON_NAME_TYPE_CODE_MISC = 4; - } - -// Definition: A single value corresponding to the nature of name being specified for the legal person. -enum LegalPersonNameTypeCode { - // Legal name - // Official name under which an organisation is registered. - LEGAL_PERSON_NAME_TYPE_CODE_LEGL = 0; - - // Short name - // Specifies the short name of the organisation. - LEGAL_PERSON_NAME_TYPE_CODE_SHRT = 1; - - // Trading name - // Name used by a business for commercial purposes, although its registered legal name, used for - // contracts and other formal situations, may be another. - LEGAL_PERSON_NAME_TYPE_CODE_TRAD = 2; -} - -// Definition: Identifies the nature of the address. -enum AddressTypeCode { - - // Residential - // Address is the home address. - ADDRESS_TYPE_CODE__HOME = 0; - - // Business - // Address is the business address. - ADDRESS_TYPE_CODE_BIZZ = 1; - - // Geographic - // Address is the unspecified physical (geographical) address suitable for identification of the - // natural or legal person. - ADDRESS_TYPE_CODE_GEOG = 2; -} - -// Definition: Identifies the national identification type. -// NationalIdentifierTypeCode applies a restriction over the codes present in ISO20022 datatype ‘TypeOfIdentification4Code’. -enum NationalIdentifierTypeCode { - - // Alien registration number - // Number assigned by a government agency to identify foreign nationals. - NATIONAL_IDENTIFIER_TYPE_CODE_ARNU = 0; - - // Passport number - // Number assigned by a passport authority. - NATIONAL_IDENTIFIER_TYPE_CODE_CCPT = 1; - - // Registration authority identifier - // Identifier of a legal entity as maintained by a registration authority. - NATIONAL_IDENTIFIER_TYPE_CODE_RAID = 2; - - // Driver license number - // Number assigned to a driver's license. - NATIONAL_IDENTIFIER_TYPE_CODE_DRLC = 3; - - // Foreign investment identity number - // Number assigned to a foreign investor (other than the alien number). - NATIONAL_IDENTIFIER_TYPE_CODE_FIIN = 4; - - // Tax identification number - // Number assigned by a tax authority to an entity. - NATIONAL_IDENTIFIER_TYPE_CODE_TXID = 5; - - // Social security number - // Number assigned by a social security agency. - NATIONAL_IDENTIFIER_TYPE_CODE_SOCS = 6; - - // Identity card number - // Number assigned by a national authority to an identity card. - NATIONAL_IDENTIFIER_TYPE_CODE_IDCD = 7; - - // Legal Entity Identifier - // Legal Entity Identifier (LEI) assigned in accordance with ISO 17442. - // The LEI is a 20-character, alpha-numeric code that enables clear and unique identification of legal entities - // participating in financial transactions. - NATIONAL_IDENTIFIER_TYPE_CODE_LEIX = 8; - - // Unspecified - // A national identifier which may be known but which cannot otherwise be categorized or the category of which - // the sender is unable to determine. - NATIONAL_IDENTIFIER_TYPE_CODE_MISC = 9; -} - -// Definition: Identifies the national script from which transliteration to Latin script is applied. -enum TransliterationMethodCode { - - // Arabic (Arabic language) - // ISO 233-2:1993 - TRANSLITERATION_METHOD_CODE_ARAB = 0; - - // Arabic (Persian language) - // ISO 233-3:1999 - TRANSLITERATION_METHOD_CODE_ARAN = 1; - - // Armenian - // ISO 9985:1996 - TRANSLITERATION_METHOD_CODE_ARMN = 2; - - // Cyrillic - // ISO 9:1995 - TRANSLITERATION_METHOD_CODE_CYRL = 3; - - // Devanagari & related Indic - // ISO 15919:2001 - TRANSLITERATION_METHOD_CODE_DEVA = 4; - - // Georgian - // ISO 9984:1996 - TRANSLITERATION_METHOD_CODE_GEOR = 5; - - // Greek - // ISO 843:1997 - TRANSLITERATION_METHOD_CODE_GREK = 6; - - // Han (Hanzi, Kanji, Hanja) - // ISO 7098:2015 - TRANSLITERATION_METHOD_CODE_HANI = 7; - - // Hebrew - // ISO 259-2:1994 - TRANSLITERATION_METHOD_CODE_HEBR = 8; - - // Kana - // ISO 3602:1989 - TRANSLITERATION_METHOD_CODE_KANA = 10; - - // Korean - // Revised Romanization of Korean - TRANSLITERATION_METHOD_CODE_KORE = 11; - - // Thai - // ISO 11940-2:2007 - TRANSLITERATION_METHOD_CODE_THAI = 12; - - // Script other than those listed above - // Unspecified Standard - TRANSLITERATION_METHOD_CODE_OTHR = 13; -} - - - - - -/*************************************************** - * Data Model - ***************************************************/ - -message Originator { - - // Definition: the account holder who allows the VA transfer from that account or, where there - // is no account, the natural or legal person that places the order with the originating VASP - // to perform the VA transfer. - // One or More - repeated Person originator_persons = 1; - - // Definition: Identifier of an account that is used to process the transaction. The value - // for this element is case-sensitive. - // Datatype: “Max100Text” - // Zero or More - repeated string account_numbers = 2; -} - -message Beneficiary { - - // Definition: the natural or legal person or legal arrangement who is identified by the originator - // as the receiver of the requested VA transfer. - // One or More - repeated Person beneficiary_persons = 1; - - // Definition: Identifier of an account that is used to process the transaction. The value - // for this element is case-sensitive. - // Datatype: “Max100Text” - // Zero or More - repeated string account_numbers = 2; -} - -message OriginatingVasp { - - // Definition: refers to the VASP which initiates the VA transfer, and transfers the VA - // upon receiving the request for a VA transfer on behalf of the originator. - // Optional - Person originating_vasp = 1; -} - -message BeneficiaryVasp { - - // Definition: the VASP which receives the transfer of a virtual asset from the originating VASP - // directly or through an intermediary VASP and makes the funds available to the beneficiary. - // Optional - Person beneficiary_vasp = 1; -} - -message TransferPath { - - // Definition: the intermediary VASP(s) participating in a serial chain that receive and - // retransmit a VA transfer on behalf of the originating VASP and the beneficiary VASP, or - // another intermediary VASP, together with their corresponding sequence number. - // Zero or More - repeated IntermediaryVasp transfer_path = 1; -} - -message PayloadMetadata { - - // Definition: the method used to map from a national system of writing to Latin script. - // Zero or More - repeated TransliterationMethodCode transliteration_method = 1; -} - -/*************************************************************************** - * Top Level Model (not formally described in IVMS101, only examples) - ***************************************************************************/ - -message IdentityPayload { - Originator originator = 1; - Beneficiary beneficiary = 2; - OriginatingVasp originating_vasp =3; - BeneficiaryVasp beneficiary_vasp = 4; - TransferPath transfer_path = 5; - PayloadMetadata payload_metadata = 6; -} diff --git a/proto/trisa/data/bitcoin/v1alpha1/BUILD.bazel b/proto/trisa/data/bitcoin/v1alpha1/BUILD.bazel deleted file mode 100644 index afa14f9..0000000 --- a/proto/trisa/data/bitcoin/v1alpha1/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "v1alpha1_proto", - srcs = ["bitcoin.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "v1alpha1_go_proto", - importpath = "github.com/trisacrypto/trisa/proto/trisa/data/bitcoin/v1alpha1", - proto = ":v1alpha1_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":v1alpha1_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/data/bitcoin/v1alpha1", - visibility = ["//visibility:public"], -) diff --git a/proto/trisa/data/bitcoin/v1alpha1/bitcoin.proto b/proto/trisa/data/bitcoin/v1alpha1/bitcoin.proto deleted file mode 100644 index e386b34..0000000 --- a/proto/trisa/data/bitcoin/v1alpha1/bitcoin.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -package trisa.data.bitcoin.v1alpha1; - -option go_package = "github.com/trisacrypto/trisa/proto/trisa/data/bitcoin/v1alpha1"; - -message Data { - string source = 1; - string destination = 2; - int32 amount = 3; -} \ No newline at end of file diff --git a/proto/trisa/data/bitcoin/v1alpha1/dummy.go b/proto/trisa/data/bitcoin/v1alpha1/dummy.go deleted file mode 100644 index 234b1f5..0000000 --- a/proto/trisa/data/bitcoin/v1alpha1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha1 - -// +build ignore diff --git a/proto/trisa/data/ethereum/v1alpha1/BUILD.bazel b/proto/trisa/data/ethereum/v1alpha1/BUILD.bazel deleted file mode 100644 index b2c9d13..0000000 --- a/proto/trisa/data/ethereum/v1alpha1/BUILD.bazel +++ /dev/null @@ -1,24 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":v1alpha1_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/data/ethereum/v1alpha1", - visibility = ["//visibility:public"], -) - -proto_library( - name = "v1alpha1_proto", - srcs = ["ethereum.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "v1alpha1_go_proto", - importpath = "github.com/trisacrypto/trisa/proto/trisa/data/ethereum/v1alpha1", - proto = ":v1alpha1_proto", - visibility = ["//visibility:public"], -) diff --git a/proto/trisa/data/ethereum/v1alpha1/dummy.go b/proto/trisa/data/ethereum/v1alpha1/dummy.go deleted file mode 100644 index 234b1f5..0000000 --- a/proto/trisa/data/ethereum/v1alpha1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha1 - -// +build ignore diff --git a/proto/trisa/data/ethereum/v1alpha1/ethereum.proto b/proto/trisa/data/ethereum/v1alpha1/ethereum.proto deleted file mode 100644 index ec66aea..0000000 --- a/proto/trisa/data/ethereum/v1alpha1/ethereum.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; - -package trisa.data.ethereum.v1alpha1; - -option go_package = "github.com/trisacrypto/trisa/proto/trisa/data/ethereum/v1alpha1"; - -message Data { - string source = 1; - string destination = 2; - int32 amount = 3; -} \ No newline at end of file diff --git a/proto/trisa/identity/be/v1alpha1/BUILD.bazel b/proto/trisa/identity/be/v1alpha1/BUILD.bazel deleted file mode 100644 index 0cf3a98..0000000 --- a/proto/trisa/identity/be/v1alpha1/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "identity_proto", - srcs = ["identity.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "identity_go_proto", - importpath = "github.com/trisacrypto/trisa/proto/trisa/identity/be/v1alpha1", - proto = ":v1alpha1_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":identity_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/identity/be/v1alpha1", - visibility = ["//visibility:public"], -) - -proto_library( - name = "v1alpha1_proto", - srcs = ["identity.proto"], - visibility = ["//visibility:public"], -) diff --git a/proto/trisa/identity/be/v1alpha1/dummy.go b/proto/trisa/identity/be/v1alpha1/dummy.go deleted file mode 100644 index 234b1f5..0000000 --- a/proto/trisa/identity/be/v1alpha1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha1 - -// +build ignore diff --git a/proto/trisa/identity/be/v1alpha1/identity.proto b/proto/trisa/identity/be/v1alpha1/identity.proto deleted file mode 100644 index 94e6494..0000000 --- a/proto/trisa/identity/be/v1alpha1/identity.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package trisa.identity.be.v1alpha1; - -option go_package = "github.com/trisacrypto/trisa/proto/trisa/identity/be/v1alpha1"; - -message Identity { - string first_name = 1; - string last_name = 2; - string national_number = 3; - string city_of_birth = 4; -} \ No newline at end of file diff --git a/proto/trisa/identity/us/v1alpha1/BUILD.bazel b/proto/trisa/identity/us/v1alpha1/BUILD.bazel deleted file mode 100644 index ff60baf..0000000 --- a/proto/trisa/identity/us/v1alpha1/BUILD.bazel +++ /dev/null @@ -1,30 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "identity_proto", - srcs = ["identity.proto"], - visibility = ["//visibility:public"], -) - -go_proto_library( - name = "identity_go_proto", - importpath = "github.com/trisacrypto/trisa/proto/trisa/identity/us/v1alpha1", - proto = ":v1alpha1_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":identity_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/identity/us/v1alpha1", - visibility = ["//visibility:public"], -) - -proto_library( - name = "v1alpha1_proto", - srcs = ["identity.proto"], - visibility = ["//visibility:public"], -) diff --git a/proto/trisa/identity/us/v1alpha1/dummy.go b/proto/trisa/identity/us/v1alpha1/dummy.go deleted file mode 100644 index 234b1f5..0000000 --- a/proto/trisa/identity/us/v1alpha1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha1 - -// +build ignore diff --git a/proto/trisa/identity/us/v1alpha1/identity.proto b/proto/trisa/identity/us/v1alpha1/identity.proto deleted file mode 100644 index 141898a..0000000 --- a/proto/trisa/identity/us/v1alpha1/identity.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; - -package trisa.identity.us.v1alpha1; - -option go_package = "github.com/trisacrypto/trisa/proto/trisa/identity/us/v1alpha1"; - -message Identity { - string first_name = 1; - string last_name = 2; - string ssn = 3; - string state = 4; - string driver_license = 5; -} \ No newline at end of file diff --git a/proto/trisa/protocol/v1alpha1/BUILD.bazel b/proto/trisa/protocol/v1alpha1/BUILD.bazel deleted file mode 100644 index f0e91aa..0000000 --- a/proto/trisa/protocol/v1alpha1/BUILD.bazel +++ /dev/null @@ -1,26 +0,0 @@ -load("@rules_proto//proto:defs.bzl", "proto_library") -load("@io_bazel_rules_go//go:def.bzl", "go_library") -load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") - -proto_library( - name = "v1alpha1_proto", - srcs = ["trisa.proto"], - visibility = ["//visibility:public"], - deps = ["@com_google_protobuf//:any_proto"], -) - -go_proto_library( - name = "v1alpha1_go_proto", - compilers = ["@io_bazel_rules_go//proto:go_grpc"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1", - proto = ":v1alpha1_proto", - visibility = ["//visibility:public"], -) - -go_library( - name = "go_default_library", - srcs = ["dummy.go"], - embed = [":v1alpha1_go_proto"], - importpath = "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1", - visibility = ["//visibility:public"], -) diff --git a/proto/trisa/protocol/v1alpha1/dummy.go b/proto/trisa/protocol/v1alpha1/dummy.go deleted file mode 100644 index 234b1f5..0000000 --- a/proto/trisa/protocol/v1alpha1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package v1alpha1 - -// +build ignore diff --git a/proto/trisa/protocol/v1alpha1/trisa.proto b/proto/trisa/protocol/v1alpha1/trisa.proto deleted file mode 100644 index 36fbc19..0000000 --- a/proto/trisa/protocol/v1alpha1/trisa.proto +++ /dev/null @@ -1,45 +0,0 @@ -syntax = "proto3"; - -package trisa.protocol.v1alpha1; - -import "google/protobuf/any.proto"; - -option go_package = "github.com/trisacrypto/trisa/proto/trisa/protocol/v1alpha1"; - -service TrisaPeer2Peer { - rpc TransactionStream(stream Transaction) returns (stream Transaction) {} -} - -message Transaction { - // The transaction identifier generated by the sender. Any response - // to a transaction request needs to carry the same identifier. - string id = 1; - - // Encrypted TransactionData - bytes transaction = 2; - - // Encryption key used to encrypt the transaction blob. This key itself - // is encrypted using the public key of the receiver. - bytes encryption_key = 3; - - // The encryption algorithm used to encrypt the transaction blob. - string encryption_algorithm = 4; - - // HMAC signature calculated from encrypted transaction blob. - bytes hmac = 5; - - // The HMAC secret used to calculate the HMAC signature. This secret - // itself is encrypted using the public key of the receiver. - bytes hmac_secret = 6; - - // The algorithm used to calculate the HMAC signature. - string hmac_algorithm = 7; -} - -message TransactionData { - // Identity contains any valid identity structure. - google.protobuf.Any identity = 1; - - // Data contains the network specific data. - google.protobuf.Any data = 2; -} \ No newline at end of file diff --git a/skaffold.yaml b/skaffold.yaml deleted file mode 100644 index 170baf1..0000000 --- a/skaffold.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: skaffold/v1 -kind: Config -metadata: - name: trisa -build: - artifacts: - - image: trisacrypto/trisa - bazel: - target: //cmd/trisa:docker.tar - args: - - --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 - - -c - - dbg - tagPolicy: - gitCommit: {} - local: - push: false -profiles: -- name: travis-pr - activation: - - env: TRAVIS_EVENT_TYPE=pull_request - build: - artifacts: - - image: trisacrypto/trisa - bazel: - target: //cmd/trisa:docker.tar - args: - - --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 - tagPolicy: - envTemplate: - template: '{{.IMAGE_NAME}}:pr-{{.TRAVIS_PULL_REQUEST}}' - local: - push: true -- name: travis-push - activation: - - env: TRAVIS_EVENT_TYPE=push - - env: TRAVIS_EVENT_TYPE=cron - build: - artifacts: - - image: trisacrypto/trisa - bazel: - target: //cmd/trisa:docker.tar - args: - - --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64 - tagPolicy: - sha256: {} - local: - push: true -- name: kind - deploy: - kustomize: - path: hack/etc/k8s/vasps