Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-03-22 15:57:29 +08:00
parent b9bdcd824c
commit cae7843832
13 changed files with 228 additions and 103 deletions

View File

@@ -17,7 +17,7 @@ func NewSimpleLdap() Interface {
// initialize with a admin user
admin := &iam.User{
Username: "admin",
Name: "admin",
Email: "admin@kubesphere.io",
Lang: "eng",
Description: "administrator",
@@ -25,21 +25,21 @@ func NewSimpleLdap() Interface {
Groups: nil,
Password: "P@88w0rd",
}
sl.store[admin.Username] = admin
sl.store[admin.Name] = admin
return sl
}
func (s simpleLdap) Create(user *iam.User) error {
s.store[user.Username] = user
s.store[user.Name] = user
return nil
}
func (s simpleLdap) Update(user *iam.User) error {
_, err := s.Get(user.Username)
_, err := s.Get(user.Name)
if err != nil {
return err
}
s.store[user.Username] = user
s.store[user.Name] = user
return nil
}