Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationMSP ¶
type ApplicationMSP interface {
// Extends MSP
msp.MSP
// GetMember returns an already enrolled member,
// or nil if an enrolled member with this name was not found.
// @param name The enrollment name
GetMember(identifier MemberIdentifier) (Member, error)
// DeleteMember deletes a specific member object corresponding to the provided identifier
DeleteMember(identifier MemberIdentifier) (bool, error)
// ImportMember imports a member.
// @param req The import request
ImportMember(req *MemberImportRequest) (Member, error)
}
ApplicationMSP is the membership service provider interface for application use
type ApplicationMSPManager ¶
type ApplicationMSPManager interface {
// Extends PeerMSPManager
msp.MSPManager
// GetMember returns the member object corresponding to the provided identifier
GetMember(identifier MemberIdentifier) (Member, error)
// DeleteMember deletes a specific member object corresponding to the provided
// identifiers
DeleteMember(identifier MemberIdentifier) error
// ImportMember imports a member.
// @param req The import request
ImportMember(req *MemberImportRequest) (Member, error)
}
ApplicationMSPManager is an interface defining a manager of one or more membership service providers (MSPs). This essentially acts as a mediator to MSP calls and routes MSP related calls to the appropriate MSP.
type EnrollmentRequest ¶
type EnrollmentRequest struct {
// The identity name to enroll
Name string
// Some information to authenticate end-user to the enrollment
// authority
AuthenticationInfo []byte
}
EnrollmentRequest is a request to enroll a member
type EnrollmentResponse ¶
type EnrollmentResponse struct {
// The enrollment certificate
IdentityBytes []byte
}
EnrollmentResponse is a response to enrollment request
type FabricRole ¶
type FabricRole int
Member roles indicates the role of the member in the fabric infrastructure
const ( PEER FabricRole = iota // member is a peer CLIENT // member is a client REGISTRAR // member is a registrar (part of app) )
type IdentitySpec ¶
type IdentitySpec interface {
// Identity of the identity
GetName() string
// Type indicates whether it is a signing or an Identity
GetType()
// IsAnonymous returns a boolean indicating if the identity is anonymous
IsAnonymous() bool
// A list of attributes this identity includes
GetAttributeList() []msp.Attribute
// Identifier of the identity to recover
GetIdentifier() string
}
IdentitySpec is the interface describing the specifications of the identity one wants to recover
type Member ¶
type Member interface {
// GetIdentifier returns the member identifier; this naturally includes the
// identifier of the provider this member is a member of.
GetIdentifier() MemberIdentifier
// GetOrganizationUnits returns the organization this member belongs to. In certain
// implementations this could be implemented by certain attributes that
// are publicly associated to that member, or that member's identity.
// E.g., Groups here could refer to the authorities that have signed a
// member's enrollment certificate or registered tse user.
GetOrganizationUnits() string
// GetFabricRole returns the role in the fabric of this member. E.g., if the
// member is a peer, or a client.
// Note: Do we have to have distinction here you think?
GetFabricRole() FabricRole
// GetEnrollmentIdentity returns the enrollment identity of this member.
// The assumption here is that there is only one enrollment identity per
// member.
GetEndrollmentIdentity() msp.SigningIdentity
// GetIdentities returns other identities for use by this member, that comply
// with the specifications passed as arguments.
// @param specs The specifications of the identities that are to be retrieved.
GetIdentities(count int, specs *IdentitySpec) ([]msp.SigningIdentity, error)
// GetAttributes returns all attributes associated with this member
GetAttributes() []string
// DeleteIdentities deletes all identities complying with the specifications passed as parameter
// in this function. This function aims to serve clean up operations, i.e.,
// removing expired identities, or revoked ones(?).
// @param specs The identity specs of the identities to be deleted.
DeleteIdentities(specs *IdentitySpec) error
// RevokeIdentities revokes all identities that comply with the specifications passed as parameter
// in this function.
// @param specs The identity specs of the identities to be deleted.
RevokeIdentities(specs *IdentitySpec) error
}
Member represents an enrolled entity within an identity provider
type MemberIdentifier ¶
type MemberIdentifier struct {
// The identifier of the associated identity provider
MSPIdentifier string
// Returns the identifier for a member within a provider
MemberIdentifier string
}
MemberIdentifier uniquely identifies a member naturally inheriting the namespace of the associated identity provider.
type MemberImportRequest ¶
type MemberImportRequest struct {
// MSPIdentifier to enroll with
MSPIdentifier string
// MemberSigningIdentity includes the long term enrollment identity
// of a member
MemberSigningIdentity *mspconfig.SigningIdentityInfo
}
type RegistrationRequest ¶
type RegistrationRequest interface {
// Name is the unique name of the identity
GetName() string
// Get membership service provider type/identifier this request corresponds to
GetProviderType() msp.ProviderType
// Group names to be associated with the identity
GetOrganization() []string
// Type/role of identity being registered (e.g. "peer, app, client")
GetRole() FabricRole
// Attributes to be associated with the identity
GetAttributes() []string
}
RegistrationRequest for a new identity
type RegistrationResponse ¶
type RegistrationResponse struct {
// Returns the username of the registered entity
Username string
// Returns the secret associated to the registered entity
Secret []byte
}
RegistrationResponse is a registration response
type ServerEnabledMSP ¶
type ServerEnabledMSP interface {
// Register a new member, this is only possible if the member is a registrar
// @param req The registration request
Register(req *RegistrationRequest) (*RegistrationResponse, error)
// Enroll a new member
// @param req The enrollment request
Enroll(req *EnrollmentRequest) (msp.SigningIdentity, error)
// RegisterAndEnroll registers and enrolls a new entity and
// returns a long term signing identity, i.e., the enrollment identity
// @param req The registration request
RegisterAndEnroll(req *RegistrationRequest) (msp.SigningIdentity, error)
}
ServerEnabledMSP is an interface defining an MSP that leverages a server for registration and enrollment. This is an interface that can be used in combination to an ApplicationMSP interface or a plain MSP interface to add to the related MSP server-aided (online) member/node registration and enrollment enablement.