Skip to content

Commit

Permalink
[FAB-9410] Import Discovery Client
Browse files Browse the repository at this point in the history
Change-Id: I9d124ae5c5331dca02c0d5e83bd08583255ed897
Signed-off-by: Bob Stasyszyn <Bob.Stasyszyn@securekey.com>
  • Loading branch information
bstasyszyn committed Apr 8, 2018
1 parent 26b9f7c commit db394dc
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 77 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ FABRIC_DEV_REGISTRY_PRE_CMD ?= docker login -u docker -p docker nexus3.hyperledg
THIRDPARTY_FABRIC_CA_BRANCH ?= master
THIRDPARTY_FABRIC_CA_COMMIT ?= v1.1.0
THIRDPARTY_FABRIC_BRANCH ?= master
THIRDPARTY_FABRIC_COMMIT ?= 30806c107fe89e29d6c80b6244a57477242f241f
THIRDPARTY_FABRIC_COMMIT ?= 68f268379c78cabbd4325fc2e40059a8c46912ae

# Force removal of images in cleanup (overridable)
FIXTURE_DOCKER_REMOVE_FORCE ?= false
Expand Down
48 changes: 33 additions & 15 deletions internal/github.com/hyperledger/fabric/common/crypto/signer.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
/*
Copyright IBM Corp. 2016 All Rights Reserved.
Copyright IBM Corp. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/
/*
Notice: This file has been modified for Hyperledger Fabric SDK Go usage.
Expand All @@ -20,13 +10,41 @@ Please review third_party pinning scripts and patches for more details.

package crypto

import cb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common"
import (
cb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common"
)

// LocalSigner is a temporary stub interface which will be implemented by the local MSP
type LocalSigner interface {
SignatureHeaderMaker
Signer
}

// Signer signs messages
type Signer interface {
// Sign a message and return the signature over the digest, or error on failure
Sign(message []byte) ([]byte, error)
}

// IdentitySerializer serializes identities
type IdentitySerializer interface {
// Serialize converts an identity to bytes
Serialize() ([]byte, error)
}

// SignatureHeaderMaker creates a new SignatureHeader
type SignatureHeaderMaker interface {
// NewSignatureHeader creates a SignatureHeader with the correct signing identity and a valid nonce
NewSignatureHeader() (*cb.SignatureHeader, error)
}

// Sign a message which should embed a signature header created by NewSignatureHeader
Sign(message []byte) ([]byte, error)
// SignatureHeaderCreator creates signature headers
type SignatureHeaderCreator struct {
SignerSupport
}

// SignerSupport implements the needed support for LocalSigner
type SignerSupport interface {
Signer
IdentitySerializer
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (c *client) Send(ctx context.Context, req *Request) (Response, error) {
return nil, errors.Wrap(err, "failed connecting to discovery service")
}

defer conn.Close()
defer func() {
req.Queries = nil
}()
Expand Down
124 changes: 64 additions & 60 deletions third_party/github.com/hyperledger/fabric/protos/common/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit db394dc

Please sign in to comment.