owner

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

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

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

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

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

func InvokeSetFromCreator

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

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

func IsTxCreator

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

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

RegisterChaincodeOwnerServiceChaincode registers service methods as chaincode router handlers

func RegisterChaincodeOwnerServiceHandler

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

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

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

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

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

func State(ctx router.Context) m.MappedState

Types

type ChaincodeOwner

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

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

Deprecated: Use ChaincodeOwner.ProtoReflect.Descriptor instead.

func (*ChaincodeOwner) GetCert

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

func (*ChaincodeOwner) GetExpiresAt

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

func (*ChaincodeOwner) GetIssuer

func (x *ChaincodeOwner) GetIssuer() string

func (*ChaincodeOwner) GetMSPIdentifier

func (x *ChaincodeOwner) GetMSPIdentifier() string

func (*ChaincodeOwner) GetMspId

func (x *ChaincodeOwner) GetMspId() string

func (*ChaincodeOwner) GetSubject

func (x *ChaincodeOwner) GetSubject() string

func (*ChaincodeOwner) GetUpdatedAt

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

func (*ChaincodeOwner) GetUpdatedByCert

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

func (*ChaincodeOwner) GetUpdatedByMspId

func (x *ChaincodeOwner) GetUpdatedByMspId() string

func (*ChaincodeOwner) ProtoMessage

func (*ChaincodeOwner) ProtoMessage()

func (*ChaincodeOwner) ProtoReflect

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

func (*ChaincodeOwner) Reset

func (x *ChaincodeOwner) Reset()

func (*ChaincodeOwner) String

func (x *ChaincodeOwner) String() string

func (*ChaincodeOwner) Validate

func (this *ChaincodeOwner) Validate() error

type ChaincodeOwnerCreated

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

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

Deprecated: Use ChaincodeOwnerCreated.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerCreated) GetExpiresAt

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

func (*ChaincodeOwnerCreated) GetIssuer

func (x *ChaincodeOwnerCreated) GetIssuer() string

func (*ChaincodeOwnerCreated) GetMspId

func (x *ChaincodeOwnerCreated) GetMspId() string

func (*ChaincodeOwnerCreated) GetSubject

func (x *ChaincodeOwnerCreated) GetSubject() string

func (*ChaincodeOwnerCreated) ProtoMessage

func (*ChaincodeOwnerCreated) ProtoMessage()

func (*ChaincodeOwnerCreated) ProtoReflect

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

func (*ChaincodeOwnerCreated) Reset

func (x *ChaincodeOwnerCreated) Reset()

func (*ChaincodeOwnerCreated) String

func (x *ChaincodeOwnerCreated) String() string

func (*ChaincodeOwnerCreated) Validate

func (this *ChaincodeOwnerCreated) Validate() error

type ChaincodeOwnerDeleted

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

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

Deprecated: Use ChaincodeOwnerDeleted.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerDeleted) GetMspId

func (x *ChaincodeOwnerDeleted) GetMspId() string

func (*ChaincodeOwnerDeleted) GetSubject

func (x *ChaincodeOwnerDeleted) GetSubject() string

func (*ChaincodeOwnerDeleted) ProtoMessage

func (*ChaincodeOwnerDeleted) ProtoMessage()

func (*ChaincodeOwnerDeleted) ProtoReflect

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

func (*ChaincodeOwnerDeleted) Reset

func (x *ChaincodeOwnerDeleted) Reset()

func (*ChaincodeOwnerDeleted) String

func (x *ChaincodeOwnerDeleted) String() string

func (*ChaincodeOwnerDeleted) Validate

func (this *ChaincodeOwnerDeleted) Validate() error

type ChaincodeOwnerService

type ChaincodeOwnerService struct{}

func NewService

func NewService() *ChaincodeOwnerService

func (*ChaincodeOwnerService) CreateOwner

func (*ChaincodeOwnerService) CreateOwnerTxCreator

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

func (ChaincodeOwnerService) DeleteOwner

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

func (*ChaincodeOwnerService) GetOwner

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

func (*ChaincodeOwnerService) GetOwnerByTxCreator

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

func (*ChaincodeOwnerService) IsTxCreator

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

IsTxCreator - wrapper for TxCreatorIsOwner for local calls

func (*ChaincodeOwnerService) ListOwners

func (*ChaincodeOwnerService) RegisterTxCreator

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

RegisterTxCreator Wrapper for OwnerRegisterTxCreator

func (ChaincodeOwnerService) UpdateOwner

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

type ChaincodeOwnerServiceChaincode

ChaincodeOwnerServiceChaincode chaincode methods interface

type ChaincodeOwnerServiceClient

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.

type ChaincodeOwnerServiceGateway

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

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

func NewChaincodeOwnerServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *ChaincodeOwnerServiceGateway

func (*ChaincodeOwnerServiceGateway) CreateOwner

func (*ChaincodeOwnerServiceGateway) CreateOwnerTxCreator

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

func (*ChaincodeOwnerServiceGateway) DeleteOwner

func (*ChaincodeOwnerServiceGateway) GetOwner

func (*ChaincodeOwnerServiceGateway) GetOwnerByTxCreator

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

func (*ChaincodeOwnerServiceGateway) Invoker

func (*ChaincodeOwnerServiceGateway) ListOwners

func (*ChaincodeOwnerServiceGateway) ServiceDef

ServiceDef returns service definition

func (*ChaincodeOwnerServiceGateway) UpdateOwner

type ChaincodeOwnerServiceServer

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

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

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

Deprecated: Use ChaincodeOwnerUpdated.ProtoReflect.Descriptor instead.

func (*ChaincodeOwnerUpdated) GetExpiresAt

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

func (*ChaincodeOwnerUpdated) GetMspId

func (x *ChaincodeOwnerUpdated) GetMspId() string

func (*ChaincodeOwnerUpdated) GetSubject

func (x *ChaincodeOwnerUpdated) GetSubject() string

func (*ChaincodeOwnerUpdated) ProtoMessage

func (*ChaincodeOwnerUpdated) ProtoMessage()

func (*ChaincodeOwnerUpdated) ProtoReflect

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

func (*ChaincodeOwnerUpdated) Reset

func (x *ChaincodeOwnerUpdated) Reset()

func (*ChaincodeOwnerUpdated) String

func (x *ChaincodeOwnerUpdated) String() string

func (*ChaincodeOwnerUpdated) Validate

func (this *ChaincodeOwnerUpdated) Validate() error

type ChaincodeOwners

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

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

Deprecated: Use ChaincodeOwners.ProtoReflect.Descriptor instead.

func (*ChaincodeOwners) GetItems

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

func (*ChaincodeOwners) ProtoMessage

func (*ChaincodeOwners) ProtoMessage()

func (*ChaincodeOwners) ProtoReflect

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

func (*ChaincodeOwners) Reset

func (x *ChaincodeOwners) Reset()

func (*ChaincodeOwners) String

func (x *ChaincodeOwners) String() string

func (*ChaincodeOwners) Validate

func (this *ChaincodeOwners) Validate() error

type CreateOwnerRequest

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

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

Deprecated: Use CreateOwnerRequest.ProtoReflect.Descriptor instead.

func (*CreateOwnerRequest) GetCert

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

func (*CreateOwnerRequest) GetMspId

func (x *CreateOwnerRequest) GetMspId() string

func (*CreateOwnerRequest) ProtoMessage

func (*CreateOwnerRequest) ProtoMessage()

func (*CreateOwnerRequest) ProtoReflect

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

func (*CreateOwnerRequest) Reset

func (x *CreateOwnerRequest) Reset()

func (*CreateOwnerRequest) String

func (x *CreateOwnerRequest) String() string

func (*CreateOwnerRequest) Validate

func (this *CreateOwnerRequest) Validate() error

type OwnerId

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

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

Deprecated: Use OwnerId.ProtoReflect.Descriptor instead.

func (*OwnerId) GetMspId

func (x *OwnerId) GetMspId() string

func (*OwnerId) GetSubject

func (x *OwnerId) GetSubject() string

func (*OwnerId) ProtoMessage

func (*OwnerId) ProtoMessage()

func (*OwnerId) ProtoReflect

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

func (*OwnerId) Reset

func (x *OwnerId) Reset()

func (*OwnerId) String

func (x *OwnerId) String() string

func (*OwnerId) Validate

func (this *OwnerId) Validate() error

type UnimplementedChaincodeOwnerServiceServer

type UnimplementedChaincodeOwnerServiceServer struct {
}

UnimplementedChaincodeOwnerServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeOwnerServiceServer) CreateOwner

func (*UnimplementedChaincodeOwnerServiceServer) CreateOwnerTxCreator

func (*UnimplementedChaincodeOwnerServiceServer) DeleteOwner

func (*UnimplementedChaincodeOwnerServiceServer) GetOwner

func (*UnimplementedChaincodeOwnerServiceServer) GetOwnerByTxCreator

func (*UnimplementedChaincodeOwnerServiceServer) ListOwners

func (*UnimplementedChaincodeOwnerServiceServer) UpdateOwner

type UpdateOwnerRequest

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

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

Deprecated: Use UpdateOwnerRequest.ProtoReflect.Descriptor instead.

func (*UpdateOwnerRequest) GetCert

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

func (*UpdateOwnerRequest) GetMspId

func (x *UpdateOwnerRequest) GetMspId() string

func (*UpdateOwnerRequest) ProtoMessage

func (*UpdateOwnerRequest) ProtoMessage()

func (*UpdateOwnerRequest) ProtoReflect

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

func (*UpdateOwnerRequest) Reset

func (x *UpdateOwnerRequest) Reset()

func (*UpdateOwnerRequest) String

func (x *UpdateOwnerRequest) String() string

func (*UpdateOwnerRequest) Validate

func (this *UpdateOwnerRequest) Validate() error

Jump to

Keyboard shortcuts

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