owner

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 32 Imported by: 12

README

Owner - access control hyperledger fabric chaincode extension

In many cases during chaincode instantiating we need to define permissions for chaincode functions - "who is allowed to do this thing", incredibly important in the world of smart contracts, but in many examples access control implemented at the application level but not at the blockchain layer.

The most common and basic form of access control is the concept of ownership: there's one or more accounts (in case of Hyperledger Fabric chaincode model - combination of MSP and certificate) that is the owners and can do administrative tasks on contracts. This approach is perfectly reasonable for contracts that only have a single administrative user.

CCKit provides owner extension for implementing ownership and access control in Hyperledger Fabric chaincodes.

Owner extension implemented in two version:

  1. As chaincode handlers
  2. As service, that can be embedded in chaincode, using chaincode-as-service mode

Documentation

Overview

Package owner contains

  • chaincode interface definition
  • chaincode gateway definition
  • chaincode service to cckit router registration func

Package owner is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package owner provides method for storing in chaincode state information about chaincode owner

Index

Constants

View Source
const (
	ChaincodeOwnerServiceChaincode_TxCreatorIsOwner = "TxCreatorIsOwner"

	ChaincodeOwnerServiceChaincode_OwnersList = "OwnersList"

	ChaincodeOwnerServiceChaincode_OwnerGet = "OwnerGet"

	ChaincodeOwnerServiceChaincode_OwnerRegister = "OwnerRegister"

	ChaincodeOwnerServiceChaincode_OwnerRegisterTxCreator = "OwnerRegisterTxCreator"

	ChaincodeOwnerServiceChaincode_OwnerUpdate = "OwnerUpdate"

	ChaincodeOwnerServiceChaincode_OwnerDelete = "OwnerDelete"
)

ChaincodeOwnerServiceChaincode method names

View Source
const OwnerStateKey = `OWNER`

OwnerStateKey key used to store owner grant struct in chain code state "handler" part of owner extension supports only one owner "service" part of owner extension supports multiple owners

View Source
const QueryMethod = `owner`

Variables

View Source
var (
	ErrTxInvokerIsNotOwner         = errors.New(`tx invoker is not owner`)
	ErrDeleteLastOwnerIsNotAllowed = errors.New(`delete last owner is not allowed`)
	ErrNewCertSameAsOldCert        = errors.New(`new cert same as old cert`)
)
View Source
var (
	// ErrOwnerNotProvided occurs when providing owner identity in init arguments
	ErrOwnerNotProvided = errors.New(`owner not provided`)

	// ErrOwnerAlreadySetted owner already setted
	ErrOwnerAlreadySetted = errors.New(`owner already setted`)
)
View Source
var (
	StateMappings = m.StateMappings{}.
					Add(&ChaincodeOwner{},
			m.PKeySchema(&OwnerId{}),
			m.List(&ChaincodeOwners{}))

	EventMappings = m.EventMappings{}.
					Add(&ChaincodeOwnerRegistered{}).
					Add(&ChaincodeOwnerUpdated{}).
					Add(&ChaincodeOwnerDeleted{})
)
View Source
var (
	// ErrOwnerOnly error occurs when trying to invoke chaincode func  protected by onlyOwner middleware (modifier)
	ErrOwnerOnly = errors.New(`owner only`)
)
View Source
var File_owner_chaincode_owner_proto protoreflect.FileDescriptor

Functions

func Event added in v0.8.2

func Event(ctx router.Context) state.Event

func Get

func Get(c r.Context) (*identity.Entry, error)

Get returns current chaincode owner identity.Entry Service implementation recommended, see chaincode_owner.proto

func IdentityEntryFromState

func IdentityEntryFromState(c r.Context) (identity.Entry, error)

IdentityEntryFromState returns identity.Entry with chaincode owner certificate Service implementation recommended, see chaincode_owner.proto

func Insert

func Insert(c r.Context, mspID string, cert []byte) (*identity.Entry, error)

Insert information about owner to chaincode state

func InvokeSetFromArgs added in v0.3.0

func InvokeSetFromArgs(c router.Context) (interface{}, error)

InvokeSetFromArgs gets owner data fron args[0] (Msp Id) and arg[1] (cert)

func InvokeSetFromCreator added in v0.3.0

func InvokeSetFromCreator(c router.Context) (interface{}, error)

InvokeSetFromCreator sets tx creator as chaincode owner, if owner not previously setted

func IsInvoker

func IsInvoker(ctx r.Context) (bool, error)

IsInvoker checks than tx creator is chain code owner Service implementation recommended, see chaincode_owner.proto

func IsInvokerOr

func IsInvokerOr(c r.Context, allowedTo ...identity.Identity) (bool, error)

IsInvokerOr checks tx creator and compares with owner of another identity Service implementation recommended, see chaincode_owner.proto

func IsSet added in v0.8.2

func IsSet(c r.Context) (bool, error)

func IsTxCreator added in v0.7.8

func IsTxCreator(ctx r.Context) error

IsTxCreator returns error if owner identity (msp_id + certificate) did not match tx creator identity Service implementation recommended, see chaincode_owner.proto

func Only

func Only(next router.HandlerFunc, pos ...int) router.HandlerFunc

Only allow access from chain code owner

func Query

func Query(c router.Context) (interface{}, error)

FromState returns raw data ( serialized Grant ) of current chain code owner

func RegisterChaincodeOwnerServiceChaincode added in v0.8.2

func RegisterChaincodeOwnerServiceChaincode(r *cckit_router.Group, cc ChaincodeOwnerServiceChaincode) error

RegisterChaincodeOwnerServiceChaincode registers service methods as chaincode router handlers

func RegisterChaincodeOwnerServiceHandler added in v0.8.2

func RegisterChaincodeOwnerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeOwnerServiceHandler registers the http handlers for service ChaincodeOwnerService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeOwnerServiceHandlerClient added in v0.8.2

func RegisterChaincodeOwnerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeOwnerServiceClient) error

RegisterChaincodeOwnerServiceHandlerClient registers the http handlers for service ChaincodeOwnerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeOwnerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeOwnerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeOwnerServiceClient" to call the correct interceptors.

func RegisterChaincodeOwnerServiceHandlerFromEndpoint added in v0.8.2

func RegisterChaincodeOwnerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterChaincodeOwnerServiceHandlerFromEndpoint is same as RegisterChaincodeOwnerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeOwnerServiceHandlerServer added in v0.8.2

func RegisterChaincodeOwnerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeOwnerServiceServer) error

RegisterChaincodeOwnerServiceHandlerServer registers the http handlers for service ChaincodeOwnerService to "mux". UnaryRPC :call ChaincodeOwnerServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterChaincodeOwnerServiceServer added in v0.8.2

func RegisterChaincodeOwnerServiceServer(s *grpc.Server, srv ChaincodeOwnerServiceServer)

func SetFromArgs

func SetFromArgs(c r.Context) (*identity.Entry, error)

SetFromArgs set owner fron first args

func SetFromCreator

func SetFromCreator(c r.Context) (*identity.Entry, error)

SetFromCreator sets chain code owner from stub creator Service implementation recommended, see chaincode_owner.proto

func State added in v0.8.2

func State(ctx router.Context) m.MappedState

Types

type ChaincodeOwner added in v0.8.2

type ChaincodeOwner struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	//  certificate subject
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	//  certificate issuer
	Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"`
	// cert valid not after
	ExpiresAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// Certificate
	Cert []byte `protobuf:"bytes,5,opt,name=cert,proto3" json:"cert,omitempty"`
	// Creator identity info
	UpdatedByMspId string `protobuf:"bytes,6,opt,name=updated_by_msp_id,json=updatedByMspId,proto3" json:"updated_by_msp_id,omitempty"`
	// Certificate
	UpdatedByCert []byte `protobuf:"bytes,7,opt,name=updated_by_cert,json=updatedByCert,proto3" json:"updated_by_cert,omitempty"`
	// Updated at
	UpdatedAt *timestamp.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

State: information stored in chaincode state about chaincode owner

func (*ChaincodeOwner) Descriptor deprecated added in v0.8.2

func (*ChaincodeOwner) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeOwner.ProtoReflect.Descriptor instead.

func (*ChaincodeOwner) GetCert added in v0.8.2

func (x *ChaincodeOwner) GetCert() []byte

func (*ChaincodeOwner) GetExpiresAt added in v0.8.2

func (x *ChaincodeOwner) GetExpiresAt() *timestamp.Timestamp

func (*ChaincodeOwner) GetIssuer added in v0.8.2

func (x *ChaincodeOwner) GetIssuer() string

func (*ChaincodeOwner) GetMSPIdentifier added in v0.8.2

func (x *ChaincodeOwner) GetMSPIdentifier() string

func (*ChaincodeOwner) GetMspId added in v0.8.2

func (x *ChaincodeOwner) GetMspId() string

func (*ChaincodeOwner) GetSubject added in v0.8.2

func (x *ChaincodeOwner) GetSubject() string

func (*ChaincodeOwner) GetUpdatedAt added in v0.8.2

func (x *ChaincodeOwner) GetUpdatedAt() *timestamp.Timestamp

func (*ChaincodeOwner) GetUpdatedByCert added in v0.8.2

func (x *ChaincodeOwner) GetUpdatedByCert() []byte

func (*ChaincodeOwner) GetUpdatedByMspId added in v0.8.2

func (x *ChaincodeOwner) GetUpdatedByMspId() string

func (*ChaincodeOwner) ProtoMessage added in v0.8.2

func (*ChaincodeOwner) ProtoMessage()

func (*ChaincodeOwner) ProtoReflect added in v0.8.2

func (x *ChaincodeOwner) ProtoReflect() protoreflect.Message

func (*ChaincodeOwner) Reset added in v0.8.2

func (x *ChaincodeOwner) Reset()

func (*ChaincodeOwner) String added in v0.8.2

func (x *ChaincodeOwner) String() string

func (*ChaincodeOwner) Validate added in v0.8.2

func (this *ChaincodeOwner) Validate() error

type ChaincodeOwnerDeleted added in v0.8.2

type ChaincodeOwnerDeleted struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// certificate subject
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// contains filtered or unexported fields
}

Event: chaincode owner deleted`

func (*ChaincodeOwnerDeleted) Descriptor deprecated added in v0.8.2

func (*ChaincodeOwnerDeleted) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeOwnerDeleted.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerDeleted) GetMspId added in v0.8.2

func (x *ChaincodeOwnerDeleted) GetMspId() string

func (*ChaincodeOwnerDeleted) GetSubject added in v0.8.2

func (x *ChaincodeOwnerDeleted) GetSubject() string

func (*ChaincodeOwnerDeleted) ProtoMessage added in v0.8.2

func (*ChaincodeOwnerDeleted) ProtoMessage()

func (*ChaincodeOwnerDeleted) ProtoReflect added in v0.8.2

func (x *ChaincodeOwnerDeleted) ProtoReflect() protoreflect.Message

func (*ChaincodeOwnerDeleted) Reset added in v0.8.2

func (x *ChaincodeOwnerDeleted) Reset()

func (*ChaincodeOwnerDeleted) String added in v0.8.2

func (x *ChaincodeOwnerDeleted) String() string

func (*ChaincodeOwnerDeleted) Validate added in v0.8.2

func (this *ChaincodeOwnerDeleted) Validate() error

type ChaincodeOwnerRegistered added in v0.8.2

type ChaincodeOwnerRegistered struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// certificate subject
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	//  certificate issuer
	Issuer string `protobuf:"bytes,3,opt,name=issuer,proto3" json:"issuer,omitempty"`
	// cert valid not after
	ExpiresAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

Event: new chaincode owner registered

func (*ChaincodeOwnerRegistered) Descriptor deprecated added in v0.8.2

func (*ChaincodeOwnerRegistered) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeOwnerRegistered.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerRegistered) GetExpiresAt added in v0.8.2

func (x *ChaincodeOwnerRegistered) GetExpiresAt() *timestamp.Timestamp

func (*ChaincodeOwnerRegistered) GetIssuer added in v0.8.2

func (x *ChaincodeOwnerRegistered) GetIssuer() string

func (*ChaincodeOwnerRegistered) GetMspId added in v0.8.2

func (x *ChaincodeOwnerRegistered) GetMspId() string

func (*ChaincodeOwnerRegistered) GetSubject added in v0.8.2

func (x *ChaincodeOwnerRegistered) GetSubject() string

func (*ChaincodeOwnerRegistered) ProtoMessage added in v0.8.2

func (*ChaincodeOwnerRegistered) ProtoMessage()

func (*ChaincodeOwnerRegistered) ProtoReflect added in v0.8.2

func (x *ChaincodeOwnerRegistered) ProtoReflect() protoreflect.Message

func (*ChaincodeOwnerRegistered) Reset added in v0.8.2

func (x *ChaincodeOwnerRegistered) Reset()

func (*ChaincodeOwnerRegistered) String added in v0.8.2

func (x *ChaincodeOwnerRegistered) String() string

func (*ChaincodeOwnerRegistered) Validate added in v0.8.2

func (this *ChaincodeOwnerRegistered) Validate() error

type ChaincodeOwnerService added in v0.8.2

type ChaincodeOwnerService struct {
}

func NewService added in v0.8.2

func NewService() *ChaincodeOwnerService

func (*ChaincodeOwnerService) IsTxCreator added in v0.8.2

func (c *ChaincodeOwnerService) IsTxCreator(ctx router.Context) (*ChaincodeOwner, error)

IsTxCreator - wrapper for TxCreatorIsOwner for local calls

func (ChaincodeOwnerService) OwnerDelete added in v0.8.2

func (c ChaincodeOwnerService) OwnerDelete(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)

func (*ChaincodeOwnerService) OwnerGet added in v0.8.2

func (c *ChaincodeOwnerService) OwnerGet(ctx router.Context, id *OwnerId) (*ChaincodeOwner, error)

func (*ChaincodeOwnerService) OwnerRegister added in v0.8.2

func (c *ChaincodeOwnerService) OwnerRegister(ctx router.Context, registerRequest *OwnerRegisterRequest) (*ChaincodeOwner, error)

func (*ChaincodeOwnerService) OwnerRegisterTxCreator added in v0.8.2

func (c *ChaincodeOwnerService) OwnerRegisterTxCreator(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)

func (ChaincodeOwnerService) OwnerUpdate added in v0.8.2

func (c ChaincodeOwnerService) OwnerUpdate(ctx router.Context, updateRequest *OwnerUpdateRequest) (*ChaincodeOwner, error)

func (*ChaincodeOwnerService) OwnersList added in v0.8.2

func (*ChaincodeOwnerService) RegisterTxCreator added in v0.8.2

func (c *ChaincodeOwnerService) RegisterTxCreator(ctx router.Context) (*ChaincodeOwner, error)

RegisterTxCreator Wrapper for OwnerRegisterTxCreator

func (*ChaincodeOwnerService) TxCreatorIsOwner added in v0.8.2

func (c *ChaincodeOwnerService) TxCreatorIsOwner(ctx router.Context, _ *empty.Empty) (*ChaincodeOwner, error)

type ChaincodeOwnerServiceChaincode added in v0.8.2

type ChaincodeOwnerServiceChaincode interface {
	TxCreatorIsOwner(cckit_router.Context, *empty.Empty) (*ChaincodeOwner, error)

	OwnersList(cckit_router.Context, *empty.Empty) (*ChaincodeOwners, error)

	OwnerGet(cckit_router.Context, *OwnerId) (*ChaincodeOwner, error)

	OwnerRegister(cckit_router.Context, *OwnerRegisterRequest) (*ChaincodeOwner, error)

	OwnerRegisterTxCreator(cckit_router.Context, *empty.Empty) (*ChaincodeOwner, error)

	OwnerUpdate(cckit_router.Context, *OwnerUpdateRequest) (*ChaincodeOwner, error)

	OwnerDelete(cckit_router.Context, *OwnerId) (*ChaincodeOwner, error)
}

ChaincodeOwnerServiceChaincode chaincode methods interface

type ChaincodeOwnerServiceChaincodeResolver added in v0.8.2

type ChaincodeOwnerServiceChaincodeResolver interface {
	ChaincodeOwnerServiceChaincode(ctx cckit_router.Context) (ChaincodeOwnerServiceChaincode, error)
}

ChaincodeOwnerServiceChaincodeResolver interface for service resolver

type ChaincodeOwnerServiceClient added in v0.8.2

type ChaincodeOwnerServiceClient interface {
	// Checks tx creator is owner
	TxCreatorIsOwner(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Get owners list
	OwnersList(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ChaincodeOwners, error)
	// Get owner by msp_id and certificate subject
	OwnerGet(ctx context.Context, in *OwnerId, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Register new chaincode owner, method can be call by current owner or if no owner exists
	// If chaincode owner with same MspID, certificate subject and issuer exists - throws error
	OwnerRegister(ctx context.Context, in *OwnerRegisterRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Register tx creator as chaincode owner
	OwnerRegisterTxCreator(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	//  Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate
	OwnerUpdate(ctx context.Context, in *OwnerUpdateRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Delete owner
	OwnerDelete(ctx context.Context, in *OwnerId, opts ...grpc.CallOption) (*ChaincodeOwner, error)
}

ChaincodeOwnerServiceClient is the client API for ChaincodeOwnerService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewChaincodeOwnerServiceClient added in v0.8.2

func NewChaincodeOwnerServiceClient(cc grpc.ClientConnInterface) ChaincodeOwnerServiceClient

type ChaincodeOwnerServiceGateway added in v0.8.2

type ChaincodeOwnerServiceGateway struct {
	Gateway cckit_gateway.Chaincode
}

gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )

func NewChaincodeOwnerServiceGateway added in v0.8.2

func NewChaincodeOwnerServiceGateway(ccService cckit_ccservice.Chaincode, channel, chaincode string, opts ...cckit_gateway.Opt) *ChaincodeOwnerServiceGateway

NewChaincodeOwnerServiceGateway creates gateway to access chaincode method via chaincode service

func (*ChaincodeOwnerServiceGateway) ApiDef added in v0.8.2

ApiDef deprecated, use ServiceDef

func (*ChaincodeOwnerServiceGateway) Events added in v0.8.2

Events returns events subscription

func (*ChaincodeOwnerServiceGateway) OwnerDelete added in v0.8.2

func (*ChaincodeOwnerServiceGateway) OwnerGet added in v0.8.2

func (*ChaincodeOwnerServiceGateway) OwnerRegister added in v0.8.2

func (*ChaincodeOwnerServiceGateway) OwnerRegisterTxCreator added in v0.8.2

func (c *ChaincodeOwnerServiceGateway) OwnerRegisterTxCreator(ctx context.Context, in *empty.Empty) (*ChaincodeOwner, error)

func (*ChaincodeOwnerServiceGateway) OwnerUpdate added in v0.8.2

func (*ChaincodeOwnerServiceGateway) OwnersList added in v0.8.2

func (*ChaincodeOwnerServiceGateway) ServiceDef added in v0.8.2

ServiceDef returns service definition

func (*ChaincodeOwnerServiceGateway) TxCreatorIsOwner added in v0.8.2

func (c *ChaincodeOwnerServiceGateway) TxCreatorIsOwner(ctx context.Context, in *empty.Empty) (*ChaincodeOwner, error)

type ChaincodeOwnerServiceServer added in v0.8.2

type ChaincodeOwnerServiceServer interface {
	// Checks tx creator is owner
	TxCreatorIsOwner(context.Context, *empty.Empty) (*ChaincodeOwner, error)
	// Get owners list
	OwnersList(context.Context, *empty.Empty) (*ChaincodeOwners, error)
	// Get owner by msp_id and certificate subject
	OwnerGet(context.Context, *OwnerId) (*ChaincodeOwner, error)
	// Register new chaincode owner, method can be call by current owner or if no owner exists
	// If chaincode owner with same MspID, certificate subject and issuer exists - throws error
	OwnerRegister(context.Context, *OwnerRegisterRequest) (*ChaincodeOwner, error)
	// Register tx creator as chaincode owner
	OwnerRegisterTxCreator(context.Context, *empty.Empty) (*ChaincodeOwner, error)
	//  Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate
	OwnerUpdate(context.Context, *OwnerUpdateRequest) (*ChaincodeOwner, error)
	// Delete owner
	OwnerDelete(context.Context, *OwnerId) (*ChaincodeOwner, error)
}

ChaincodeOwnerServiceServer is the server API for ChaincodeOwnerService service.

type ChaincodeOwnerUpdated added in v0.8.2

type ChaincodeOwnerUpdated struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// certificate subject
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// cert valid not after
	ExpiresAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

Event: new chaincode owner registered

func (*ChaincodeOwnerUpdated) Descriptor deprecated added in v0.8.2

func (*ChaincodeOwnerUpdated) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeOwnerUpdated.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerUpdated) GetExpiresAt added in v0.8.2

func (x *ChaincodeOwnerUpdated) GetExpiresAt() *timestamp.Timestamp

func (*ChaincodeOwnerUpdated) GetMspId added in v0.8.2

func (x *ChaincodeOwnerUpdated) GetMspId() string

func (*ChaincodeOwnerUpdated) GetSubject added in v0.8.2

func (x *ChaincodeOwnerUpdated) GetSubject() string

func (*ChaincodeOwnerUpdated) ProtoMessage added in v0.8.2

func (*ChaincodeOwnerUpdated) ProtoMessage()

func (*ChaincodeOwnerUpdated) ProtoReflect added in v0.8.2

func (x *ChaincodeOwnerUpdated) ProtoReflect() protoreflect.Message

func (*ChaincodeOwnerUpdated) Reset added in v0.8.2

func (x *ChaincodeOwnerUpdated) Reset()

func (*ChaincodeOwnerUpdated) String added in v0.8.2

func (x *ChaincodeOwnerUpdated) String() string

func (*ChaincodeOwnerUpdated) Validate added in v0.8.2

func (this *ChaincodeOwnerUpdated) Validate() error

type ChaincodeOwners added in v0.8.2

type ChaincodeOwners struct {
	Items []*ChaincodeOwner `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

List: Chaincode owners

func (*ChaincodeOwners) Descriptor deprecated added in v0.8.2

func (*ChaincodeOwners) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeOwners.ProtoReflect.Descriptor instead.

func (*ChaincodeOwners) GetItems added in v0.8.2

func (x *ChaincodeOwners) GetItems() []*ChaincodeOwner

func (*ChaincodeOwners) ProtoMessage added in v0.8.2

func (*ChaincodeOwners) ProtoMessage()

func (*ChaincodeOwners) ProtoReflect added in v0.8.2

func (x *ChaincodeOwners) ProtoReflect() protoreflect.Message

func (*ChaincodeOwners) Reset added in v0.8.2

func (x *ChaincodeOwners) Reset()

func (*ChaincodeOwners) String added in v0.8.2

func (x *ChaincodeOwners) String() string

func (*ChaincodeOwners) Validate added in v0.8.2

func (this *ChaincodeOwners) Validate() error

type OwnerId added in v0.8.2

type OwnerId struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// Certificate subject
	Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"`
	// contains filtered or unexported fields
}

Id: owner identifier

func (*OwnerId) Descriptor deprecated added in v0.8.2

func (*OwnerId) Descriptor() ([]byte, []int)

Deprecated: Use OwnerId.ProtoReflect.Descriptor instead.

func (*OwnerId) GetMspId added in v0.8.2

func (x *OwnerId) GetMspId() string

func (*OwnerId) GetSubject added in v0.8.2

func (x *OwnerId) GetSubject() string

func (*OwnerId) ProtoMessage added in v0.8.2

func (*OwnerId) ProtoMessage()

func (*OwnerId) ProtoReflect added in v0.8.2

func (x *OwnerId) ProtoReflect() protoreflect.Message

func (*OwnerId) Reset added in v0.8.2

func (x *OwnerId) Reset()

func (*OwnerId) String added in v0.8.2

func (x *OwnerId) String() string

func (*OwnerId) Validate added in v0.8.2

func (this *OwnerId) Validate() error

type OwnerRegisterRequest added in v0.8.2

type OwnerRegisterRequest struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// Certificate
	Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"`
	// contains filtered or unexported fields
}

Request: register owner

func (*OwnerRegisterRequest) Descriptor deprecated added in v0.8.2

func (*OwnerRegisterRequest) Descriptor() ([]byte, []int)

Deprecated: Use OwnerRegisterRequest.ProtoReflect.Descriptor instead.

func (*OwnerRegisterRequest) GetCert added in v0.8.2

func (x *OwnerRegisterRequest) GetCert() []byte

func (*OwnerRegisterRequest) GetMspId added in v0.8.2

func (x *OwnerRegisterRequest) GetMspId() string

func (*OwnerRegisterRequest) ProtoMessage added in v0.8.2

func (*OwnerRegisterRequest) ProtoMessage()

func (*OwnerRegisterRequest) ProtoReflect added in v0.8.2

func (x *OwnerRegisterRequest) ProtoReflect() protoreflect.Message

func (*OwnerRegisterRequest) Reset added in v0.8.2

func (x *OwnerRegisterRequest) Reset()

func (*OwnerRegisterRequest) String added in v0.8.2

func (x *OwnerRegisterRequest) String() string

func (*OwnerRegisterRequest) Validate added in v0.8.2

func (this *OwnerRegisterRequest) Validate() error

type OwnerUpdateRequest added in v0.8.2

type OwnerUpdateRequest struct {

	// Msp Id
	MspId string `protobuf:"bytes,1,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"`
	// Current certificate
	Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"`
	// contains filtered or unexported fields
}

Request: update owner certificate

func (*OwnerUpdateRequest) Descriptor deprecated added in v0.8.2

func (*OwnerUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use OwnerUpdateRequest.ProtoReflect.Descriptor instead.

func (*OwnerUpdateRequest) GetCert added in v0.8.2

func (x *OwnerUpdateRequest) GetCert() []byte

func (*OwnerUpdateRequest) GetMspId added in v0.8.2

func (x *OwnerUpdateRequest) GetMspId() string

func (*OwnerUpdateRequest) ProtoMessage added in v0.8.2

func (*OwnerUpdateRequest) ProtoMessage()

func (*OwnerUpdateRequest) ProtoReflect added in v0.8.2

func (x *OwnerUpdateRequest) ProtoReflect() protoreflect.Message

func (*OwnerUpdateRequest) Reset added in v0.8.2

func (x *OwnerUpdateRequest) Reset()

func (*OwnerUpdateRequest) String added in v0.8.2

func (x *OwnerUpdateRequest) String() string

func (*OwnerUpdateRequest) Validate added in v0.8.2

func (this *OwnerUpdateRequest) Validate() error

type UnimplementedChaincodeOwnerServiceServer added in v0.8.2

type UnimplementedChaincodeOwnerServiceServer struct {
}

UnimplementedChaincodeOwnerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeOwnerServiceServer) OwnerDelete added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) OwnerGet added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) OwnerRegister added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) OwnerRegisterTxCreator added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) OwnerUpdate added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) OwnersList added in v0.8.2

func (*UnimplementedChaincodeOwnerServiceServer) TxCreatorIsOwner added in v0.8.2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL