Files
kubevela/pkg/apiserver/rest/utils/bcode/012_authentication.go
Tianxin Dong 03cd0d144a Feat: add login handle for apiserver (#3471)
* Feat: add login handle for apiserver

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* fix go lint

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: clean up code and add user in ctx

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: fix swagger conflict

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Feat: add auth in apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>

* Fix: nit fix for apiserver e2e test

Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2022-03-24 17:59:09 +08:00

37 lines
1.6 KiB
Go

/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package bcode
var (
// ErrUnsupportedLoginType is the error of unsupported login type
ErrUnsupportedLoginType = NewBcode(401, 12001, "the login type is not supported")
// ErrTokenExpired is the error of token expired
ErrTokenExpired = NewBcode(401, 12002, "the token is expired")
// ErrTokenNotValidYet is the error of token not valid yet
ErrTokenNotValidYet = NewBcode(401, 12003, "the token is not valid yet")
// ErrTokenInvalid is the error of token invalid
ErrTokenInvalid = NewBcode(401, 12004, "the token is invalid")
// ErrTokenMalformed is the error of token malformed
ErrTokenMalformed = NewBcode(403, 12005, "the token is malformed")
// ErrNotAuthorized is the error of not authorized
ErrNotAuthorized = NewBcode(401, 12006, "the user is not authorized")
// ErrNotAccessToken is the error of not access token
ErrNotAccessToken = NewBcode(401, 12007, "the token is not an access token")
// ErrInvalidLoginRequest is the error of invalid login request
ErrInvalidLoginRequest = NewBcode(400, 12008, "the login request is invalid")
)