-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-8553] Drop CredentialManager interface
The only method, GetSigningIdentity, is already a part of the IdentityManager interface. OrganizationFactory is also removed, as its only function was to create a CredentialManager instance. Change-Id: I95ebbe229a962362cdabbff2e72ff2420d5460b3 Signed-off-by: Aleksandar Likic <[email protected]>
- Loading branch information
Aleksandar Likic
committed
Feb 27, 2018
1 parent
4dff6ab
commit 6154281
Showing
19 changed files
with
96 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package mocks | ||
|
||
import ( | ||
"github.com/hyperledger/fabric-sdk-go/pkg/context/api" | ||
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/core" | ||
"github.com/hyperledger/fabric-sdk-go/pkg/context/api/fab" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
// MockIdentityManager is a mock IdentityManager | ||
type MockIdentityManager struct { | ||
} | ||
|
||
// NewMockIdentityManager Constructor for a identity manager. | ||
func NewMockIdentityManager(orgName string, config core.Config, cryptoProvider core.CryptoSuite) (fab.IdentityManager, error) { | ||
mcm := MockIdentityManager{} | ||
return &mcm, nil | ||
} | ||
|
||
// GetSigningIdentity will return an identity that can be used to cryptographically sign an object | ||
func (mgr *MockIdentityManager) GetSigningIdentity(userName string) (*api.SigningIdentity, error) { | ||
|
||
si := api.SigningIdentity{} | ||
return &si, nil | ||
} | ||
|
||
// Enroll enrolls a user with a Fabric network | ||
func (mgr *MockIdentityManager) Enroll(enrollmentID string, enrollmentSecret string) (core.Key, []byte, error) { | ||
return nil, nil, errors.New("not implemented") | ||
} | ||
|
||
// Reenroll re-enrolls a user | ||
func (mgr *MockIdentityManager) Reenroll(user api.User) (core.Key, []byte, error) { | ||
return nil, nil, errors.New("not implemented") | ||
} | ||
|
||
// Register registers a user with a Fabric network | ||
func (mgr *MockIdentityManager) Register(request *fab.RegistrationRequest) (string, error) { | ||
return "", errors.New("not implemented") | ||
} | ||
|
||
// Revoke revokes a user | ||
func (mgr *MockIdentityManager) Revoke(request *fab.RevocationRequest) (*fab.RevocationResponse, error) { | ||
return nil, errors.New("not implemented") | ||
} | ||
|
||
// CAName return the name of a CA associated with this identity manager | ||
func (mgr *MockIdentityManager) CAName() string { | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.