code refactor (#1786)

* implement LDAP mock client

Signed-off-by: hongming <talonwan@yunify.com>

* update

Signed-off-by: hongming <talonwan@yunify.com>

* update

Signed-off-by: hongming <talonwan@yunify.com>

* resolve conflict

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-02-24 15:39:36 +08:00
committed by GitHub
parent 96aee0e60b
commit abf9fee845
39 changed files with 1338 additions and 2467 deletions

View File

@@ -11,11 +11,14 @@ type Options struct {
ManagerPassword string `json:"managerPassword,omitempty" yaml:"managerPassword"`
UserSearchBase string `json:"userSearchBase,omitempty" yaml:"userSearchBase"`
GroupSearchBase string `json:"groupSearchBase,omitempty" yaml:"groupSearchBase"`
InitialCap int `json:"initialCap,omitempty" yaml:"initialCap"`
MaxCap int `json:"maxCap,omitempty" yaml:"maxCap"`
PoolName string `json:"poolName,omitempty" yaml:"poolName"`
}
// NewLdapOptions return a default option
// NewOptions return a default option
// which host field point to nowhere.
func NewLdapOptions() *Options {
func NewOptions() *Options {
return &Options{
Host: "",
ManagerDN: "cn=admin,dc=example,dc=org",
@@ -25,7 +28,7 @@ func NewLdapOptions() *Options {
}
func (l *Options) Validate() []error {
errors := []error{}
var errors []error
return errors
}