@@ -16,6 +16,12 @@ limitations under the License.
16
16
17
17
package msp
18
18
19
+ import "github.com/hyperledger/fabric/protos/msp"
20
+
21
+ // FIXME: we need better comments on the interfaces!!
22
+ // FIXME: we need better comments on the interfaces!!
23
+ // FIXME: we need better comments on the interfaces!!
24
+
19
25
// Membership service provider APIs for Hyperledger Fabric:
20
26
//
21
27
// By "membership service provider" we refer to an abstract component of the
@@ -34,25 +40,13 @@ package msp
34
40
// MSPManager is an interface defining a manager of one or more MSPs. This
35
41
// essentially acts as a mediator to MSP calls and routes MSP related calls
36
42
// to the appropriate MSP.
37
- // This object is initialized (once) by calling Setup. Its
38
- // internal configuration may be changed later by calling
39
- // Reconfig. It is otherwise immutable.
43
+ // This object is immutable, it is initialized once and never changed.
40
44
type MSPManager interface {
41
45
42
46
// Setup the MSP manager instance according to configuration information
43
- Setup (config * MSPManagerConfig ) error
44
-
45
- // Process reconfiguration messages (coming e.g., from Blockchain). This
46
- // should take into consideration certain policies related to how, e.g.,
47
- // a certain certificate should be considered valid, what constitutes the
48
- // chain of trust, and who is authorized to change that.
49
- // @param reconfigMessage The message containing the reconfiguration information.
50
- Reconfig (config []byte ) error
47
+ Setup (msps []* msp.MSPConfig ) error
51
48
52
- // Name of the MSP manager
53
- GetName () string
54
-
55
- // Provides a list of Membership Service providers
49
+ // GetMSPs Provides a list of Membership Service providers
56
50
GetMSPs () (map [string ]MSP , error )
57
51
58
52
// DeserializeIdentity deserializes an identity
@@ -64,24 +58,15 @@ type MSPManager interface {
64
58
type MSP interface {
65
59
66
60
// Setup the MSP instance according to configuration information
67
- Setup (config * MSPConfig ) error
68
-
69
- // Process reconfiguration messages coming from the blockchain
70
- // @param reconfigMessage The message containing the reconfiguration command.
71
- Reconfig (config []byte ) error
61
+ Setup (config * msp.MSPConfig ) error
72
62
73
- // Get provider type
63
+ // GetType returns the provider type
74
64
GetType () ProviderType
75
65
76
- // Get provider identifier
66
+ // GetIdentifier returns the provider identifier
77
67
GetIdentifier () (string , error )
78
68
79
- // Obtain the policy to govern changes; this can be
80
- // having a json format.
81
- // Note: THIS CAN WAIT!
82
- GetPolicy () string
83
-
84
- // GetSingingIdentity returns a signing identity corresponding to the provided identifier
69
+ // GetSigningIdentity returns a signing identity corresponding to the provided identifier
85
70
GetSigningIdentity (identifier * IdentityIdentifier ) (SigningIdentity , error )
86
71
87
72
// GetDefaultSigningIdentity returns the default signing identity
@@ -90,7 +75,7 @@ type MSP interface {
90
75
// DeserializeIdentity deserializes an identity
91
76
DeserializeIdentity (serializedIdentity []byte ) (Identity , error )
92
77
93
- // isValid checks whether the supplied identity is valid
78
+ // Validate checks whether the supplied identity is valid
94
79
Validate (id Identity ) error
95
80
}
96
81
@@ -104,21 +89,20 @@ type MSP interface {
104
89
// with, and verifying signatures that correspond to these certificates.///
105
90
type Identity interface {
106
91
107
- // Identifier returns the identifier of that identity
92
+ // GetIdentifier returns the identifier of that identity
108
93
GetIdentifier () * IdentityIdentifier
109
94
110
- // Retrieve the provider identifier this identity belongs to
111
- // from the previous field
95
+ // GetMSPIdentifier returns the MSP Id for this instance
112
96
GetMSPIdentifier () string
113
97
114
- // This uses the rules that govern this identity to validate it.
98
+ // Validate uses the rules that govern this identity to validate it.
115
99
// E.g., if it is a fabric TCert implemented as identity, validate
116
100
// will check the TCert signature against the assumed root certificate
117
101
// authority.
118
- IsValid () error
102
+ Validate () error
119
103
120
104
// TODO: Fix this comment
121
- // ParticipantID would return the participant this identity is related to
105
+ // GetOrganizationUnits returns the participant this identity is related to
122
106
// as long as this is public information. In certain implementations
123
107
// this could be implemented by certain attributes that are publicly
124
108
// associated to that identity, or the identifier of the root certificate
@@ -162,7 +146,7 @@ type SigningIdentity interface {
162
146
// SignOpts the message with options
163
147
SignOpts (msg []byte , opts SignatureOpts ) ([]byte , error )
164
148
165
- // NewAttributeProof creates a proof for an attribute
149
+ // GetAttributeProof creates a proof for an attribute
166
150
GetAttributeProof (spec * AttributeProofSpec ) (proof []byte , err error )
167
151
168
152
// GetPublicVersion returns the public parts of this identity
0 commit comments