重构代码结构与认证体系,集成异步任务消费者
This commit is contained in:
24
web/auth/errors.go
Normal file
24
web/auth/errors.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package auth
|
||||
|
||||
type AuthErr string
|
||||
|
||||
func (e AuthErr) Error() string {
|
||||
return string(e)
|
||||
}
|
||||
|
||||
// 认证错误
|
||||
const (
|
||||
ErrAuthenticateUnauthorize = AuthErr("令牌无效")
|
||||
ErrAuthenticateForbidden = AuthErr("没有权限")
|
||||
)
|
||||
|
||||
// 授权错误
|
||||
const (
|
||||
ErrAuthorizeInvalidRequest = AuthErr("invalid_request")
|
||||
ErrAuthorizeInvalidClient = AuthErr("invalid_client")
|
||||
ErrAuthorizeInvalidGrant = AuthErr("invalid_grant")
|
||||
ErrAuthorizeInvalidScope = AuthErr("invalid_scope")
|
||||
ErrAuthorizeUnauthorizedClient = AuthErr("unauthorized_client")
|
||||
ErrAuthorizeUnsupportedGrantType = AuthErr("unsupported_grant_type")
|
||||
ErrAuthorizeInvalidPKCE = AuthErr("invalid_pkce")
|
||||
)
|
||||
Reference in New Issue
Block a user