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

@@ -27,7 +27,7 @@ import (
"golang.org/x/oauth2"
"kubesphere.io/kubesphere/pkg/apiserver/authentication/identityprovider"
"kubesphere.io/kubesphere/pkg/apiserver/authentication/oauth"
"kubesphere.io/kubesphere/pkg/server/options"
)
func init() {
@@ -89,9 +89,9 @@ func (f *idaasProviderFactory) Type() string {
return "AliyunIDaaSProvider"
}
func (f *idaasProviderFactory) Create(options oauth.DynamicOptions) (identityprovider.OAuthProvider, error) {
func (f *idaasProviderFactory) Create(opts options.DynamicOptions) (identityprovider.OAuthProvider, error) {
var idaas aliyunIDaaS
if err := mapstructure.Decode(options, &idaas); err != nil {
if err := mapstructure.Decode(opts, &idaas); err != nil {
return nil, err
}
idaas.Config = &oauth2.Config{