Add more tests (#1949)

* add more test code

* add more test code
This commit is contained in:
zryfish
2020-03-15 10:22:39 +08:00
committed by GitHub
parent f8e7d06b07
commit abf0d66b22
13 changed files with 444 additions and 55 deletions

View File

@@ -0,0 +1,21 @@
package ldap
import "kubesphere.io/kubesphere/pkg/api/iam"
// Interface defines CRUD behaviors of manipulating users
type Interface interface {
// Create create a new user in ldap
Create(user *iam.User) error
// Update updates a user information, return error if user not exists
Update(user *iam.User) error
// Delete deletes a user from ldap, return nil if user not exists
Delete(name string) error
// Get gets a user by its username from ldap, return ErrUserNotExists if user not exists
Get(name string) (*iam.User, error)
// Verify checks if (name, password) is valid, return ErrInvalidCredentials if not
Verify(name string, password string) error
}