github.com/xiaqingdoc/fabric@v2.1.1+incompatible/core/handlers/auth/plugin/filter.go (about)

     1  /*
     2  Copyright IBM Corp, SecureKey Technologies Inc. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package main
     8  
     9  import (
    10  	"context"
    11  
    12  	"github.com/hyperledger/fabric-protos-go/peer"
    13  	"github.com/hyperledger/fabric/core/handlers/auth"
    14  )
    15  
    16  // NewFilter creates a new Filter
    17  func NewFilter() auth.Filter {
    18  	return &filter{}
    19  }
    20  
    21  type filter struct {
    22  	next peer.EndorserServer
    23  }
    24  
    25  // Init initializes the Filter with the next EndorserServer
    26  func (f *filter) Init(next peer.EndorserServer) {
    27  	f.next = next
    28  }
    29  
    30  // ProcessProposal processes a signed proposal
    31  func (f *filter) ProcessProposal(ctx context.Context, signedProp *peer.SignedProposal) (*peer.ProposalResponse, error) {
    32  	return f.next.ProcessProposal(ctx, signedProp)
    33  }
    34  
    35  func main() {
    36  }