Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: findy-network/findy-common-go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.1
Choose a base ref
...
head repository: findy-network/findy-common-go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 14,213 additions and 2,232 deletions.
  1. +11 −0 .codecov.yaml
  2. +12 −0 .github/dependabot.yml
  3. +3 −0 .github/labeler.yml
  4. +23 −0 .github/workflows/do-release.yml
  5. +0 −14 .github/workflows/golangci-lint.yml
  6. +27 −0 .github/workflows/issue-label.yml
  7. +25 −0 .github/workflows/on-release.yml
  8. +33 −0 .github/workflows/pr-target.yml
  9. +0 −30 .github/workflows/release.yml
  10. +97 −8 .github/workflows/test.yml
  11. +5 −1 .gitignore
  12. +9 −7 .golangci.yml
  13. +192 −0 LICENSE
  14. +54 −12 Makefile
  15. +5 −0 NOTICE
  16. +74 −23 README.md
  17. +1 −1 VERSION
  18. +130 −45 agency/client/async/pairwise.go
  19. +43 −48 agency/client/chat/bot.go
  20. +213 −74 agency/client/chat/bot_test.go
  21. +361 −106 agency/client/chat/chat/chat.go
  22. +3 −20 agency/client/chat/machines.go
  23. +652 −117 agency/client/client.go
  24. +35 −0 agency/fsm/backend.go
  25. +246 −0 agency/fsm/backend_test.go
  26. +208 −0 agency/fsm/event.go
  27. +196 −394 agency/fsm/fsm.go
  28. +260 −38 agency/fsm/fsm_test.go
  29. +172 −0 agency/fsm/lua_test.go
  30. +345 −0 agency/fsm/machine.go
  31. +52 −0 agency/fsm/machine_type.go
  32. +9 −7 agency/fsm/plantuml.go
  33. +3 −0 agency/fsm/plantuml_test.go
  34. +7 −0 agency/fsm/script1.lua
  35. +4 −0 agency/fsm/script2.lua
  36. +466 −0 agency/fsm/transition.go
  37. +10 −6 backup/backup.go
  38. +31 −20 client/main.go
  39. +18 −14 crypto/crypto.go
  40. +56 −0 crypto/crypto_test.go
  41. +294 −67 crypto/db/db.go
  42. +268 −11 crypto/db/db_test.go
  43. +23 −0 crypto/db/handle.go
  44. +157 −0 crypto/db/mem.go
  45. +92 −0 dto/dto.go
  46. +50 −14 go.mod
  47. +166 −933 go.sum
  48. +2,097 −0 grpc/agency/v1/agent.pb.go
  49. +526 −0 grpc/agency/v1/agent_grpc.pb.go
  50. +2,236 −0 grpc/agency/v1/protocol.pb.go
  51. +299 −0 grpc/agency/v1/protocol_grpc.pb.go
  52. +1,094 −0 grpc/authn/v1/authn.pb.go
  53. +173 −0 grpc/authn/v1/authn_grpc.pb.go
  54. +780 −0 grpc/ops/v1/agency.pb.go
  55. +257 −0 grpc/ops/v1/agency_grpc.pb.go
  56. +69 −0 http/http.go
  57. +1 −0 integration/doc.go
  58. +98 −31 integration/grpc_test.go
  59. +105 −6 jwt/jwt.go
  60. +45 −6 jwt/jwt_test.go
  61. +0 −80 memo.md
  62. +0 −42 release.sh
  63. +47 −15 rpc/client.go
  64. +58 −25 rpc/server.go
  65. +13 −3 rpc/tls.go
  66. +11 −0 scripts/README.md
  67. 0 { → scripts}/branch.sh
  68. 0 { → scripts}/tls/ca.crt
  69. 0 { → scripts}/tls/ca.key
  70. 0 { → scripts}/tls/instructions.sh
  71. 0 { → scripts}/tls/server.crt
  72. 0 { → scripts}/tls/server.csr
  73. 0 { → scripts}/tls/server.key
  74. 0 { → scripts}/tls/server.pem
  75. +47 −14 server/main.go
  76. +83 −0 std/decorator/decorator.go
  77. +19 −0 std/decorator/decorator_impl.go
  78. +62 −0 std/decorator/decorator_test.go
  79. +73 −0 std/didexchange/invitation/models.go
  80. +94 −0 std/didexchange/invitation/translate.go
  81. +242 −0 std/didexchange/invitation/translate_test.go
  82. +93 −0 std/didexchange/invitation/v0.go
  83. +110 −0 std/didexchange/invitation/v1.go
  84. +35 −0 tools/sleeper/sleeper.go
  85. +41 −0 tools/sleeper/sleeper_test.go
  86. +7 −0 utils/utils.go
  87. +7 −0 x/go.mod.old
  88. +4 −0 x/go.sum.old
  89. +71 −0 x/rwmap.go
  90. +69 −0 x/rwslice.go
  91. +45 −0 x/x.go
  92. +61 −0 x/x_test.go
11 changes: 11 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project:
default:
target: 35%
threshold: 3%
patch:
default:
target: 15%
threshold: 10%
only_pulls: true
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
target-branch: "dev"
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
target-branch: 'dev'
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dev:
- changed-files:
- any-glob-to-any-file: '**'
23 changes: 23 additions & 0 deletions .github/workflows/do-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tag-release
on:
schedule:
- cron: "0 1 * * 1-5" # run at 1 AM UTC on weekdays
workflow_dispatch:

jobs:
tag-release:
runs-on: ubuntu-latest
name: Tag release if changes
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.AGENCY_RELEASER_ID }}
private-key: ${{ secrets.AGENCY_RELEASER_KEY }}
- uses: findy-network/releaser-action@master
with:
token: ${{ steps.generate_token.outputs.token }}
gate: test
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
14 changes: 0 additions & 14 deletions .github/workflows/golangci-lint.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/issue-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "issue-label"
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["dev"]
})
- name: Add comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.issue.number }}
body: |
Issue created by ${{ github.event.issue.user.login }}
25 changes: 25 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: release
on:
push:
tags:
- '*'
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.AGENCY_RELEASER_ID }}
private-key: ${{ secrets.AGENCY_RELEASER_KEY }}
- name: checkout
uses: actions/checkout@v4
with:
ref: master
token: ${{ steps.generate_token.outputs.token }}
- name: merge
run: |
git fetch --tags origin
git merge $GITHUB_REF
git push origin master
33 changes: 33 additions & 0 deletions .github/workflows/pr-target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "pr-target"
on:
pull_request_target:

jobs:
# label with "dev" to enable PR filtering
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
steps:
- id: label-the-PR
uses: actions/labeler@v5

# automerge successful dependabot PRs
dependabot:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.dependabot-metadata.outputs.target-branch == 'dev'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
30 changes: 0 additions & 30 deletions .github/workflows/release.yml

This file was deleted.

105 changes: 97 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -4,13 +4,102 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: setup
uses: actions/setup-go@v2
- name: setup go and lint
uses: findy-network/setup-go-action@master
with:
go-version: 1.16.x
- name: checkout
uses: actions/checkout@v2
- name: use token
run: git config --global url."https://"${{ secrets.https_prefix }}"github.com/".insteadOf "https://github.com/"
linter-config-path: .golangci.yml
skip-scan: true
- name: test
run: go test ./...
run: make test_cov_out
- name: store coverage file
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-coverage.txt
path: ./coverage.txt
retention-days: 1

services-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- repository: "findy-agent"
- repository: "findy-agent-vault"
- repository: "findy-agent-auth"

steps:
# install indy
- uses: actions/checkout@v3
if: ${{ matrix.repository == 'findy-agent' }}
with:
repository: "findy-network/findy-wrapper-go"
- name: install indy
if: ${{ matrix.repository == 'findy-agent' }}
run: make indy_to_debian
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: "findy-network/${{ matrix.repository }}"
ref: dev
path: "./target"
- uses: actions/setup-go@v3
with:
go-version-file: "./go.mod"
- name: test with ${{ matrix.repository }}
run: |
cd ./target
go mod edit -replace github.com/findy-network/findy-common-go=../
go mod tidy -e
go test -p 1 -failfast -timeout=1200s \
-coverpkg=github.com/findy-network/findy-common-go/... \
-coverprofile=coverage-${{ matrix.repository }}.txt \
-covermode=atomic \
./...
- name: store coverage file
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}-coverage-${{ matrix.repository }}.txt
path: ./target/coverage-${{ matrix.repository }}.txt
retention-days: 1

env:
FAV_DB_PASSWORD: password
# TODO: move vault to separate test
services:
postgres:
image: postgres:13.8-alpine
ports:
- 5433:5432
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: vault

upload-coverage:
runs-on: ubuntu-latest
needs: [test, services-tests]
steps:
- name: checkout
uses: actions/checkout@v3
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent-vault.txt
- name: download coverage file
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}-coverage-findy-agent-auth.txt
- name: upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt,./coverage-findy-agent.txt,./coverage-findy-agent-vault.txt,./coverage-findy-agent-auth.txt
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -16,9 +16,13 @@ cli
# Build tool specifics
.idea
.vscode
*.vim

# Dependency directories (remove the comment below to include it)
# vendor/

# Environment variables
.envrc
.envrc

.DS_Store
coverage.txt
16 changes: 9 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
linters-settings:
dupl:
threshold: 200
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: "ioutil is deprecated starting with Go 1.16"
funlen:
lines: 100
statements: 50
statements: 100
goconst:
min-len: 2
min-occurrences: 2
@@ -48,7 +54,6 @@ linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
@@ -74,16 +79,13 @@ linters:
- nakedret
- noctx
- nolintlint
- rowserrcheck
# - scopelint
- staticcheck
- structcheck
# - stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
# - unused # TODO: Forced to remove or linter crashes!!!
# - whitespace
# don't enable:
# - asciicheck
@@ -110,4 +112,4 @@ issues:
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.37.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.54.x # use the fixed version to not introduce new linters unexpectedly
Loading