Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Commit

Permalink
Merge tag 'v0.1.3' of github.com:hyperledger/aries-framework-go
Browse files Browse the repository at this point in the history
  • Loading branch information
m00sey committed May 29, 2020
2 parents dc3505e + a831aae commit 8235be3
Show file tree
Hide file tree
Showing 267 changed files with 26,556 additions and 18,120 deletions.
2 changes: 2 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ coverage:

ignore:
- "test/bdd" # ignore bdd tests
- "protos"
- "pkg/crypto/tinkcrypto/primitive/proto"
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ issues:
- dupl
- funlen
- gomnd
- source: "swagger:route"
linters:
- lll

exclude:
# Allow package logger variables (for now)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ bdd-test-go:
bdd-test-js:
@scripts/check_js_integration.sh

bdd-test-js-local:
@scripts/check_js_integration.sh test-local

.PHONY: vc-test-suite
vc-test-suite: clean
@scripts/run_vc_test_suite.sh
Expand Down
4 changes: 2 additions & 2 deletions ci/version_var.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Release Parameters
BASE_VERSION=0.1.3
IS_RELEASE=false
IS_RELEASE=true

ARCH=$(go env GOARCH)

Expand All @@ -19,4 +19,4 @@ else
fi

export AGENT_IMAGE_TAG=$ARCH-$PROJECT_VERSION
export NPM_PKG_TAG=$PROJECT_VERSION
export NPM_PKG_TAG=$PROJECT_VERSION
8 changes: 2 additions & 6 deletions cmd/aries-agent-rest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU=
github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY=
github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-kivik/couchdb v2.0.0+incompatible/go.mod h1:5XJRkAMpBlEVA4q0ktIZjUPYBjoBmRoiWvwUBzP3BOQ=
github.com/go-kivik/kivik v2.0.0+incompatible/go.mod h1:nIuJ8z4ikBrVUSk3Ua8NoDqYKULPNjuddjqRvlSUyyQ=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
Expand Down
10 changes: 5 additions & 5 deletions cmd/aries-agent-rest/startcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ func createFlags(startCmd *cobra.Command) {
startCmd.Flags().StringP(agentTransportReturnRouteFlagName, "", "", agentTransportReturnRouteFlagUsage)
}

func getUserSetVar(cmd *cobra.Command, hostFlagName, envKey string, isOptional bool) (string, error) {
if cmd.Flags().Changed(hostFlagName) {
value, err := cmd.Flags().GetString(hostFlagName)
func getUserSetVar(cmd *cobra.Command, flagName, envKey string, isOptional bool) (string, error) {
if cmd.Flags().Changed(flagName) {
value, err := cmd.Flags().GetString(flagName)
if err != nil {
return "", fmt.Errorf(hostFlagName+" flag not found: %s", err)
return "", fmt.Errorf(flagName+" flag not found: %s", err)
}

return value, nil
Expand All @@ -331,7 +331,7 @@ func getUserSetVar(cmd *cobra.Command, hostFlagName, envKey string, isOptional b
return value, nil
}

return "", errors.New("Neither " + hostFlagName + " (command line flag) nor " + envKey +
return "", errors.New("Neither " + flagName + " (command line flag) nor " + envKey +
" (environment variable) have been set.")
}

Expand Down
18 changes: 18 additions & 0 deletions cmd/aries-js-worker/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright SecureKey Technologies Inc. All Rights Reserved.
//
// SPDX-License-Identifier: Apache-2.0

module github.com/hyperledger/aries-framework-go/cmd/aries-js-worker

go 1.13

require (
github.com/google/uuid v1.1.1
github.com/hyperledger/aries-framework-go v0.0.0
github.com/mitchellh/mapstructure v1.3.0
github.com/stretchr/testify v1.5.1
)

replace github.com/hyperledger/aries-framework-go => ../../

replace github.com/piprate/json-gold => github.com/trustbloc/json-gold v0.3.1-0.20200414173446-30d742ee949e
222 changes: 222 additions & 0 deletions cmd/aries-js-worker/go.sum

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions cmd/aries-js-worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ import (
"syscall/js"
"time"

"github.com/mitchellh/mapstructure"

"github.com/google/uuid"
"github.com/mitchellh/mapstructure"

"github.com/hyperledger/aries-framework-go/pkg/common/log"
"github.com/hyperledger/aries-framework-go/pkg/controller"
Expand All @@ -38,6 +37,7 @@ const (
ariesCommandPkg = "aries"
ariesStartFn = "Start"
ariesStopFn = "Stop"
workers = 2
)

var logger = log.New("aries-js-worker")
Expand Down Expand Up @@ -104,6 +104,7 @@ func takeFrom(in chan *command) func(js.Value, []js.Value) interface{} {

return nil
}

in <- cmd

return nil
Expand All @@ -115,6 +116,12 @@ func pipe(input chan *command, output chan *result) {

addAriesHandlers(handlers)

for w := 0; w < workers; w++ {
go worker(input, output, handlers)
}
}

func worker(input chan *command, output chan *result, handlers map[string]map[string]func(*command) *result) {
for c := range input {
if c.ID == "" {
logger.Warnf("aries wasm: missing ID for input: %v", c)
Expand Down
132 changes: 131 additions & 1 deletion cmd/aries-js-worker/src/agent-rest-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ const pkgs = {
method: "GET",
pathParam:"id"
},
ResolveDID: {
path: "/vdri/did/resolve/{id}",
method: "GET",
pathParam:"id"
},
GetDIDs: {
path: "/vdri/did/records",
method: "GET",
Expand Down Expand Up @@ -140,6 +145,131 @@ const pkgs = {
method: "GET",
pathParam:"id"
},
SavePresentation: {
path: "/verifiable/presentation",
method: "POST"
},
GetPresentation: {
path: "/verifiable/presentation/{id}",
method: "GET",
pathParam:"id"
},
GetPresentations: {
path: "/verifiable/presentations",
method: "GET",
},
},
issuecredential:{
Actions: {
path: "/issuecredential/actions",
method: "GET",
},
SendOffer: {
path: "/issuecredential/send-offer",
method: "POST",
},
SendProposal: {
path: "/issuecredential/send-proposal",
method: "POST",
},
SendRequest: {
path: "/issuecredential/send-request",
method: "POST",
},
AcceptProposal: {
path: "/issuecredential/{piid}/accept-proposal",
method: "POST",
pathParam:"piid"
},
DeclineProposal: {
path: "/issuecredential/{piid}/decline-proposal",
method: "POST",
pathParam:"piid"
},
AcceptOffer: {
path: "/issuecredential/{piid}/accept-offer",
method: "POST",
pathParam:"piid"
},
DeclineOffer: {
path: "/issuecredential/{piid}/decline-offer",
method: "POST",
pathParam:"piid"
},
NegotiateProposal: {
path: "/issuecredential/{piid}/negotiate-proposal",
method: "POST",
pathParam:"piid"
},
AcceptRequest: {
path: "/issuecredential/{piid}/accept-request",
method: "POST",
pathParam:"piid"
},
DeclineRequest: {
path: "/issuecredential/{piid}/decline-request",
method: "POST",
pathParam:"piid"
},
AcceptCredential: {
path: "/issuecredential/{piid}/accept-credential",
method: "POST",
pathParam:"piid"
},
DeclineCredential: {
path: "/issuecredential/{piid}/decline-credential",
method: "POST",
pathParam:"piid"
},
},
presentproof:{
Actions: {
path: "/presentproof/actions",
method: "GET",
},
SendRequestPresentation: {
path: "/presentproof/send-request-presentation",
method: "POST",
},
SendProposePresentation: {
path: "/presentproof/send-propose-presentation",
method: "POST",
},
AcceptRequestPresentation: {
path: "/presentproof/{piid}/accept-request-presentation",
method: "POST",
pathParam:"piid"
},
AcceptProposePresentation: {
path: "/presentproof/{piid}/accept-propose-presentation",
method: "POST",
pathParam:"piid"
},
AcceptPresentation: {
path: "/presentproof/{piid}/accept-presentation",
method: "POST",
pathParam:"piid"
},
NegotiateRequestPresentation: {
path: "/presentproof/{piid}/negotiate-request-presentation",
method: "POST",
pathParam:"piid"
},
DeclineRequestPresentation: {
path: "/presentproof/{piid}/decline-request-presentation",
method: "POST",
pathParam:"piid"
},
DeclineProposePresentation: {
path: "/presentproof/{piid}/decline-propose-presentation",
method: "POST",
pathParam:"piid"
},
DeclinePresentation: {
path: "/presentproof/{piid}/decline-presentation",
method: "POST",
pathParam:"piid"
},
},
kms: {
CreateKeySet: {
Expand Down Expand Up @@ -191,7 +321,7 @@ export const Client = class {
method: r.method,
url: url,
headers: headers,
data: request.payload
data: (request.payload && 'body' in request.payload) ? request.payload.body : request.payload
});

return resp.data;
Expand Down

0 comments on commit 8235be3

Please sign in to comment.