fix ks-apiserver missing interfaces
Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
iamv1alpha2 "kubesphere.io/api/iam/v1alpha2"
|
||||
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/authentication/request/basictoken"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/request"
|
||||
"kubesphere.io/kubesphere/pkg/models/auth"
|
||||
|
||||
@@ -40,7 +41,7 @@ type basicAuthenticator struct {
|
||||
loginRecorder auth.LoginRecorder
|
||||
}
|
||||
|
||||
func NewBasicAuthenticator(authenticator auth.PasswordAuthenticator, loginRecorder auth.LoginRecorder) authenticator.Password {
|
||||
func NewBasicAuthenticator(authenticator auth.PasswordAuthenticator, loginRecorder auth.LoginRecorder) basictoken.Password {
|
||||
return &basicAuthenticator{
|
||||
authenticator: authenticator,
|
||||
loginRecorder: loginRecorder,
|
||||
|
||||
@@ -19,17 +19,22 @@ limitations under the License.
|
||||
package basictoken
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"k8s.io/apiserver/pkg/authentication/authenticator"
|
||||
)
|
||||
|
||||
type Authenticator struct {
|
||||
auth authenticator.Password
|
||||
type Password interface {
|
||||
AuthenticatePassword(ctx context.Context, user, password string) (*authenticator.Response, bool, error)
|
||||
}
|
||||
|
||||
func New(auth authenticator.Password) *Authenticator {
|
||||
type Authenticator struct {
|
||||
auth Password
|
||||
}
|
||||
|
||||
func New(auth Password) *Authenticator {
|
||||
return &Authenticator{auth}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user