owner

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 34 Imported by: 11

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 methods names {service_name}Chaincode_{method_name}
  • chaincode interface definition {service_name}Chaincode
  • chaincode gateway definition {service_name}}Gateway
  • 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 (

	// ChaincodeOwnerServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode
	ChaincodeOwnerServiceChaincodeMethodPrefix = "ChaincodeOwnerService."

	ChaincodeOwnerServiceChaincode_GetOwnerByTxCreator = ChaincodeOwnerServiceChaincodeMethodPrefix + "GetOwnerByTxCreator"

	ChaincodeOwnerServiceChaincode_ListOwners = ChaincodeOwnerServiceChaincodeMethodPrefix + "ListOwners"

	ChaincodeOwnerServiceChaincode_GetOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "GetOwner"

	ChaincodeOwnerServiceChaincode_CreateOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "CreateOwner"

	ChaincodeOwnerServiceChaincode_CreateOwnerTxCreator = ChaincodeOwnerServiceChaincodeMethodPrefix + "CreateOwnerTxCreator"

	ChaincodeOwnerServiceChaincode_UpdateOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "UpdateOwner"

	ChaincodeOwnerServiceChaincode_DeleteOwner = ChaincodeOwnerServiceChaincodeMethodPrefix + "DeleteOwner"
)

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`)

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

	EventMappings = m.EventMappings{}.
					Add(&ChaincodeOwnerCreated{}).
					Add(&ChaincodeOwnerUpdated{}).
					Add(&ChaincodeOwnerDeleted{})
)
View Source
var ChaincodeOwnerServiceSwagger []byte
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 from 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 set

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, _ ...int) router.HandlerFunc

Only allow access from chain code owner

func Query

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

Query 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. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeOwnerServiceHandlerFromEndpoint instead.

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 from 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 *timestamppb.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 *timestamppb.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() *timestamppb.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() *timestamppb.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 ChaincodeOwnerCreated added in v0.10.1

type ChaincodeOwnerCreated 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 *timestamppb.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 (*ChaincodeOwnerCreated) Descriptor deprecated added in v0.10.1

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

Deprecated: Use ChaincodeOwnerCreated.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerCreated) GetExpiresAt added in v0.10.1

func (x *ChaincodeOwnerCreated) GetExpiresAt() *timestamppb.Timestamp

func (*ChaincodeOwnerCreated) GetIssuer added in v0.10.1

func (x *ChaincodeOwnerCreated) GetIssuer() string

func (*ChaincodeOwnerCreated) GetMspId added in v0.10.1

func (x *ChaincodeOwnerCreated) GetMspId() string

func (*ChaincodeOwnerCreated) GetSubject added in v0.10.1

func (x *ChaincodeOwnerCreated) GetSubject() string

func (*ChaincodeOwnerCreated) ProtoMessage added in v0.10.1

func (*ChaincodeOwnerCreated) ProtoMessage()

func (*ChaincodeOwnerCreated) ProtoReflect added in v0.10.1

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

func (*ChaincodeOwnerCreated) Reset added in v0.10.1

func (x *ChaincodeOwnerCreated) Reset()

func (*ChaincodeOwnerCreated) String added in v0.10.1

func (x *ChaincodeOwnerCreated) String() string

func (*ChaincodeOwnerCreated) Validate added in v0.10.1

func (this *ChaincodeOwnerCreated) 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 ChaincodeOwnerService added in v0.8.2

type ChaincodeOwnerService struct{}

func NewService added in v0.8.2

func NewService() *ChaincodeOwnerService

func (*ChaincodeOwnerService) CreateOwner added in v0.10.1

func (*ChaincodeOwnerService) CreateOwnerTxCreator added in v0.10.1

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

func (ChaincodeOwnerService) DeleteOwner added in v0.10.1

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

func (*ChaincodeOwnerService) GetOwner added in v0.10.1

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

func (*ChaincodeOwnerService) GetOwnerByTxCreator added in v0.10.1

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

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) ListOwners added in v0.10.1

func (*ChaincodeOwnerService) RegisterTxCreator added in v0.8.2

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

RegisterTxCreator Wrapper for OwnerRegisterTxCreator

func (ChaincodeOwnerService) UpdateOwner added in v0.10.1

func (c ChaincodeOwnerService) UpdateOwner(ctx router.Context, updateRequest *UpdateOwnerRequest) (*ChaincodeOwner, error)

type ChaincodeOwnerServiceChaincode added in v0.8.2

ChaincodeOwnerServiceChaincode chaincode methods interface

type ChaincodeOwnerServiceClient added in v0.8.2

type ChaincodeOwnerServiceClient interface {
	// Checks tx creator is owner
	GetOwnerByTxCreator(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Get owners list
	ListOwners(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwners, error)
	// Get owner by msp_id and certificate subject
	GetOwner(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
	CreateOwner(ctx context.Context, in *CreateOwnerRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Register tx creator as chaincode owner
	CreateOwnerTxCreator(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	//  Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate
	UpdateOwner(ctx context.Context, in *UpdateOwnerRequest, opts ...grpc.CallOption) (*ChaincodeOwner, error)
	// Delete owner
	DeleteOwner(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 {
	ChaincodeInstance cckit_gateway.ChaincodeInstance
}

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(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *ChaincodeOwnerServiceGateway

NewChaincodeOwnerServiceGateway creates gateway to access chaincode method via chaincode service

func NewChaincodeOwnerServiceGatewayFromInstance added in v0.10.1

func NewChaincodeOwnerServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *ChaincodeOwnerServiceGateway

func (*ChaincodeOwnerServiceGateway) CreateOwner added in v0.10.1

func (*ChaincodeOwnerServiceGateway) CreateOwnerTxCreator added in v0.10.1

func (c *ChaincodeOwnerServiceGateway) CreateOwnerTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)

func (*ChaincodeOwnerServiceGateway) DeleteOwner added in v0.10.1

func (*ChaincodeOwnerServiceGateway) GetOwner added in v0.10.1

func (*ChaincodeOwnerServiceGateway) GetOwnerByTxCreator added in v0.10.1

func (c *ChaincodeOwnerServiceGateway) GetOwnerByTxCreator(ctx context.Context, in *emptypb.Empty) (*ChaincodeOwner, error)

func (*ChaincodeOwnerServiceGateway) Invoker added in v0.10.1

func (*ChaincodeOwnerServiceGateway) ListOwners added in v0.10.1

func (*ChaincodeOwnerServiceGateway) ServiceDef added in v0.8.2

ServiceDef returns service definition

func (*ChaincodeOwnerServiceGateway) UpdateOwner added in v0.10.1

type ChaincodeOwnerServiceServer added in v0.8.2

type ChaincodeOwnerServiceServer interface {
	// Checks tx creator is owner
	GetOwnerByTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
	// Get owners list
	ListOwners(context.Context, *emptypb.Empty) (*ChaincodeOwners, error)
	// Get owner by msp_id and certificate subject
	GetOwner(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
	CreateOwner(context.Context, *CreateOwnerRequest) (*ChaincodeOwner, error)
	// Register tx creator as chaincode owner
	CreateOwnerTxCreator(context.Context, *emptypb.Empty) (*ChaincodeOwner, error)
	//  Update chaincode owner. Msp id and certificate subject must be equal to current owner certificate
	UpdateOwner(context.Context, *UpdateOwnerRequest) (*ChaincodeOwner, error)
	// Delete owner
	DeleteOwner(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 *timestamppb.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() *timestamppb.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 CreateOwnerRequest added in v0.10.1

type CreateOwnerRequest 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 (*CreateOwnerRequest) Descriptor deprecated added in v0.10.1

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

Deprecated: Use CreateOwnerRequest.ProtoReflect.Descriptor instead.

func (*CreateOwnerRequest) GetCert added in v0.10.1

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

func (*CreateOwnerRequest) GetMspId added in v0.10.1

func (x *CreateOwnerRequest) GetMspId() string

func (*CreateOwnerRequest) ProtoMessage added in v0.10.1

func (*CreateOwnerRequest) ProtoMessage()

func (*CreateOwnerRequest) ProtoReflect added in v0.10.1

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

func (*CreateOwnerRequest) Reset added in v0.10.1

func (x *CreateOwnerRequest) Reset()

func (*CreateOwnerRequest) String added in v0.10.1

func (x *CreateOwnerRequest) String() string

func (*CreateOwnerRequest) Validate added in v0.10.1

func (this *CreateOwnerRequest) 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 UnimplementedChaincodeOwnerServiceServer added in v0.8.2

type UnimplementedChaincodeOwnerServiceServer struct {
}

UnimplementedChaincodeOwnerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeOwnerServiceServer) CreateOwner added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) CreateOwnerTxCreator added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) DeleteOwner added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) GetOwner added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) GetOwnerByTxCreator added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) ListOwners added in v0.10.1

func (*UnimplementedChaincodeOwnerServiceServer) UpdateOwner added in v0.10.1

type UpdateOwnerRequest added in v0.10.1

type UpdateOwnerRequest 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 (*UpdateOwnerRequest) Descriptor deprecated added in v0.10.1

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

Deprecated: Use UpdateOwnerRequest.ProtoReflect.Descriptor instead.

func (*UpdateOwnerRequest) GetCert added in v0.10.1

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

func (*UpdateOwnerRequest) GetMspId added in v0.10.1

func (x *UpdateOwnerRequest) GetMspId() string

func (*UpdateOwnerRequest) ProtoMessage added in v0.10.1

func (*UpdateOwnerRequest) ProtoMessage()

func (*UpdateOwnerRequest) ProtoReflect added in v0.10.1

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

func (*UpdateOwnerRequest) Reset added in v0.10.1

func (x *UpdateOwnerRequest) Reset()

func (*UpdateOwnerRequest) String added in v0.10.1

func (x *UpdateOwnerRequest) String() string

func (*UpdateOwnerRequest) Validate added in v0.10.1

func (this *UpdateOwnerRequest) Validate() error

Jump to

Keyboard shortcuts

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