From 2b23f4c1b9ad1556c8e73b097d3fdc1e9c81a58a Mon Sep 17 00:00:00 2001 From: Flavien binet Date: Tue, 10 Sep 2019 10:54:33 +0200 Subject: [PATCH 1/5] Updated module path from gitlab to github --- README.md | 4 ++-- client.go | 4 ++-- client_test.go | 4 ++-- commands.go | 3 ++- crypto/crypto.go | 2 +- example_test.go | 2 +- go.mod | 7 ++----- go.sum | 28 ++-------------------------- keys/publickey.go | 2 +- keys/publickey_test.go | 2 +- keys/symmetric.go | 2 +- keys/symmetric_test.go | 2 +- 12 files changed, 18 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 23b9842..8e3f2e8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ communication protocol. Client instances can be created with either the `NewSymKeyClient` or `NewSymKeyClientPretty` commands, for example you might call: ```go - import e4 "gitlab.com/teserakt/e4common" + import e4 "github.com/teserakt-io/e4common" var id []byte var key []byte @@ -25,7 +25,7 @@ Client instances can be created with either the `NewSymKeyClient` or If you know your id and key already; alternatively you might do: ```go - import e4 "gitlab.com/teserakt/e4common" + import e4 "github.com/teserakt-io/e4common" name := "some client name" pwd := "some random password" diff --git a/client.go b/client.go index ade635a..e8004dd 100644 --- a/client.go +++ b/client.go @@ -41,8 +41,8 @@ import ( "golang.org/x/crypto/ed25519" - e4crypto "gitlab.com/teserakt/e4common/crypto" - "gitlab.com/teserakt/e4common/keys" + e4crypto "github.com/teserakt-io/e4common/crypto" + "github.com/teserakt-io/e4common/keys" ) const ( diff --git a/client_test.go b/client_test.go index b6594f8..999d137 100644 --- a/client_test.go +++ b/client_test.go @@ -10,8 +10,8 @@ import ( "time" "github.com/agl/ed25519/extra25519" - e4crypto "gitlab.com/teserakt/e4common/crypto" - "gitlab.com/teserakt/e4common/keys" + e4crypto "github.com/teserakt-io/e4common/crypto" + "github.com/teserakt-io/e4common/keys" "golang.org/x/crypto/ed25519" ) diff --git a/commands.go b/commands.go index d50ebd2..b97ba1f 100644 --- a/commands.go +++ b/commands.go @@ -3,8 +3,9 @@ package e4common import ( "errors" - e4crypto "gitlab.com/teserakt/e4common/crypto" "golang.org/x/crypto/ed25519" + + e4crypto "github.com/teserakt-io/e4common/crypto" ) // Command is a command sent by C2 to a client. This is a sequence of bytes, starting from a Command, followed by the command arguments. diff --git a/crypto/crypto.go b/crypto/crypto.go index fb3f288..2c50255 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -13,7 +13,7 @@ import ( "golang.org/x/crypto/argon2" "golang.org/x/crypto/curve25519" - miscreant "github.com/miscreant/miscreant/go" + miscreant "github.com/miscreant/miscreant.go" ) var ( diff --git a/example_test.go b/example_test.go index 7cd4e1c..70c7727 100644 --- a/example_test.go +++ b/example_test.go @@ -6,7 +6,7 @@ import ( "github.com/agl/ed25519/extra25519" "golang.org/x/crypto/ed25519" - "gitlab.com/teserakt/e4common/crypto" + "github.com/teserakt-io/e4common/crypto" ) func ExampleNewSymKeyClient() { diff --git a/go.mod b/go.mod index 82ed8ee..b58229b 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,9 @@ -module gitlab.com/teserakt/e4common +module github.com/teserakt-io/e4common go 1.12 require ( github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 - github.com/golang/protobuf v1.3.1 - github.com/miscreant/miscreant v0.3.0 + github.com/miscreant/miscreant.go v0.0.0-20190903041724-6bebe170cbaf golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 - golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 - google.golang.org/grpc v1.21.1 ) diff --git a/go.sum b/go.sum index 7c56366..f1d3e0a 100644 --- a/go.sum +++ b/go.sum @@ -1,38 +1,14 @@ -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/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -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.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/miscreant/miscreant v0.3.0 h1:bCn4zQMvNeeFBE3PWrG9ePFLPZyttBPhJ/WDqyqWrLQ= -github.com/miscreant/miscreant v0.3.0/go.mod h1:ZKWeIKfbJej2zjb1OUXJaaP1DnCb4yoTtcR90O7BOD4= +github.com/miscreant/miscreant.go v0.0.0-20190903041724-6bebe170cbaf h1:WHuYoA2VHEGYtfIaV2oBwa8csNWuUpCKAnDf3Jz2D1o= +github.com/miscreant/miscreant.go v0.0.0-20190903041724-6bebe170cbaf/go.mod h1:pBbZyGwC5i16IBkjVKoy/sznA8jPD/K9iedwe1ESE6w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc= golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= -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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -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/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/keys/publickey.go b/keys/publickey.go index 4e42bed..c476bab 100644 --- a/keys/publickey.go +++ b/keys/publickey.go @@ -8,7 +8,7 @@ import ( "sync" "time" - e4crypto "gitlab.com/teserakt/e4common/crypto" + e4crypto "github.com/teserakt-io/e4common/crypto" "github.com/agl/ed25519/extra25519" "golang.org/x/crypto/curve25519" diff --git a/keys/publickey_test.go b/keys/publickey_test.go index fe286ff..3900a94 100644 --- a/keys/publickey_test.go +++ b/keys/publickey_test.go @@ -10,7 +10,7 @@ import ( "github.com/agl/ed25519/extra25519" - e4crypto "gitlab.com/teserakt/e4common/crypto" + e4crypto "github.com/teserakt-io/e4common/crypto" "golang.org/x/crypto/ed25519" ) diff --git a/keys/symmetric.go b/keys/symmetric.go index a4cbe70..e22da21 100644 --- a/keys/symmetric.go +++ b/keys/symmetric.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - e4crypto "gitlab.com/teserakt/e4common/crypto" + e4crypto "github.com/teserakt-io/e4common/crypto" ) // SymKeyMaterial extends the KeyMaterial interface for symmetric key implementations diff --git a/keys/symmetric_test.go b/keys/symmetric_test.go index cdb49d6..9a0fe2a 100644 --- a/keys/symmetric_test.go +++ b/keys/symmetric_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - e4crypto "gitlab.com/teserakt/e4common/crypto" + e4crypto "github.com/teserakt-io/e4common/crypto" ) func TestNewSymKeyFromPassword(t *testing.T) { From c0e2afb84b79dba0bb33070b341dd36ece4079ca Mon Sep 17 00:00:00 2001 From: Flavien binet Date: Tue, 10 Sep 2019 17:54:59 +0200 Subject: [PATCH 2/5] Added missing err check --- keys/publickey_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/keys/publickey_test.go b/keys/publickey_test.go index 3900a94..14302c9 100644 --- a/keys/publickey_test.go +++ b/keys/publickey_test.go @@ -352,6 +352,10 @@ func TestPubKeyMaterialPubKeys(t *testing.T) { func TestPubKeyMaterialSetKey(t *testing.T) { _, privateKey, err := ed25519.GenerateKey(nil) + if err != nil { + t.Fatalf("Failed to generate key: %v", err) + } + clientID := e4crypto.HashIDAlias("test") k, err := NewPubKeyMaterial(clientID, privateKey, getTestC2PubKey(t)) @@ -369,6 +373,10 @@ func TestPubKeyMaterialSetKey(t *testing.T) { } _, privateKey2, err := ed25519.GenerateKey(nil) + if err != nil { + t.Fatalf("Failed to generate key: %v", err) + } + if err := typedKey.SetKey(privateKey2); err != nil { t.Fatalf("Failed to set key: %v", err) } @@ -389,6 +397,10 @@ func TestPubKeyMaterialSetKey(t *testing.T) { func TestPubKeyMaterialMarshalJSON(t *testing.T) { _, privateKey, err := ed25519.GenerateKey(nil) + if err != nil { + t.Fatalf("Failed to generate key: %v", err) + } + clientID := e4crypto.HashIDAlias("test") c2Pk := getTestC2PubKey(t) From e3a9a07a90893932ad45cde196c268eb7f95469d Mon Sep 17 00:00:00 2001 From: Flavien binet Date: Thu, 12 Sep 2019 09:27:46 +0200 Subject: [PATCH 3/5] Added CI lint and tests --- .github/actions/go-test/Dockerfile | 6 ++++ .github/actions/go-test/action.yml | 14 ++++++++++ .github/actions/go-test/entrypoint.sh | 22 +++++++++++++++ .github/workflows/go.yml | 40 +++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 .github/actions/go-test/Dockerfile create mode 100644 .github/actions/go-test/action.yml create mode 100644 .github/actions/go-test/entrypoint.sh create mode 100644 .github/workflows/go.yml diff --git a/.github/actions/go-test/Dockerfile b/.github/actions/go-test/Dockerfile new file mode 100644 index 0000000..0a7b20a --- /dev/null +++ b/.github/actions/go-test/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.12 + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/.github/actions/go-test/action.yml b/.github/actions/go-test/action.yml new file mode 100644 index 0000000..54eca9b --- /dev/null +++ b/.github/actions/go-test/action.yml @@ -0,0 +1,14 @@ +name: "Go Test action" +description: "Runs `go test`" +inputs: + timeout: + description: "time before the test execution get killed" + required: false + default: 60s + race: + description: "enabled the race detection" + required: false + default: true +runs: + using: "docker" + image: "Dockerfile" diff --git a/.github/actions/go-test/entrypoint.sh b/.github/actions/go-test/entrypoint.sh new file mode 100644 index 0000000..5af47d9 --- /dev/null +++ b/.github/actions/go-test/entrypoint.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +# Create netrc file with given username and access token so go get could authenticate to +# github and fetch private repositories. +if [ ! -z "${CI_USERNAME}" ] && [ ! -z "${CI_ACCESS_TOKEN}" ]; then + echo "machine github.com login ${CI_USERNAME} password ${CI_ACCESS_TOKEN}" > ~/.netrc +else + echo "No CI_USERNAME or CI_ACCESS_TOKEN defined, skipping authentication." +fi + + +RACE="" +if [ ! -e "{$INPUT_RACE}" ]; then + RACE="-race" +fi + +go test -timeout ${INPUT_TIMEOUT} ${RACE} ./... -coverprofile cover.out + +# coverage report +go tool cover -func cover.out diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..ec7311e --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,40 @@ +name: Go +on: [push] +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-go@v1 + with: + go-version: 1.12 + + - name: Setup access token + env: + CI_USERNAME: daeMOn63 + CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }} + run: | + echo "machine github.com login ${CI_USERNAME} password ${CI_ACCESS_TOKEN}" > ~/.netrc + + - name: Install dependencies + run: | + go get honnef.co/go/tools/cmd/staticcheck + go get golang.org/x/lint/golint + + - name: Lint + run: /home/runner/go/bin/golint -set_exit_status ./... + + - name: Static check + run: /home/runner/go/bin/staticcheck ./... + + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Test + uses: ./.github/actions/go-test + env: + CI_USERNAME: daeMOn63 + CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }} From ef960311285934665b1370b5129c61cb38081cba Mon Sep 17 00:00:00 2001 From: Flavien binet Date: Thu, 12 Sep 2019 14:12:49 +0200 Subject: [PATCH 4/5] Renamed e4common to e4go --- .github/workflows/go.yml | 13 +------------ .gitignore | 1 - CONTRIBUTING.md | 4 ++-- README.md | 8 +++----- client.go | 8 ++++---- client_test.go | 6 +++--- commands.go | 4 ++-- example_test.go | 4 ++-- go.mod | 2 +- keys/publickey.go | 2 +- keys/publickey_test.go | 2 +- keys/symmetric.go | 2 +- keys/symmetric_test.go | 2 +- 13 files changed, 22 insertions(+), 36 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ec7311e..8e41e8f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,13 +10,6 @@ jobs: with: go-version: 1.12 - - name: Setup access token - env: - CI_USERNAME: daeMOn63 - CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }} - run: | - echo "machine github.com login ${CI_USERNAME} password ${CI_ACCESS_TOKEN}" > ~/.netrc - - name: Install dependencies run: | go get honnef.co/go/tools/cmd/staticcheck @@ -33,8 +26,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Test - uses: ./.github/actions/go-test - env: - CI_USERNAME: daeMOn63 - CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }} + - uses: ./.github/actions/go-test diff --git a/.gitignore b/.gitignore index 13ec187..61fb0d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -cover.out.tmp cover.out test/data diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3f992b..a38d1ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,11 +4,11 @@ Although E4 is an in-house-developed product by Teserakt.io, it is still open-so ## Bugs, issues, feature requests -Please let us know by creating a [Github issues](https://github.com/Teserakt-io/e4common/issues) if you stumble upon a bug, have an issue or a feature request. +Please let us know by creating a [Github issues](https://github.com/Teserakt-io/e4go/issues) if you stumble upon a bug, have an issue or a feature request. ## Development -* We use golang version >= 1.12 for developing e4common. +* We use golang version >= 1.12 for developing e4go. * Makes sure to create new unit tests covering your code additions. * Please create pull requests targeting the `develop` branch diff --git a/README.md b/README.md index 8e3f2e8..06dfc4b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -# e4common - -Copyright (C) Teserakt AG 2018-2019. All Rights Reserved. +# e4go This repository implements E4 in Go, Teserakt's Secure machine-to-machine communication protocol. @@ -15,7 +13,7 @@ communication protocol. Client instances can be created with either the `NewSymKeyClient` or `NewSymKeyClientPretty` commands, for example you might call: ```go - import e4 "github.com/teserakt-io/e4common" + import e4 "github.com/teserakt-io/e4go" var id []byte var key []byte @@ -25,7 +23,7 @@ Client instances can be created with either the `NewSymKeyClient` or If you know your id and key already; alternatively you might do: ```go - import e4 "github.com/teserakt-io/e4common" + import e4 "github.com/teserakt-io/e4go" name := "some client name" pwd := "some random password" diff --git a/client.go b/client.go index e8004dd..1a2f1aa 100644 --- a/client.go +++ b/client.go @@ -1,5 +1,5 @@ // -// Package e4common provides a e4 client implementation and libraries. +// Package e4go provides a e4 client implementation and libraries. // // It aims to be quick and easy to integrate in IoT devices applications // enabling to secure their communications, as well as exposing a way to manage the various keys required. @@ -28,7 +28,7 @@ // There is nothing particular to be done when receiving a command, just passing its protected form to the Unprotect() method // and the client will automatically unprotect and process it (thus returning no unprotected message). // See commands.go for the list of available commands and their respective parameters. -package e4common +package e4go import ( "encoding/hex" @@ -41,8 +41,8 @@ import ( "golang.org/x/crypto/ed25519" - e4crypto "github.com/teserakt-io/e4common/crypto" - "github.com/teserakt-io/e4common/keys" + e4crypto "github.com/teserakt-io/e4go/crypto" + "github.com/teserakt-io/e4go/keys" ) const ( diff --git a/client_test.go b/client_test.go index 999d137..3f44879 100644 --- a/client_test.go +++ b/client_test.go @@ -1,4 +1,4 @@ -package e4common +package e4go import ( "bytes" @@ -10,8 +10,8 @@ import ( "time" "github.com/agl/ed25519/extra25519" - e4crypto "github.com/teserakt-io/e4common/crypto" - "github.com/teserakt-io/e4common/keys" + e4crypto "github.com/teserakt-io/e4go/crypto" + "github.com/teserakt-io/e4go/keys" "golang.org/x/crypto/ed25519" ) diff --git a/commands.go b/commands.go index b97ba1f..b3a4b32 100644 --- a/commands.go +++ b/commands.go @@ -1,11 +1,11 @@ -package e4common +package e4go import ( "errors" "golang.org/x/crypto/ed25519" - e4crypto "github.com/teserakt-io/e4common/crypto" + e4crypto "github.com/teserakt-io/e4go/crypto" ) // Command is a command sent by C2 to a client. This is a sequence of bytes, starting from a Command, followed by the command arguments. diff --git a/example_test.go b/example_test.go index 70c7727..563d373 100644 --- a/example_test.go +++ b/example_test.go @@ -1,4 +1,4 @@ -package e4common +package e4go import ( "log" @@ -6,7 +6,7 @@ import ( "github.com/agl/ed25519/extra25519" "golang.org/x/crypto/ed25519" - "github.com/teserakt-io/e4common/crypto" + "github.com/teserakt-io/e4go/crypto" ) func ExampleNewSymKeyClient() { diff --git a/go.mod b/go.mod index b58229b..b463e65 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/teserakt-io/e4common +module github.com/teserakt-io/e4go go 1.12 diff --git a/keys/publickey.go b/keys/publickey.go index c476bab..d53af6c 100644 --- a/keys/publickey.go +++ b/keys/publickey.go @@ -8,7 +8,7 @@ import ( "sync" "time" - e4crypto "github.com/teserakt-io/e4common/crypto" + e4crypto "github.com/teserakt-io/e4go/crypto" "github.com/agl/ed25519/extra25519" "golang.org/x/crypto/curve25519" diff --git a/keys/publickey_test.go b/keys/publickey_test.go index 14302c9..2d66118 100644 --- a/keys/publickey_test.go +++ b/keys/publickey_test.go @@ -10,7 +10,7 @@ import ( "github.com/agl/ed25519/extra25519" - e4crypto "github.com/teserakt-io/e4common/crypto" + e4crypto "github.com/teserakt-io/e4go/crypto" "golang.org/x/crypto/ed25519" ) diff --git a/keys/symmetric.go b/keys/symmetric.go index e22da21..dc0af54 100644 --- a/keys/symmetric.go +++ b/keys/symmetric.go @@ -4,7 +4,7 @@ import ( "encoding/json" "fmt" - e4crypto "github.com/teserakt-io/e4common/crypto" + e4crypto "github.com/teserakt-io/e4go/crypto" ) // SymKeyMaterial extends the KeyMaterial interface for symmetric key implementations diff --git a/keys/symmetric_test.go b/keys/symmetric_test.go index 9a0fe2a..0dfeedf 100644 --- a/keys/symmetric_test.go +++ b/keys/symmetric_test.go @@ -7,7 +7,7 @@ import ( "reflect" "testing" - e4crypto "github.com/teserakt-io/e4common/crypto" + e4crypto "github.com/teserakt-io/e4go/crypto" ) func TestNewSymKeyFromPassword(t *testing.T) { From 6fe8be764b0666e0774bc44453c987647d9683f2 Mon Sep 17 00:00:00 2001 From: Flavien binet Date: Mon, 16 Sep 2019 14:17:13 +0200 Subject: [PATCH 5/5] Updated workflow to use shared actions --- .github/actions/go-test/Dockerfile | 6 ------ .github/actions/go-test/action.yml | 14 -------------- .github/actions/go-test/entrypoint.sh | 22 ---------------------- .github/workflows/go.yml | 2 +- 4 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 .github/actions/go-test/Dockerfile delete mode 100644 .github/actions/go-test/action.yml delete mode 100644 .github/actions/go-test/entrypoint.sh diff --git a/.github/actions/go-test/Dockerfile b/.github/actions/go-test/Dockerfile deleted file mode 100644 index 0a7b20a..0000000 --- a/.github/actions/go-test/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM golang:1.12 - -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/.github/actions/go-test/action.yml b/.github/actions/go-test/action.yml deleted file mode 100644 index 54eca9b..0000000 --- a/.github/actions/go-test/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Go Test action" -description: "Runs `go test`" -inputs: - timeout: - description: "time before the test execution get killed" - required: false - default: 60s - race: - description: "enabled the race detection" - required: false - default: true -runs: - using: "docker" - image: "Dockerfile" diff --git a/.github/actions/go-test/entrypoint.sh b/.github/actions/go-test/entrypoint.sh deleted file mode 100644 index 5af47d9..0000000 --- a/.github/actions/go-test/entrypoint.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -e - -# Create netrc file with given username and access token so go get could authenticate to -# github and fetch private repositories. -if [ ! -z "${CI_USERNAME}" ] && [ ! -z "${CI_ACCESS_TOKEN}" ]; then - echo "machine github.com login ${CI_USERNAME} password ${CI_ACCESS_TOKEN}" > ~/.netrc -else - echo "No CI_USERNAME or CI_ACCESS_TOKEN defined, skipping authentication." -fi - - -RACE="" -if [ ! -e "{$INPUT_RACE}" ]; then - RACE="-race" -fi - -go test -timeout ${INPUT_TIMEOUT} ${RACE} ./... -coverprofile cover.out - -# coverage report -go tool cover -func cover.out diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8e41e8f..7b1d454 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,4 +26,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: ./.github/actions/go-test + - uses: teserakt-io/gh-actions/go-test@master