Move struct DynamicOptions to package pkg/server (#5625)

* move struct DynamicOptions to package pkg/server/dynamic_options.go

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* update test types

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

---------

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>
This commit is contained in:
Wenhao Zhou
2023-04-07 11:33:36 +08:00
committed by GitHub
parent c57a89af3c
commit 62427cda32
21 changed files with 139 additions and 122 deletions

View File

@@ -30,7 +30,7 @@ import (
"k8s.io/klog/v2"
"kubesphere.io/kubesphere/pkg/apiserver/authentication/identityprovider"
"kubesphere.io/kubesphere/pkg/apiserver/authentication/oauth"
"kubesphere.io/kubesphere/pkg/server/options"
)
const (
@@ -85,9 +85,9 @@ func (l *ldapProviderFactory) Type() string {
return ldapIdentityProvider
}
func (l *ldapProviderFactory) Create(options oauth.DynamicOptions) (identityprovider.GenericProvider, error) {
func (l *ldapProviderFactory) Create(opts options.DynamicOptions) (identityprovider.GenericProvider, error) {
var ldapProvider ldapProvider
if err := mapstructure.Decode(options, &ldapProvider); err != nil {
if err := mapstructure.Decode(opts, &ldapProvider); err != nil {
return nil, err
}
if ldapProvider.ReadTimeout <= 0 {