Skip to content

Commit 2f1c734

Browse files
committed
fixup! documentation
Signed-off-by: Angelo De Caro <[email protected]>
1 parent 0d95d3c commit 2f1c734

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

docs/services/identity.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,19 @@ Each role acts as a container for long-term identities, which are then used to c
5353
// Role is a container of long-term identities.
5454
// A long-term identity is then used to construct a wallet.
5555
type Role interface {
56-
// MapToID returns the long-term identity and its identifier for the given index.
57-
// The index can be an identity or a label (string).
58-
MapToID(v interface{}) (view.Identity, string, error)
59-
// GetIdentityInfo returns the long-term identity info associated to the passed id
60-
GetIdentityInfo(id string) driver.IdentityInfo
61-
// RegisterIdentity registers the given identity
62-
RegisterIdentity(id string, path string) error
63-
// IDs returns the identifiers contained in this role
64-
IDs() ([]string, error)
65-
// Reload the roles with the respect to the passed public parameters
66-
Reload(pp driver.PublicParameters) error
56+
// ID returns the identifier of this role
57+
ID() driver.IdentityRole
58+
// MapToID returns the long-term identity and its identifier for the given index.
59+
// The index can be an identity or a label (string).
60+
MapToID(v interface{}) (view.Identity, string, error)
61+
// GetIdentityInfo returns the long-term identity info associated to the passed id
62+
GetIdentityInfo(id string) (driver.IdentityInfo, error)
63+
// RegisterIdentity registers the given identity
64+
RegisterIdentity(id string, path string) error
65+
// IdentityIDs returns the identifiers contained in this role
66+
IdentityIDs() ([]string, error)
67+
// Reload the roles with the respect to the passed public parameters
68+
Reload(pp driver.PublicParameters) error
6769
}
6870
```
6971

@@ -74,18 +76,19 @@ For example, a role could even encompass identities based on various cryptograph
7476
The identity service conveniently provides two built-in implementations of the Role interface.
7577
Both implementations leverage the concept of Hyperledger Fabric MSP ([https://hyperledger-fabric.readthedocs.io/en/latest/msp.html](https://hyperledger-fabric.readthedocs.io/en/latest/msp.html)):
7678

77-
* **MSP X.509:** This implementation retrieves long-term identities from local folders adhering to the X.509-based MSP format.
78-
* **MSP Idemix:** This implementation loads long-term identities from local folders that follow the Idemix-based MSP format.
79+
* [**MSP X.509:**](./../../token/services/identity/msp/x509) This implementation retrieves long-term identities from local folders adhering to the X.509-based MSP format.
80+
* [**MSP Idemix:**](./../../token/services/identity/msp/idemix) This implementation loads long-term identities from local folders that follow the Idemix-based MSP format.
7981

8082
## Using the Identity Service in a Token Driver
8183

8284
If you want to use the Identity Service in your Token Driver, then here is what you need to do.
8385

8486
First, instantiate your roles. The identity service come equipped with two `Role` implementation.
8587
One is based on X.509 certificates, the other one is based on Idemix.
86-
Both requires the identities to be stored following the Hyperledger Fabric MSP prescriptions.
88+
Both requires the identities to be stored on the filesystem following the Hyperledger Fabric MSP prescriptions.
8789

8890
High level, these are the steps to follow:
8991
1. Instantiate the roles your driver will support.
90-
2. Instantiate the Identity Provider passing the constructed roles.
91-
3. Instantiate the Wallet Registries for each role.
92+
2. Instantiate the Wallet Registries for each role.
93+
94+
Let see an example taken from the [`fabtoken`](./../../token/core/fabtoken/driver) driver.

token/driver/identity.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ type IdentityProvider interface {
4444
// RegisterAuditInfo binds the audit information to the passed identity
4545
RegisterAuditInfo(id view.Identity, auditInfo []byte) error
4646

47-
WalletIDs(role IdentityRole) ([]string, error)
48-
4947
// GetAuditInfo returns the audit information associated to the passed identity, nil otherwise
5048
GetAuditInfo(identity view.Identity) ([]byte, error)
5149

0 commit comments

Comments
 (0)