From f9cf44910445687bc8c631e16a7a7e989a4593f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Bordalo?= Date: Thu, 12 Sep 2024 17:11:37 +0100 Subject: [PATCH] fix: support http as asp url (#303) * fix asp url * replicate fix on covenant client * upgrade to go 1.23.1 --- .github/workflows/ark.unit.yaml | 18 +++++++++--------- client/covenant/client.go | 1 + client/covenantless/client.go | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ark.unit.yaml b/.github/workflows/ark.unit.yaml index 804ce6c..b942a8e 100755 --- a/.github/workflows/ark.unit.yaml +++ b/.github/workflows/ark.unit.yaml @@ -3,15 +3,15 @@ name: ci_unit on: push: paths: - - "server/**" - - "pkg/client-sdk/**" + - 'server/**' + - 'pkg/client-sdk/**' branches: [master] pull_request: branches: - master paths: - - "server/**" - - "pkg/client-sdk/**" + - 'server/**' + - 'pkg/client-sdk/**' jobs: check-go-sync: @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '>=1.22.6' + go-version: '>=1.23.1' - name: Run go work sync run: go work sync @@ -44,7 +44,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '>=1.22.6' + go-version: '>=1.23.1' - uses: actions/checkout@v3 - name: check linting uses: golangci/golangci-lint-action@v6 @@ -55,7 +55,7 @@ jobs: - name: check code integrity uses: securego/gosec@master with: - args: "-severity high -quiet -exclude=G115 ./..." + args: '-severity high -quiet -exclude=G115 ./...' - run: go get -v -t -d ./... - name: unit testing run: make test @@ -69,7 +69,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '>=1.22.6' + go-version: '>=1.23.1' - uses: actions/checkout@v3 - name: check linting uses: golangci/golangci-lint-action@v6 @@ -80,7 +80,7 @@ jobs: - name: check code integrity uses: securego/gosec@master with: - args: "-severity high -quiet -exclude=G115 ./..." + args: '-severity high -quiet -exclude=G115 ./...' - run: go get -v -t -d ./... - name: unit testing run: make test diff --git a/client/covenant/client.go b/client/covenant/client.go index 529f797..7991b0c 100644 --- a/client/covenant/client.go +++ b/client/covenant/client.go @@ -104,6 +104,7 @@ func getClientFromState(ctx *cli.Context) (arkv1.ArkServiceClient, func(), error func getClient(addr string) (arkv1.ArkServiceClient, func(), error) { creds := insecure.NewCredentials() port := 80 + addr = strings.TrimPrefix(addr, "http://") if strings.HasPrefix(addr, "https://") { addr = strings.TrimPrefix(addr, "https://") creds = credentials.NewTLS(nil) diff --git a/client/covenantless/client.go b/client/covenantless/client.go index 091b83d..950d008 100644 --- a/client/covenantless/client.go +++ b/client/covenantless/client.go @@ -106,6 +106,7 @@ func getClientFromState(ctx *cli.Context) (arkv1.ArkServiceClient, func(), error func getClient(addr string) (arkv1.ArkServiceClient, func(), error) { creds := insecure.NewCredentials() port := 80 + addr = strings.TrimPrefix(addr, "http://") if strings.HasPrefix(addr, "https://") { addr = strings.TrimPrefix(addr, "https://") creds = credentials.NewTLS(nil)