Documentation
¶
Overview ¶
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2025/12/22 15:56:00
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2026/06/05
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
@Author daixk 2025/12/22 15:56:00
Index ¶
- Constants
- Variables
- func AccessMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
- func AddPermissionsByContext(c echo4.Context, permissions []string) error
- func AddRolesByContext(c echo4.Context, roles []string) error
- func AuthGroup(ctx context.Context, group *echo4.Group, ...) *echo4.Group
- func AuthMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
- func CheckAllMiddleware(ctx context.Context, roles []string, perms []string, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckDisableByContext(c echo4.Context) error
- func CheckDisableDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string) error
- func CheckDisableDeviceByContext(c echo4.Context, device string) error
- func CheckDisableMiddleware(ctx context.Context, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckDisableServiceByContext(c echo4.Context, services ...string) error
- func CheckDisableServiceLevelByContext(c echo4.Context, service string, level int) error
- func CheckLoginAndPermissionMiddleware(ctx context.Context, perms []string, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckLoginAndRoleMiddleware(ctx context.Context, roles []string, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckLoginByContext(c echo4.Context) error
- func CheckLoginMiddleware(ctx context.Context, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckPermissionByContext(c echo4.Context, permission string) error
- func CheckPermissionMiddleware(ctx context.Context, perms []string, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckPermissionsAndByContext(c echo4.Context, permissions []string) error
- func CheckPermissionsOrByContext(c echo4.Context, permissions []string) error
- func CheckRoleByContext(c echo4.Context, role string) error
- func CheckRoleMiddleware(ctx context.Context, roles []string, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func CheckRolesAndByContext(c echo4.Context, roles []string) error
- func CheckRolesOrByContext(c echo4.Context, roles []string) error
- func ClearTokenCookieByContext(c echo4.Context) error
- func ConfirmShortKeyByContext(c echo4.Context, key string, opts shortkey.ConfirmOptions) (*shortkey.ShortKey, error)
- func ConfirmShortKeyForCurrentLoginByContext(c echo4.Context, key string, opts shortkey.ConfirmOptions) (*shortkey.ShortKey, error)
- func ConsumeShortKeyByContext(c echo4.Context, key string, opts ...shortkey.ValidateOptions) (*shortkey.ConsumeResult, error)
- func ConsumeTicketByContext(c echo4.Context, ticketValue string, opts ...ticket.ValidateOptions) (*ticket.ConsumeResult, error)
- func CreateShortKeyByContext(c echo4.Context, opts shortkey.CreateOptions) (*shortkey.ShortKey, error)
- func CreateShortKeyWithTimeoutByContext(c echo4.Context, opts shortkey.CreateOptions, timeout time.Duration) (*shortkey.ShortKey, error)
- func CreateTicketByContext(c echo4.Context, opts ticket.CreateOptions) (*ticket.Ticket, error)
- func CreateTicketForCurrentLoginByContext(c echo4.Context, opts ticket.CreateOptions) (*ticket.Ticket, error)
- func CreateTicketWithTimeoutByContext(c echo4.Context, opts ticket.CreateOptions, timeout time.Duration) (*ticket.Ticket, error)
- func DeleteSessionValueByContext(c echo4.Context, key string) error
- func DisableByContext(c echo4.Context, duration time.Duration, reason ...string) error
- func DisableDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string, duration time.Duration, ...) error
- func DisableDeviceByContext(c echo4.Context, device string, duration time.Duration, reason ...string) error
- func DisableServiceByContext(c echo4.Context, service string, duration time.Duration, reason ...string) error
- func DisableServiceLevelByContext(c echo4.Context, service string, level int, duration time.Duration, ...) error
- func ExchangeOAuth2CodeForTokenByContext(c echo4.Context, code, clientID, clientSecret, redirectURI string) (*oauth2.AccessToken, error)
- func ExchangeOAuth2CodeForTokenWithPKCEByContext(c echo4.Context, ...) (*oauth2.AccessToken, error)
- func ForEachTerminalByContext(c echo4.Context, visitor manager.TerminalVisitor) error
- func ForEachTerminalByDeviceByContext(c echo4.Context, device string, visitor manager.TerminalVisitor) error
- func GenerateNonceByContext(c echo4.Context) (string, error)
- func GenerateNonceWithTimeoutByContext(c echo4.Context, timeout time.Duration) (string, error)
- func GenerateOAuth2AuthorizationCodeByContext(c echo4.Context, clientID, userID, redirectURI string, scopes []string) (*oauth2.AuthorizationCode, error)
- func GenerateOAuth2AuthorizationCodeWithPKCEByContext(c echo4.Context, clientID, userID, redirectURI string, scopes []string, ...) (*oauth2.AuthorizationCode, error)
- func GetDTokenContext(c echo4.Context) (*corecontext.DTokenContext, bool)
- func GetDeviceByContext(c echo4.Context) (string, error)
- func GetDeviceIDByContext(c echo4.Context) (string, error)
- func GetDisableDeviceAndDeviceIDInfoByContext(c echo4.Context, device, deviceId string) (*manager.DeviceDisableInfo, error)
- func GetDisableDeviceAndDeviceIDTTLByContext(c echo4.Context, device, deviceId string) (int64, error)
- func GetDisableDeviceInfoByContext(c echo4.Context, device string) (*manager.DeviceDisableInfo, error)
- func GetDisableDeviceTTLByContext(c echo4.Context, device string) (int64, error)
- func GetDisableInfoByContext(c echo4.Context) (*manager.DisableInfo, error)
- func GetDisableServiceInfoByContext(c echo4.Context, service string) (*manager.ServiceDisableInfo, error)
- func GetDisableServiceTTLByContext(c echo4.Context, service string) (int64, error)
- func GetDisableTTLByContext(c echo4.Context) (int64, error)
- func GetHandler(ctx context.Context, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func GetLatestTokenValueByContext(c echo4.Context, device ...string) (string, error)
- func GetLoginIDByContext(c echo4.Context) (string, error)
- func GetManagerByContext(c echo4.Context) (*manager.Manager, error)
- func GetNonceTTLByContext(c echo4.Context, nonce string) (int64, error)
- func GetOAuth2ClientByContext(c echo4.Context, clientID string) (*oauth2.Client, error)
- func GetOnlineTerminalCountByContext(c echo4.Context) (int, error)
- func GetOnlineTerminalCountByDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string) (int, error)
- func GetOnlineTerminalCountByDeviceByContext(c echo4.Context, device string) (int, error)
- func GetPermissionsByContext(c echo4.Context) ([]string, error)
- func GetPermissionsByTokenByContext(c echo4.Context) ([]string, error)
- func GetRefreshTokenTTLByContext(c echo4.Context, refreshToken string) (int64, error)
- func GetRequestContextByContext(c echo4.Context) (adapter.RequestContext, error)
- func GetRolesByContext(c echo4.Context) ([]string, error)
- func GetRolesByTokenByContext(c echo4.Context) ([]string, error)
- func GetSessionByContext(c echo4.Context) (*manager.Session, error)
- func GetSessionByTokenByContext(c echo4.Context) (*manager.Session, error)
- func GetSessionValueByContext(c echo4.Context, key string) (any, bool, error)
- func GetShortKeyStatusByContext(c echo4.Context, key string) (shortkey.Status, error)
- func GetShortKeyTTLByContext(c echo4.Context, key string) (int64, error)
- func GetTerminalInfoByContext(c echo4.Context) (*manager.TerminalInfo, error)
- func GetTerminalListByContext(c echo4.Context, device ...string) ([]manager.TerminalInfo, error)
- func GetTicketStatusByContext(c echo4.Context, ticketValue string) (ticket.Status, error)
- func GetTicketTTLByContext(c echo4.Context, ticketValue string) (int64, error)
- func GetTokenCreateTimeByContext(c echo4.Context) (int64, error)
- func GetTokenInfoByContext(c echo4.Context) (*manager.TokenInfo, error)
- func GetTokenTTLByContext(c echo4.Context) (int64, error)
- func GetTokenValueByContext(c echo4.Context) (string, error)
- func GetTokenValueListByContext(c echo4.Context, checkAlive ...bool) ([]string, error)
- func GetTokenValueListByDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string, checkAlive ...bool) ([]string, error)
- func GetTokenValueListByDeviceByContext(c echo4.Context, device string, checkAlive ...bool) ([]string, error)
- func HasPermissionByContext(c echo4.Context, permission string) bool
- func HasPermissionsAndByContext(c echo4.Context, permissions []string) bool
- func HasPermissionsByContext(c echo4.Context, permissions []string) bool
- func HasPermissionsOrByContext(c echo4.Context, permissions []string) bool
- func HasRoleByContext(c echo4.Context, role string) bool
- func HasRolesAndByContext(c echo4.Context, roles []string) bool
- func HasRolesByContext(c echo4.Context, roles []string) bool
- func HasRolesOrByContext(c echo4.Context, roles []string) bool
- func IgnoreMiddleware(ctx context.Context, handler echo4.HandlerFunc, ...) echo4.HandlerFunc
- func IntrospectTokenByContext(c echo4.Context) (*manager.TokenIntrospection, error)
- func IsDisableByContext(c echo4.Context) bool
- func IsDisableDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string) bool
- func IsDisableDeviceByContext(c echo4.Context, device string) bool
- func IsDisableServiceByContext(c echo4.Context, service string) bool
- func IsDisableServiceLevelByContext(c echo4.Context, service string, level int) bool
- func IsLoginByContext(c echo4.Context) bool
- func IsValidNonceByContext(c echo4.Context, nonce string) bool
- func KickoutByContext(c echo4.Context) error
- func KickoutByDeviceAndDeviceIDByContext(c echo4.Context, deviceAndDeviceId ...string) error
- func KickoutByDeviceByContext(c echo4.Context, device string) error
- func KickoutByLoginIDByContext(c echo4.Context) error
- func LoginByContext(c echo4.Context, loginID string, deviceAndDeviceId ...string) (string, error)
- func LoginByTokenByContext(c echo4.Context) error
- func LoginWithCookieByContext(c echo4.Context, loginID string, deviceAndDeviceId ...string) (string, error)
- func LoginWithCookieOptionsByContext(c echo4.Context, opts manager.LoginOptions) (string, error)
- func LoginWithCookieTimeoutByContext(c echo4.Context, loginID string, timeout time.Duration, ...) (string, error)
- func LoginWithOptionsByContext(c echo4.Context, opts manager.LoginOptions) (string, error)
- func LoginWithRefreshTokenByContext(c echo4.Context, loginID string, deviceAndDeviceId ...string) (*manager.RefreshTokenPair, error)
- func LoginWithRefreshTokenOptionsByContext(c echo4.Context, opts manager.RefreshTokenOptions) (*manager.RefreshTokenPair, error)
- func LoginWithTimeoutByContext(c echo4.Context, loginID string, timeout time.Duration, ...) (string, error)
- func LogoutByContext(c echo4.Context) error
- func LogoutByDeviceAndDeviceIdByContext(c echo4.Context, deviceAndDeviceId ...string) error
- func LogoutByDeviceByContext(c echo4.Context, device string) error
- func LogoutByLoginIDByContext(c echo4.Context) error
- func LogoutWithCookieByContext(c echo4.Context) error
- func NewBuilder() *builder.Builder
- func NewEchoContext(c echo4.Context) adapter.RequestContext
- func OAuth2ClientCredentialsTokenByContext(c echo4.Context, clientID, clientSecret string, scopes []string) (*oauth2.AccessToken, error)
- func OAuth2PasswordGrantTokenByContext(c echo4.Context, clientID, clientSecret, username, password string, ...) (*oauth2.AccessToken, error)
- func OAuth2TokenByContext(c echo4.Context, req *oauth2.TokenRequest, validateUser oauth2.UserValidator) (*oauth2.AccessToken, error)
- func PermissionGroup(ctx context.Context, group *echo4.Group, perms []string, ...) *echo4.Group
- func PermissionMiddleware(ctx context.Context, permissions []string, opts ...AuthOption) echo4.MiddlewareFunc
- func RefreshOAuth2AccessTokenByContext(c echo4.Context, clientID, refreshToken, clientSecret string) (*oauth2.AccessToken, error)
- func RefreshTokenByContext(c echo4.Context, refreshToken string) (*manager.RefreshTokenPair, error)
- func RegisterDTokenContextMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
- func RegisterOAuth2ClientByContext(c echo4.Context, client *oauth2.Client) error
- func RemovePermissionsByContext(c echo4.Context, permissions []string) error
- func RemoveRolesByContext(c echo4.Context, roles []string) error
- func RenewTimeoutByContext(c echo4.Context, timeout time.Duration) error
- func ReplaceByContext(c echo4.Context) error
- func ReplaceByDeviceAndDeviceIDByContext(c echo4.Context, deviceAndDeviceId ...string) error
- func ReplaceByDeviceByContext(c echo4.Context, device string) error
- func ReplaceByLoginIDByContext(c echo4.Context) error
- func RevokeOAuth2TokenByContext(c echo4.Context, accessToken string) error
- func RevokeRefreshTokenByContext(c echo4.Context, refreshToken string) error
- func RevokeShortKeyByContext(c echo4.Context, key string) error
- func RevokeTicketByContext(c echo4.Context, ticketValue string) error
- func RoleAndPermissionGroup(ctx context.Context, group *echo4.Group, roles []string, perms []string, ...) *echo4.Group
- func RoleGroup(ctx context.Context, group *echo4.Group, roles []string, ...) *echo4.Group
- func RoleMiddleware(ctx context.Context, roles []string, opts ...AuthOption) echo4.MiddlewareFunc
- func SearchSessionIDByContext(c echo4.Context, keyword string, start, size int) ([]string, error)
- func SearchTokenValueByContext(c echo4.Context, keyword string, start, size int) ([]string, error)
- func SetSessionValueByContext(c echo4.Context, key string, value any) error
- func SetTokenCookieByContext(c echo4.Context, token string) error
- func TerminateByContext(c echo4.Context, opts manager.TerminateOptions) error
- func UnregisterOAuth2ClientByContext(c echo4.Context, clientID string) error
- func UntieByContext(c echo4.Context) error
- func UntieDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string) error
- func UntieDeviceByContext(c echo4.Context, device string) error
- func UntieServiceByContext(c echo4.Context, service string) error
- func ValidateOAuth2AccessTokenAndGetInfoByContext(c echo4.Context, accessToken string) (*oauth2.AccessToken, error)
- func ValidateOAuth2AccessTokenByContext(c echo4.Context, accessToken string) bool
- func ValidateShortKeyByContext(c echo4.Context, key string, opts ...shortkey.ValidateOptions) (*shortkey.ShortKey, error)
- func ValidateTicketByContext(c echo4.Context, ticketValue string, opts ...ticket.ValidateOptions) (*ticket.Ticket, error)
- func VerifyAndConsumeNonceByContext(c echo4.Context, nonce string) error
- func VerifyNonceByContext(c echo4.Context, nonce string) bool
- type AccessProvider
- type AccessProviderFunc
- type AccessSubject
- type AccessToken
- type AdminStorage
- type Annotation
- type AtomicStorage
- type Auth
- type AuthHandleRequest
- type AuthOption
- type AuthOptions
- type AuthorizationCode
- type Base64Serializer
- type BeforeAuthHandler
- type Builder
- type Codec
- type CodecFactory
- type ComponentFactories
- type Components
- type ConcurrencyScope
- type Config
- type CookieConfig
- type CookieOptions
- type DTokenBuilder
- type DTokenContext
- type DTokenError
- type DefaultGenerator
- type DeviceDisableInfo
- type DeviceDisableOptions
- type DisableInfo
- type DisableOptions
- type EchoContext
- func (e *EchoContext) Abort()
- func (e *EchoContext) Get(key string) (interface{}, bool)
- func (e *EchoContext) GetBody() ([]byte, error)
- func (e *EchoContext) GetClientIP() string
- func (e *EchoContext) GetCookie(key string) string
- func (e *EchoContext) GetHeader(key string) string
- func (e *EchoContext) GetHeaders() map[string][]string
- func (e *EchoContext) GetMethod() string
- func (e *EchoContext) GetPath() string
- func (e *EchoContext) GetPostForm(key string) string
- func (e *EchoContext) GetQuery(key string) string
- func (e *EchoContext) GetQueryAll() map[string][]string
- func (e *EchoContext) GetString(key string) string
- func (e *EchoContext) GetURL() string
- func (e *EchoContext) GetUserAgent() string
- func (e *EchoContext) IsAborted() bool
- func (e *EchoContext) IsTLS() bool
- func (e *EchoContext) MustGet(key string) any
- func (e *EchoContext) Set(key string, value interface{})
- func (e *EchoContext) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool)
- func (e *EchoContext) SetCookieWithOptions(options *adapter.CookieOptions)
- func (e *EchoContext) SetHeader(key, value string)
- func (e *EchoContext) SetStatusCode(code int)
- func (e *EchoContext) Write(data []byte) (int, error)
- type Event
- type EventData
- type EventFilter
- type EventManager
- type EventStats
- type FullStorage
- type Generator
- type GeneratorFactory
- type GrantType
- type JSONSerializer
- type Listener
- type ListenerConfig
- type ListenerFunc
- type Log
- type LogControl
- type LogFactory
- type LogLevel
- type Logger
- type LoggerConfig
- type LogicType
- type LoginOptions
- type LogoutMode
- type LogoutOptions
- type Manager
- type ManagerOption
- type ManagerRefreshTokenOptions
- type MemoryStorage
- type MsgPackSerializer
- type NonceConfig
- type NonceManager
- type NopLogger
- type OAuth2Client
- type OAuth2Config
- type OAuth2Server
- type PermissionOptions
- type Pool
- type PoolFactory
- type RedisConfig
- type RedisStorage
- type RefreshTokenInfo
- type RefreshTokenOptions
- type RefreshTokenPair
- type RenewPoolConfig
- type RenewPoolManager
- type ReplacedLoginExitMode
- type ReplacedLoginMode
- type RequestContext
- type RequestContextExt
- type RoleOptions
- type RouteAccessHandler
- type RouteAccessRequest
- type SameSiteMode
- type ScannerStorage
- type ServiceDisableInfo
- type ServiceDisableOptions
- type Session
- type Storage
- type StorageFactory
- type TerminalInfo
- type TerminalRemovalFunc
- type TerminalVisitor
- type TokenInfo
- type TokenIntrospection
- type TokenRequest
- type TokenState
- type TokenStyle
- type UserValidator
Constants ¶
const ( Version = corepkg.Version SameSiteStrict = config.SameSiteStrict SameSiteLax = config.SameSiteLax SameSiteNone = config.SameSiteNone ConcurrencyScopeAccount = config.ConcurrencyScopeAccount ConcurrencyScopeDevice = config.ConcurrencyScopeDevice ReplacedLoginModeOldDevice = config.ReplacedLoginExitModeOldDevice ReplacedLoginModeNewDevice = config.ReplacedLoginExitModeNewDevice ReplacedLoginExitModeOldDevice = config.ReplacedLoginExitModeOldDevice ReplacedLoginExitModeNewDevice = config.ReplacedLoginExitModeNewDevice LogoutModeLogout = config.LogoutModeLogout LogoutModeKickout = config.LogoutModeKickout LogoutModeReplaced = config.LogoutModeReplaced DefaultTokenName = config.DefaultTokenName DefaultKeyPrefix = config.DefaultKeyPrefix DefaultAuthType = config.DefaultAuthType TokenKeyPrefix = config.TokenKeyPrefix DefaultTimeout = config.DefaultTimeout DefaultRefreshTokenTimeout = config.DefaultRefreshTokenTimeout DefaultJWTSecretKey = config.DefaultJWTSecretKey DefaultMaxLoginCount = config.DefaultMaxLoginCount DefaultCookiePath = config.DefaultCookiePath NoLimit = config.NoLimit DefaultNonceTTL = nonce.DefaultNonceTTL NonceLength = nonce.NonceLength NonceKeySuffix = nonce.NonceKeySuffix DefaultAccessTTL = nonce.DefaultAccessTTL TokenStyleUUID = adapter.TokenStyleUUID TokenStyleSimple = adapter.TokenStyleSimple TokenStyleRandom32 = adapter.TokenStyleRandom32 TokenStyleRandom64 = adapter.TokenStyleRandom64 TokenStyleRandom128 = adapter.TokenStyleRandom128 TokenStyleJWT = adapter.TokenStyleJWT TokenStyleHash = adapter.TokenStyleHash TokenStyleTimestamp = adapter.TokenStyleTimestamp TokenStyleTik = adapter.TokenStyleTik LogLevelDebug = adapter.LogLevelDebug LogLevelInfo = adapter.LogLevelInfo LogLevelWarn = adapter.LogLevelWarn LogLevelError = adapter.LogLevelError EventLogin = listener.EventLogin EventLogout = listener.EventLogout EventKickout = listener.EventKickout EventReplace = listener.EventReplace EventDisable = listener.EventDisable EventUntie = listener.EventUntie EventRenew = listener.EventRenew EventCreateSession = listener.EventCreateSession EventDestroySession = listener.EventDestroySession EventPermissionCheck = listener.EventPermissionCheck EventPermissionChange = listener.EventPermissionChange EventRoleCheck = listener.EventRoleCheck EventRoleChange = listener.EventRoleChange EventDisableService = listener.EventDisableService EventUntieService = listener.EventUntieService EventDisableDevice = listener.EventDisableDevice EventUntieDevice = listener.EventUntieDevice EventRefreshTokenCreate = listener.EventRefreshTokenCreate EventRefreshTokenRotate = listener.EventRefreshTokenRotate EventRefreshTokenRevoke = listener.EventRefreshTokenRevoke EventNonceGenerate = listener.EventNonceGenerate EventNonceVerify = listener.EventNonceVerify EventTicketCreate = listener.EventTicketCreate EventTicketValidate = listener.EventTicketValidate EventTicketConsume = listener.EventTicketConsume EventTicketRevoke = listener.EventTicketRevoke EventShortKeyCreate = listener.EventShortKeyCreate EventShortKeyConfirm = listener.EventShortKeyConfirm EventShortKeyValidate = listener.EventShortKeyValidate EventShortKeyConsume = listener.EventShortKeyConsume EventShortKeyRevoke = listener.EventShortKeyRevoke EventOAuth2ClientRegister = listener.EventOAuth2ClientRegister EventOAuth2ClientUnregister = listener.EventOAuth2ClientUnregister EventOAuth2CodeGenerate = listener.EventOAuth2CodeGenerate EventOAuth2TokenIssue = listener.EventOAuth2TokenIssue EventOAuth2TokenRefresh = listener.EventOAuth2TokenRefresh EventOAuth2TokenValidate = listener.EventOAuth2TokenValidate EventOAuth2TokenRevoke = listener.EventOAuth2TokenRevoke EventAll = listener.EventAll ExtraKeyPermission = listener.ExtraKeyPermission ExtraKeyPermissions = listener.ExtraKeyPermissions ExtraKeyRole = listener.ExtraKeyRole ExtraKeyRoles = listener.ExtraKeyRoles ExtraKeyLogic = listener.ExtraKeyLogic ExtraKeyResult = listener.ExtraKeyResult ExtraKeyAction = listener.ExtraKeyAction ExtraKeyService = listener.ExtraKeyService ExtraKeyLevel = listener.ExtraKeyLevel ExtraKeyTokenType = listener.ExtraKeyTokenType ExtraKeyClientID = listener.ExtraKeyClientID ExtraKeyUserID = listener.ExtraKeyUserID ExtraKeyScopes = listener.ExtraKeyScopes ExtraKeySource = listener.ExtraKeySource ExtraKeySourceApp = listener.ExtraKeySourceApp ExtraKeyTargetApp = listener.ExtraKeyTargetApp ExtraKeyScene = listener.ExtraKeyScene ExtraKeyStatus = listener.ExtraKeyStatus ExtraKeyTTL = listener.ExtraKeyTTL ExtraKeyRefreshToken = listener.ExtraKeyRefreshToken ExtraKeyGrantType = listener.ExtraKeyGrantType EventLogicAnd = listener.LogicAnd EventLogicOr = listener.LogicOr ActionAdd = listener.ActionAdd ActionRemove = listener.ActionRemove ActionCreate = listener.ActionCreate ActionValidate = listener.ActionValidate ActionConsume = listener.ActionConsume ActionRevoke = listener.ActionRevoke ActionConfirm = listener.ActionConfirm ActionRotate = listener.ActionRotate ActionRegister = listener.ActionRegister ActionUnregister = listener.ActionUnregister ActionIssue = listener.ActionIssue ActionRefresh = listener.ActionRefresh DisableKeyPrefix = manager.DisableKeyPrefix DisableServiceKeyPrefix = manager.DisableServiceKeyPrefix DisableDeviceKeyPrefix = manager.DisableDeviceKeyPrefix DisableDeviceIDKeyPrefix = manager.DisableDeviceIDKeyPrefix SessionKeyPrefix = manager.SessionKeyPrefix RenewKeyPrefix = manager.RenewKeyPrefix ActivePrefix = manager.ActivePrefix RefreshTokenKeyPrefix = manager.RefreshTokenKeyPrefix TokenRefreshKeyPrefix = manager.TokenRefreshKeyPrefix SessionKeyLoginID = manager.SessionKeyLoginID SessionKeyDevice = manager.SessionKeyDevice SessionKeyLoginTime = manager.SessionKeyLoginTime SessionKeyPermissions = manager.SessionKeyPermissions SessionKeyRoles = manager.SessionKeyRoles PermissionWildcard = manager.PermissionWildcard PermissionSeparator = manager.PermissionSeparator TokenStateLogout = manager.TokenStateLogout TokenStateKickOut = manager.TokenStateKickOut TokenStateReplaced = manager.TokenStateReplaced TokenStateActiveTimeout = manager.TokenStateActiveTimeout DefaultCodeExpiration = oauth2.DefaultCodeExpiration DefaultTokenExpiration = oauth2.DefaultTokenExpiration DefaultRefreshTTL = oauth2.DefaultRefreshTTL CodeLength = oauth2.CodeLength AccessTokenLength = oauth2.AccessTokenLength RefreshTokenLength = oauth2.RefreshTokenLength CodeKeySuffix = oauth2.CodeKeySuffix OAuth2TokenKeySuffix = oauth2.TokenKeySuffix OAuth2RefreshKeySuffix = oauth2.RefreshKeySuffix ClientKeySuffix = oauth2.ClientKeySuffix GrantTypeAuthorizationCode = oauth2.GrantTypeAuthorizationCode GrantTypeRefreshToken = oauth2.GrantTypeRefreshToken GrantTypeClientCredentials = oauth2.GrantTypeClientCredentials GrantTypePassword = oauth2.GrantTypePassword CodeChallengeMethodPlain = oauth2.CodeChallengeMethodPlain CodeChallengeMethodS256 = oauth2.CodeChallengeMethodS256 TokenTypeBearer = oauth2.TokenTypeBearer TTLNoExpire = adapter.TTLNoExpire TTLNotFound = adapter.TTLNotFound )
Common constants forward core configuration values. Common 常量转发核心配置值。 Common 常量转发核心配置值。
const ( CodeSuccess = derror.CodeSuccess CodeBadRequest = derror.CodeBadRequest CodeNotLogin = derror.CodeNotLogin CodePermissionDenied = derror.CodePermissionDenied CodeNotFound = derror.CodeNotFound CodeServerError = derror.CodeServerError CodeTokenInvalid = derror.CodeTokenInvalid CodeTokenExpired = derror.CodeTokenExpired CodeAccountDisabled = derror.CodeAccountDisabled CodeKickedOut = derror.CodeKickedOut CodeActiveTimeout = derror.CodeActiveTimeout CodeMaxLoginCount = derror.CodeMaxLoginCount CodeStorageError = derror.CodeStorageError CodeInvalidParameter = derror.CodeInvalidParameter )
DToken error codes.
Variables ¶
var ( New = dtoken.New Default = dtoken.Default MustDefault = dtoken.MustDefault NewByAuthType = dtoken.NewByAuthType LoginWithOptions = dtoken.LoginWithOptions LoginWithRefreshTokenOptions = dtoken.LoginWithRefreshTokenOptions LogoutWithOptions = dtoken.LogoutWithOptions KickoutWithOptions = dtoken.KickoutWithOptions ReplaceWithOptions = dtoken.ReplaceWithOptions DisableWithOptions = dtoken.DisableWithOptions DisableServiceWithOptions = dtoken.DisableServiceWithOptions DisableDeviceWithOptions = dtoken.DisableDeviceWithOptions AddPermissionsWithOptions = dtoken.AddPermissionsWithOptions RemovePermissionsWithOptions = dtoken.RemovePermissionsWithOptions CheckPermissionWithOptions = dtoken.CheckPermissionWithOptions CheckPermissionsAndWithOptions = dtoken.CheckPermissionsAndWithOptions CheckPermissionsOrWithOptions = dtoken.CheckPermissionsOrWithOptions AddRolesWithOptions = dtoken.AddRolesWithOptions RemoveRolesWithOptions = dtoken.RemoveRolesWithOptions CheckRoleWithOptions = dtoken.CheckRoleWithOptions CheckRolesAndWithOptions = dtoken.CheckRolesAndWithOptions CheckRolesOrWithOptions = dtoken.CheckRolesOrWithOptions )
Instance and typed global operations.
var ( NewDTokenBuilder = dtoken.NewBuilder BuildAndSetManager = dtoken.BuildAndSetManager DefaultConfig = config.DefaultConfig DefaultCookieConfig = config.DefaultCookieConfig NewContext = corecontext.NewContext NewManager = manager.NewManager WithNonceManager = manager.WithNonceManager WithOAuth2Manager = manager.WithOAuth2Manager NewEventManager = listener.NewManager DefaultNonceConfig = nonce.DefaultConfig NewDefaultNonceManager = nonce.NewDefaultNonceManager NewNonceManagerWithConfig = nonce.NewNonceManagerWithConfig NewNonceManager = nonce.NewNonceManager DefaultOAuth2Config = oauth2.DefaultConfig NewDefaultOAuth2Server = oauth2.NewDefaultOAuth2Server NewOAuth2ServerWithConfig = oauth2.NewOAuth2ServerWithConfig NewOAuth2Server = oauth2.NewOAuth2Server NewRedisStorage = redisstorage.NewStorage NewRedisStorageFromConfig = redisstorage.NewStorageFromConfig NewRedisStorageFromClient = redisstorage.NewStorageFromClient NewStorageFromConfig = redisstorage.NewStorageFromConfig NewStorageFromClient = redisstorage.NewStorageFromClient NewMemoryStorage = memorystorage.NewStorage NewJSONSerializer = jsoncodec.NewJSONSerializer NewBase64Serializer = base64codec.NewBase64Serializer NewMsgPackSerializer = msgpackcodec.NewMsgPackSerializer NewDefaultTokenGenerator = dgenerator.NewDefaultGenerator NewTokenGenerator = dgenerator.NewGenerator DefaultLoggerConfig = dlog.DefaultLoggerConfig NewLoggerWithConfig = dlog.NewLoggerWithConfig DefaultRenewPoolConfig = ants.DefaultRenewPoolConfig NewRenewPoolManagerWithDefault = ants.NewRenewPoolManagerWithDefaultConfig NewRenewPoolManagerWithConfig = ants.NewRenewPoolManagerWithConfig NewNopLogger = nop.NewNopLogger NewAdapterNopLogger = adapter.NewNopLogger )
Component constructors forward bundled implementations. Component 构造器转发内置实现。
var ( NewDTokenError = derror.NewDTokenError ErrKeyNotFound = derror.ErrKeyNotFound ErrSerializeFailed = derror.ErrSerializeFailed ErrTypeConvert = derror.ErrTypeConvert ErrManagerNotFound = derror.ErrManagerNotFound ErrManagerInvalidType = derror.ErrManagerInvalidType ErrInvalidParam = derror.ErrInvalidParam ErrStorageCapabilityUnsupported = derror.ErrStorageCapabilityUnsupported ErrIDIsEmpty = derror.ErrIDIsEmpty ErrEmptyLoginID = derror.ErrEmptyLoginID ErrAccountDisabled = derror.ErrAccountDisabled ErrAccountNotDisabled = derror.ErrAccountNotDisabled ErrLoginLimitExceeded = derror.ErrLoginLimitExceeded ErrNotLogin = derror.ErrNotLogin ErrInvalidToken = derror.ErrInvalidToken ErrTokenExpired = derror.ErrTokenExpired ErrActiveTimeout = derror.ErrActiveTimeout ErrTokenKickout = derror.ErrTokenKickout ErrTokenReplaced = derror.ErrTokenReplaced ErrInvalidDevice = derror.ErrInvalidDevice ErrPermissionDenied = derror.ErrPermissionDenied ErrRoleDenied = derror.ErrRoleDenied ErrServiceDisabled = derror.ErrServiceDisabled ErrServiceNotDisabled = derror.ErrServiceNotDisabled ErrDeviceDisabled = derror.ErrDeviceDisabled ErrDeviceNotDisabled = derror.ErrDeviceNotDisabled ErrDisableLevelNotReached = derror.ErrDisableLevelNotReached ErrSessionNotFound = derror.ErrSessionNotFound ErrInvalidNonce = derror.ErrInvalidNonce ErrClientOrClientIDEmpty = derror.ErrClientOrClientIDEmpty ErrClientNotFound = derror.ErrClientNotFound ErrInvalidClientCredentials = derror.ErrInvalidClientCredentials ErrInvalidGrantType = derror.ErrInvalidGrantType ErrInvalidRedirectURI = derror.ErrInvalidRedirectURI ErrInvalidScope = derror.ErrInvalidScope ErrUserIDEmpty = derror.ErrUserIDEmpty ErrInvalidAuthCode = derror.ErrInvalidAuthCode ErrAuthCodeUsed = derror.ErrAuthCodeUsed ErrAuthCodeExpired = derror.ErrAuthCodeExpired ErrClientMismatch = derror.ErrClientMismatch ErrRedirectURIMismatch = derror.ErrRedirectURIMismatch ErrInvalidRefreshToken = derror.ErrInvalidRefreshToken ErrInvalidAccessToken = derror.ErrInvalidAccessToken ErrInvalidUserCredentials = derror.ErrInvalidUserCredentials ErrInvalidCodeVerifier = derror.ErrInvalidCodeVerifier )
DToken error helpers and values.
var ( SetManager = dtoken.SetManager GetManager = dtoken.GetManager GetEventManager = dtoken.GetEventManager DeleteManager = dtoken.DeleteManager DeleteAllManager = dtoken.DeleteAllManager Login = dtoken.Login LoginWithTimeout = dtoken.LoginWithTimeout LoginWithRefreshToken = dtoken.LoginWithRefreshToken RefreshToken = dtoken.RefreshToken RevokeRefreshToken = dtoken.RevokeRefreshToken GetRefreshTokenTTL = dtoken.GetRefreshTokenTTL IntrospectToken = dtoken.IntrospectToken LoginByToken = dtoken.LoginByToken Logout = dtoken.Logout LogoutByDeviceAndDeviceId = dtoken.LogoutByDeviceAndDeviceId LogoutByDevice = dtoken.LogoutByDevice LogoutByLoginID = dtoken.LogoutByLoginID Kickout = dtoken.Kickout Replace = dtoken.Replace KickoutByDeviceAndDeviceId = dtoken.KickoutByDeviceAndDeviceId KickoutByDevice = dtoken.KickoutByDevice KickoutByLoginID = dtoken.KickoutByLoginID ReplaceByDeviceAndDeviceId = dtoken.ReplaceByDeviceAndDeviceId ReplaceByDevice = dtoken.ReplaceByDevice ReplaceByLoginID = dtoken.ReplaceByLoginID IsLogin = dtoken.IsLogin CheckLogin = dtoken.CheckLogin GetLoginID = dtoken.GetLoginID GetTokenInfo = dtoken.GetTokenInfo GetDevice = dtoken.GetDevice GetDeviceId = dtoken.GetDeviceId GetTokenCreateTime = dtoken.GetTokenCreateTime GetTokenTTL = dtoken.GetTokenTTL GetOnlineTerminalCount = dtoken.GetOnlineTerminalCount GetOnlineTerminalCountByDevice = dtoken.GetOnlineTerminalCountByDevice GetOnlineTerminalCountByDeviceAndDeviceId = dtoken.GetOnlineTerminalCountByDeviceAndDeviceId Disable = dtoken.Disable Untie = dtoken.Untie IsDisable = dtoken.IsDisable GetDisableInfo = dtoken.GetDisableInfo GetDisableTTL = dtoken.GetDisableTTL DisableService = dtoken.DisableService DisableServiceWithReason = dtoken.DisableServiceWithReason DisableServiceLevel = dtoken.DisableServiceLevel DisableServiceLevelWithReason = dtoken.DisableServiceLevelWithReason UntieService = dtoken.UntieService IsDisableService = dtoken.IsDisableService IsDisableServiceLevel = dtoken.IsDisableServiceLevel CheckDisableService = dtoken.CheckDisableService CheckDisableServiceLevel = dtoken.CheckDisableServiceLevel GetDisableServiceInfo = dtoken.GetDisableServiceInfo GetDisableServiceTTL = dtoken.GetDisableServiceTTL DisableDevice = dtoken.DisableDevice DisableDeviceWithReason = dtoken.DisableDeviceWithReason DisableDeviceAndDeviceId = dtoken.DisableDeviceAndDeviceId DisableDeviceAndDeviceIdWithReason = dtoken.DisableDeviceAndDeviceIdWithReason UntieDevice = dtoken.UntieDevice UntieDeviceAndDeviceId = dtoken.UntieDeviceAndDeviceId IsDisableDevice = dtoken.IsDisableDevice IsDisableDeviceAndDeviceId = dtoken.IsDisableDeviceAndDeviceId CheckDisableDevice = dtoken.CheckDisableDevice CheckDisableDeviceAndDeviceId = dtoken.CheckDisableDeviceAndDeviceId GetDisableDeviceInfo = dtoken.GetDisableDeviceInfo GetDisableDeviceAndDeviceIdInfo = dtoken.GetDisableDeviceAndDeviceIdInfo GetDisableDeviceTTL = dtoken.GetDisableDeviceTTL GetDisableDeviceAndDeviceIdTTL = dtoken.GetDisableDeviceAndDeviceIdTTL CheckPermission = dtoken.CheckPermission CheckPermissionAnd = dtoken.CheckPermissionAnd CheckPermissionOr = dtoken.CheckPermissionOr CheckRole = dtoken.CheckRole CheckRoleAnd = dtoken.CheckRoleAnd CheckRoleOr = dtoken.CheckRoleOr CheckDisable = dtoken.CheckDisable RenewTimeout = dtoken.RenewTimeout ForEachTerminal = dtoken.ForEachTerminal ForEachTerminalByDevice = dtoken.ForEachTerminalByDevice GetSession = dtoken.GetSession GetSessionByToken = dtoken.GetSessionByToken GetTokenValueListByLoginID = dtoken.GetTokenValueListByLoginID GetTokenValueListByDeviceAndDeviceId = dtoken.GetTokenValueListByDeviceAndDeviceId GetTokenValueListByDevice = dtoken.GetTokenValueListByDevice GetTerminalListByLoginID = dtoken.GetTerminalListByLoginID GetTerminalListByLoginIDAndDevice = dtoken.GetTerminalListByLoginIDAndDevice GetTerminalInfoByToken = dtoken.GetTerminalInfoByToken GetTokenValueByLoginID = dtoken.GetTokenValueByLoginID GetTokenValueByLoginIDAndDevice = dtoken.GetTokenValueByLoginIDAndDevice SearchTokenValue = dtoken.SearchTokenValue SearchSessionId = dtoken.SearchSessionId AddPermissions = dtoken.AddPermissions AddPermissionsByToken = dtoken.AddPermissionsByToken RemovePermissions = dtoken.RemovePermissions RemovePermissionsByToken = dtoken.RemovePermissionsByToken GetPermissions = dtoken.GetPermissions GetPermissionsByToken = dtoken.GetPermissionsByToken HasPermission = dtoken.HasPermission HasPermissionByToken = dtoken.HasPermissionByToken HasPermissionsAnd = dtoken.HasPermissionsAnd HasPermissionsAndByToken = dtoken.HasPermissionsAndByToken HasPermissionsOr = dtoken.HasPermissionsOr HasPermissionsOrByToken = dtoken.HasPermissionsOrByToken AddRoles = dtoken.AddRoles AddRolesByToken = dtoken.AddRolesByToken RemoveRoles = dtoken.RemoveRoles RemoveRolesByToken = dtoken.RemoveRolesByToken GetRoles = dtoken.GetRoles GetRolesByToken = dtoken.GetRolesByToken HasRole = dtoken.HasRole HasRoleByToken = dtoken.HasRoleByToken HasRolesAnd = dtoken.HasRolesAnd HasRolesAndByToken = dtoken.HasRolesAndByToken HasRolesOr = dtoken.HasRolesOr HasRolesOrByToken = dtoken.HasRolesOrByToken GenerateNonce = dtoken.GenerateNonce GenerateNonceWithTimeout = dtoken.GenerateNonceWithTimeout VerifyNonce = dtoken.VerifyNonce VerifyAndConsumeNonce = dtoken.VerifyAndConsumeNonce IsNonceValid = dtoken.IsNonceValid GetNonceTTL = dtoken.GetNonceTTL RegisterOAuth2Client = dtoken.RegisterOAuth2Client UnregisterOAuth2Client = dtoken.UnregisterOAuth2Client GetOAuth2Client = dtoken.GetOAuth2Client OAuth2Token = dtoken.OAuth2Token GenerateOAuth2AuthorizationCode = dtoken.GenerateOAuth2AuthorizationCode GenerateOAuth2AuthorizationCodeWithPKCE = dtoken.GenerateOAuth2AuthorizationCodeWithPKCE ExchangeOAuth2CodeForToken = dtoken.ExchangeOAuth2CodeForToken ExchangeOAuth2CodeForTokenWithPKCE = dtoken.ExchangeOAuth2CodeForTokenWithPKCE OAuth2ClientCredentialsToken = dtoken.OAuth2ClientCredentialsToken OAuth2PasswordGrantToken = dtoken.OAuth2PasswordGrantToken RefreshOAuth2AccessToken = dtoken.RefreshOAuth2AccessToken ValidateOAuth2AccessToken = dtoken.ValidateOAuth2AccessToken ValidateOAuth2AccessTokenAndGetInfo = dtoken.ValidateOAuth2AccessTokenAndGetInfo RevokeOAuth2Token = dtoken.RevokeOAuth2Token )
DToken operations forward all exported dtoken APIs DToken 鎿嶄綔杞彂 dtoken 鐨勫叏閮ㄥ叕寮€ API銆?
var ( CheckPermissionByToken = dtoken.CheckPermissionByToken CheckPermissionAndByToken = dtoken.CheckPermissionAndByToken CheckPermissionOrByToken = dtoken.CheckPermissionOrByToken CheckRoleByToken = dtoken.CheckRoleByToken CheckRoleAndByToken = dtoken.CheckRoleAndByToken CheckRoleOrByToken = dtoken.CheckRoleOrByToken SetSessionValue = dtoken.SetSessionValue GetSessionValue = dtoken.GetSessionValue DeleteSessionValue = dtoken.DeleteSessionValue CreateTicket = dtoken.CreateTicket CreateTicketWithOptions = dtoken.CreateTicketWithOptions ValidateTicket = dtoken.ValidateTicket ValidateTicketWithOptions = dtoken.ValidateTicketWithOptions ConsumeTicket = dtoken.ConsumeTicket ConsumeTicketWithOptions = dtoken.ConsumeTicketWithOptions RevokeTicket = dtoken.RevokeTicket GetTicketStatus = dtoken.GetTicketStatus GetTicketTTL = dtoken.GetTicketTTL CreateShortKey = dtoken.CreateShortKey CreateShortKeyWithOptions = dtoken.CreateShortKeyWithOptions ConfirmShortKey = dtoken.ConfirmShortKey ConfirmShortKeyWithOptions = dtoken.ConfirmShortKeyWithOptions ValidateShortKey = dtoken.ValidateShortKey ValidateShortKeyWithOptions = dtoken.ValidateShortKeyWithOptions ConsumeShortKey = dtoken.ConsumeShortKey ConsumeShortKeyWithOptions = dtoken.ConsumeShortKeyWithOptions RevokeShortKey = dtoken.RevokeShortKey GetShortKeyStatus = dtoken.GetShortKeyStatus GetShortKeyTTL = dtoken.GetShortKeyTTL )
Additional facade operations keep framework imports self-contained. Additional facade 操作保持框架包自包含。
Functions ¶
func AccessMiddleware ¶ added in v0.0.3
func AccessMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
AccessMiddleware resolves route rules and checks login, permissions, and roles AccessMiddleware 解析路由规则并校验登录、权限、角色
func AddPermissionsByContext ¶
AddPermissionsByContext adds permissions to current token AddPermissionsByContext 为当前 token 添加权限
func AddRolesByContext ¶
AddRolesByContext adds roles to current token AddRolesByContext 为当前 token 添加角色
func AuthGroup ¶
func AuthGroup(ctx context.Context, group *echo4.Group, failFunc func(c echo4.Context, err error) error, authType ...string) *echo4.Group
AuthGroup attaches login middleware to Echo group AuthGroup 为 Echo 路由组挂载登录校验
func AuthMiddleware ¶
func AuthMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
AuthMiddleware checks whether current request is authenticated AuthMiddleware 校验当前请求是否已认证
func CheckAllMiddleware ¶
func CheckAllMiddleware(ctx context.Context, roles []string, perms []string, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckAllMiddleware decorates handler with login role and permission checks CheckAllMiddleware 为处理器增加登录角色权限校验
func CheckDisableByContext ¶ added in v0.0.3
CheckDisableByContext checks current account disable state CheckDisableByContext 鏍¢獙褰撳墠璐﹀彿灏佺鐘舵€?
func CheckDisableDeviceAndDeviceIDByContext ¶ added in v0.0.3
CheckDisableDeviceAndDeviceIDByContext checks current account device ID disable state CheckDisableDeviceAndDeviceIDByContext 鏍¢獙褰撳墠璐﹀彿璁惧 ID 灏佺鐘舵€?
func CheckDisableDeviceByContext ¶ added in v0.0.3
CheckDisableDeviceByContext checks current account device disable state CheckDisableDeviceByContext 鏍¢獙褰撳墠璐﹀彿璁惧灏佺鐘舵€?
func CheckDisableMiddleware ¶
func CheckDisableMiddleware(ctx context.Context, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckDisableMiddleware decorates handler with disable checks CheckDisableMiddleware 为处理器增加封禁校验
func CheckDisableServiceByContext ¶ added in v0.0.3
CheckDisableServiceByContext checks current account service disable state CheckDisableServiceByContext 鏍¢獙褰撳墠璐﹀彿鏈嶅姟灏佺鐘舵€?
func CheckDisableServiceLevelByContext ¶ added in v0.0.3
CheckDisableServiceLevelByContext checks current account service level disable state CheckDisableServiceLevelByContext 鏍¢獙褰撳墠璐﹀彿鏈嶅姟绛夌骇灏佺鐘舵€?
func CheckLoginAndPermissionMiddleware ¶
func CheckLoginAndPermissionMiddleware(ctx context.Context, perms []string, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckLoginAndPermissionMiddleware decorates handler with login and permission checks CheckLoginAndPermissionMiddleware 为处理器增加登录与权限校验
func CheckLoginAndRoleMiddleware ¶
func CheckLoginAndRoleMiddleware(ctx context.Context, roles []string, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckLoginAndRoleMiddleware decorates handler with login and role checks CheckLoginAndRoleMiddleware 为处理器增加登录与角色校验
func CheckLoginByContext ¶
CheckLoginByContext checks current request login state CheckLoginByContext 校验当前请求登录状态
func CheckLoginMiddleware ¶
func CheckLoginMiddleware(ctx context.Context, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckLoginMiddleware decorates handler with login checks CheckLoginMiddleware 为处理器增加登录校验
func CheckPermissionByContext ¶ added in v0.0.3
CheckPermissionByContext checks current user permission CheckPermissionByContext 校验当前用户权限。
func CheckPermissionMiddleware ¶
func CheckPermissionMiddleware(ctx context.Context, perms []string, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckPermissionMiddleware decorates handler with permission checks CheckPermissionMiddleware 为处理器增加权限校验
func CheckPermissionsAndByContext ¶ added in v0.0.3
CheckPermissionsAndByContext checks all current user permissions CheckPermissionsAndByContext 校验当前用户是否拥有全部权限。
func CheckPermissionsOrByContext ¶ added in v0.0.3
CheckPermissionsOrByContext checks any current user permission CheckPermissionsOrByContext 校验当前用户是否拥有任一权限。
func CheckRoleByContext ¶ added in v0.0.3
CheckRoleByContext checks current user role CheckRoleByContext 校验当前用户角色。
func CheckRoleMiddleware ¶
func CheckRoleMiddleware(ctx context.Context, roles []string, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, authType ...string) echo4.HandlerFunc
CheckRoleMiddleware decorates handler with role checks CheckRoleMiddleware 为处理器增加角色校验
func CheckRolesAndByContext ¶ added in v0.0.3
CheckRolesAndByContext checks all current user roles CheckRolesAndByContext 校验当前用户是否拥有全部角色。
func CheckRolesOrByContext ¶ added in v0.0.3
CheckRolesOrByContext checks any current user role CheckRolesOrByContext 校验当前用户是否拥有任一角色。
func ClearTokenCookieByContext ¶ added in v0.0.3
ClearTokenCookieByContext clears token cookie ClearTokenCookieByContext 娓呯悊 Token Cookie
func ConfirmShortKeyByContext ¶ added in v0.0.3
func ConfirmShortKeyByContext(c echo4.Context, key string, opts shortkey.ConfirmOptions) (*shortkey.ShortKey, error)
ConfirmShortKeyByContext confirms short key ConfirmShortKeyByContext 纭鐭?Key
func ConfirmShortKeyForCurrentLoginByContext ¶ added in v0.0.3
func ConfirmShortKeyForCurrentLoginByContext(c echo4.Context, key string, opts shortkey.ConfirmOptions) (*shortkey.ShortKey, error)
ConfirmShortKeyForCurrentLoginByContext confirms short key for current user ConfirmShortKeyForCurrentLoginByContext 使用当前用户确认 ShortKey
func ConsumeShortKeyByContext ¶ added in v0.0.3
func ConsumeShortKeyByContext(c echo4.Context, key string, opts ...shortkey.ValidateOptions) (*shortkey.ConsumeResult, error)
ConsumeShortKeyByContext consumes short key ConsumeShortKeyByContext 娑堣垂鐭?Key
func ConsumeTicketByContext ¶ added in v0.0.3
func ConsumeTicketByContext(c echo4.Context, ticketValue string, opts ...ticket.ValidateOptions) (*ticket.ConsumeResult, error)
ConsumeTicketByContext consumes ticket ConsumeTicketByContext 娑堣垂 Ticket
func CreateShortKeyByContext ¶ added in v0.0.3
func CreateShortKeyByContext(c echo4.Context, opts shortkey.CreateOptions) (*shortkey.ShortKey, error)
CreateShortKeyByContext creates short key CreateShortKeyByContext 鍒涘缓鐭?Key
func CreateShortKeyWithTimeoutByContext ¶ added in v0.0.3
func CreateShortKeyWithTimeoutByContext(c echo4.Context, opts shortkey.CreateOptions, timeout time.Duration) (*shortkey.ShortKey, error)
CreateShortKeyWithTimeoutByContext creates short key with timeout CreateShortKeyWithTimeoutByContext 浣跨敤鎸囧畾鏈夋晥鏈熷垱寤虹煭 Key
func CreateTicketByContext ¶ added in v0.0.3
CreateTicketByContext creates ticket CreateTicketByContext 鍒涘缓 Ticket
func CreateTicketForCurrentLoginByContext ¶ added in v0.0.3
func CreateTicketForCurrentLoginByContext(c echo4.Context, opts ticket.CreateOptions) (*ticket.Ticket, error)
CreateTicketForCurrentLoginByContext creates ticket for current user CreateTicketForCurrentLoginByContext 为当前用户创建 Ticket
func CreateTicketWithTimeoutByContext ¶ added in v0.0.3
func CreateTicketWithTimeoutByContext(c echo4.Context, opts ticket.CreateOptions, timeout time.Duration) (*ticket.Ticket, error)
CreateTicketWithTimeoutByContext creates ticket with timeout CreateTicketWithTimeoutByContext 浣跨敤鎸囧畾鏈夋晥鏈熷垱寤?Ticket
func DeleteSessionValueByContext ¶ added in v0.0.3
DeleteSessionValueByContext deletes current session value DeleteSessionValueByContext 鍒犻櫎褰撳墠浼氳瘽鍊?
func DisableByContext ¶
DisableByContext disables current user DisableByContext 封禁当前用户
func DisableDeviceAndDeviceIDByContext ¶ added in v0.0.3
func DisableDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string, duration time.Duration, reason ...string) error
DisableDeviceAndDeviceIDByContext disables current account device ID DisableDeviceAndDeviceIDByContext 鎸夎澶囧拰璁惧 ID 灏佺褰撳墠璐﹀彿
func DisableDeviceByContext ¶ added in v0.0.3
func DisableDeviceByContext(c echo4.Context, device string, duration time.Duration, reason ...string) error
DisableDeviceByContext disables current account device DisableDeviceByContext 灏佺褰撳墠璐﹀彿璁惧
func DisableServiceByContext ¶ added in v0.0.3
func DisableServiceByContext(c echo4.Context, service string, duration time.Duration, reason ...string) error
DisableServiceByContext disables current account service DisableServiceByContext 灏佺褰撳墠璐﹀彿鏈嶅姟
func DisableServiceLevelByContext ¶ added in v0.0.3
func DisableServiceLevelByContext(c echo4.Context, service string, level int, duration time.Duration, reason ...string) error
DisableServiceLevelByContext disables current account service level DisableServiceLevelByContext 鎸夌瓑绾у皝绂佸綋鍓嶈处鍙锋湇鍔?
func ExchangeOAuth2CodeForTokenByContext ¶ added in v0.0.3
func ExchangeOAuth2CodeForTokenByContext(c echo4.Context, code, clientID, clientSecret, redirectURI string) (*oauth2.AccessToken, error)
ExchangeOAuth2CodeForTokenByContext exchanges OAuth2 code for token ExchangeOAuth2CodeForTokenByContext 使用 OAuth2 授权码换取 Token
func ExchangeOAuth2CodeForTokenWithPKCEByContext ¶ added in v0.0.3
func ExchangeOAuth2CodeForTokenWithPKCEByContext(c echo4.Context, code, clientID, clientSecret, redirectURI, codeVerifier string) (*oauth2.AccessToken, error)
ExchangeOAuth2CodeForTokenWithPKCEByContext exchanges OAuth2 code for token with PKCE ExchangeOAuth2CodeForTokenWithPKCEByContext 使用 PKCE 授权码换取 Token
func ForEachTerminalByContext ¶ added in v0.0.3
func ForEachTerminalByContext(c echo4.Context, visitor manager.TerminalVisitor) error
ForEachTerminalByContext visits current user terminals ForEachTerminalByContext 閬嶅巻褰撳墠鐢ㄦ埛缁堢
func ForEachTerminalByDeviceByContext ¶ added in v0.0.3
func ForEachTerminalByDeviceByContext(c echo4.Context, device string, visitor manager.TerminalVisitor) error
ForEachTerminalByDeviceByContext visits current user terminals by device ForEachTerminalByDeviceByContext 鎸夎澶囬亶鍘嗗綋鍓嶇敤鎴风粓绔?
func GenerateNonceByContext ¶
GenerateNonceByContext generates nonce with current manager GenerateNonceByContext 使用当前管理器生成 nonce
func GenerateNonceWithTimeoutByContext ¶ added in v0.0.3
GenerateNonceWithTimeoutByContext generates nonce with timeout GenerateNonceWithTimeoutByContext 浣跨敤鎸囧畾鏈夋晥鏈熺敓鎴?Nonce
func GenerateOAuth2AuthorizationCodeByContext ¶ added in v0.0.3
func GenerateOAuth2AuthorizationCodeByContext(c echo4.Context, clientID, userID, redirectURI string, scopes []string) (*oauth2.AuthorizationCode, error)
GenerateOAuth2AuthorizationCodeByContext creates OAuth2 authorization code GenerateOAuth2AuthorizationCodeByContext 创建 OAuth2 授权码
func GenerateOAuth2AuthorizationCodeWithPKCEByContext ¶ added in v0.0.3
func GenerateOAuth2AuthorizationCodeWithPKCEByContext(c echo4.Context, clientID, userID, redirectURI string, scopes []string, codeChallenge, codeChallengeMethod string) (*oauth2.AuthorizationCode, error)
GenerateOAuth2AuthorizationCodeWithPKCEByContext creates OAuth2 authorization code with PKCE GenerateOAuth2AuthorizationCodeWithPKCEByContext 使用 PKCE 创建 OAuth2 授权码
func GetDTokenContext ¶
func GetDTokenContext(c echo4.Context) (*corecontext.DTokenContext, bool)
GetDTokenContext gets cached DToken context from Echo request GetDTokenContext 从 Echo 请求中获取缓存的 DToken 上下文
func GetDeviceByContext ¶
GetDeviceByContext gets current token device GetDeviceByContext 获取当前 token 设备类型
func GetDeviceIDByContext ¶
GetDeviceIDByContext gets current token device id GetDeviceIDByContext 获取当前 token 设备 ID
func GetDisableDeviceAndDeviceIDInfoByContext ¶ added in v0.0.3
func GetDisableDeviceAndDeviceIDInfoByContext(c echo4.Context, device, deviceId string) (*manager.DeviceDisableInfo, error)
GetDisableDeviceAndDeviceIDInfoByContext gets current account device ID disable info GetDisableDeviceAndDeviceIDInfoByContext 鑾峰彇褰撳墠璐﹀彿璁惧 ID 灏佺淇℃伅
func GetDisableDeviceAndDeviceIDTTLByContext ¶ added in v0.0.3
func GetDisableDeviceAndDeviceIDTTLByContext(c echo4.Context, device, deviceId string) (int64, error)
GetDisableDeviceAndDeviceIDTTLByContext gets current account device ID disable TTL GetDisableDeviceAndDeviceIDTTLByContext 鑾峰彇褰撳墠璐﹀彿璁惧 ID 灏佺鍓╀綑鏃堕棿
func GetDisableDeviceInfoByContext ¶ added in v0.0.3
func GetDisableDeviceInfoByContext(c echo4.Context, device string) (*manager.DeviceDisableInfo, error)
GetDisableDeviceInfoByContext gets current account device disable info GetDisableDeviceInfoByContext 鑾峰彇褰撳墠璐﹀彿璁惧灏佺淇℃伅
func GetDisableDeviceTTLByContext ¶ added in v0.0.3
GetDisableDeviceTTLByContext gets current account device disable TTL GetDisableDeviceTTLByContext 鑾峰彇褰撳墠璐﹀彿璁惧灏佺鍓╀綑鏃堕棿
func GetDisableInfoByContext ¶
func GetDisableInfoByContext(c echo4.Context) (*manager.DisableInfo, error)
GetDisableInfoByContext gets current user disable info GetDisableInfoByContext 获取当前用户封禁信息
func GetDisableServiceInfoByContext ¶ added in v0.0.3
func GetDisableServiceInfoByContext(c echo4.Context, service string) (*manager.ServiceDisableInfo, error)
GetDisableServiceInfoByContext gets current account service disable info GetDisableServiceInfoByContext 鑾峰彇褰撳墠璐﹀彿鏈嶅姟灏佺淇℃伅
func GetDisableServiceTTLByContext ¶ added in v0.0.3
GetDisableServiceTTLByContext gets current account service disable TTL GetDisableServiceTTLByContext 鑾峰彇褰撳墠璐﹀彿鏈嶅姟灏佺鍓╀綑鏃堕棿
func GetDisableTTLByContext ¶
GetDisableTTLByContext gets current user disable ttl GetDisableTTLByContext 获取当前用户封禁剩余时间
func GetHandler ¶
func GetHandler(ctx context.Context, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error, annotations ...*Annotation) echo4.HandlerFunc
GetHandler wraps Echo handler with annotation checks GetHandler 使用注解检查包装 Echo 处理器
func GetLatestTokenValueByContext ¶ added in v0.0.3
GetLatestTokenValueByContext gets latest current user token GetLatestTokenValueByContext 鑾峰彇褰撳墠鐢ㄦ埛鏈€鏂?Token
func GetLoginIDByContext ¶
GetLoginIDByContext gets current login ID GetLoginIDByContext 获取当前登录 ID
func GetManagerByContext ¶ added in v0.0.3
GetManagerByContext gets current DToken manager GetManagerByContext 获取当前 DToken 管理器
func GetNonceTTLByContext ¶ added in v0.0.3
GetNonceTTLByContext gets nonce TTL GetNonceTTLByContext 鑾峰彇 Nonce 鍓╀綑鏈夋晥鏈?
func GetOAuth2ClientByContext ¶ added in v0.0.3
GetOAuth2ClientByContext gets OAuth2 client GetOAuth2ClientByContext 获取 OAuth2 客户端
func GetOnlineTerminalCountByContext ¶
GetOnlineTerminalCountByContext gets current user online terminal count GetOnlineTerminalCountByContext 获取当前用户在线终端数量
func GetOnlineTerminalCountByDeviceAndDeviceIDByContext ¶ added in v0.0.3
func GetOnlineTerminalCountByDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string) (int, error)
GetOnlineTerminalCountByDeviceAndDeviceIDByContext gets online count by device ID GetOnlineTerminalCountByDeviceAndDeviceIDByContext 鎸夎澶囧拰璁惧 ID 鑾峰彇鍦ㄧ嚎缁堢鏁?
func GetOnlineTerminalCountByDeviceByContext ¶ added in v0.0.3
GetOnlineTerminalCountByDeviceByContext gets online count by device GetOnlineTerminalCountByDeviceByContext 鎸夎澶囪幏鍙栧湪绾跨粓绔暟
func GetPermissionsByContext ¶
GetPermissionsByContext gets current user permissions GetPermissionsByContext 获取当前用户权限列表
func GetPermissionsByTokenByContext ¶
GetPermissionsByTokenByContext gets current token permissions GetPermissionsByTokenByContext 使用当前 token 获取权限列表
func GetRefreshTokenTTLByContext ¶ added in v0.0.3
GetRefreshTokenTTLByContext gets refresh token TTL GetRefreshTokenTTLByContext 鑾峰彇鍒锋柊 Token 鍓╀綑鏈夋晥鏈?
func GetRequestContextByContext ¶ added in v0.0.3
func GetRequestContextByContext(c echo4.Context) (adapter.RequestContext, error)
GetRequestContextByContext gets raw request context GetRequestContextByContext 获取原始请求上下文
func GetRolesByContext ¶
GetRolesByContext gets current user roles GetRolesByContext 获取当前用户角色列表
func GetRolesByTokenByContext ¶
GetRolesByTokenByContext gets current token roles GetRolesByTokenByContext 使用当前 token 获取角色列表
func GetSessionByContext ¶
GetSessionByContext gets current user session GetSessionByContext 获取当前用户会话
func GetSessionByTokenByContext ¶
GetSessionByTokenByContext gets current token session GetSessionByTokenByContext 获取当前 token 会话
func GetSessionValueByContext ¶ added in v0.0.3
GetSessionValueByContext gets current session value GetSessionValueByContext 鑾峰彇褰撳墠浼氳瘽鍊?
func GetShortKeyStatusByContext ¶ added in v0.0.3
GetShortKeyStatusByContext gets short key status GetShortKeyStatusByContext 鑾峰彇鐭?Key 鐘舵€?
func GetShortKeyTTLByContext ¶ added in v0.0.3
GetShortKeyTTLByContext gets short key TTL GetShortKeyTTLByContext 鑾峰彇鐭?Key 鍓╀綑鏈夋晥鏈?
func GetTerminalInfoByContext ¶ added in v0.0.3
func GetTerminalInfoByContext(c echo4.Context) (*manager.TerminalInfo, error)
GetTerminalInfoByContext gets current terminal info GetTerminalInfoByContext 鑾峰彇褰撳墠缁堢淇℃伅
func GetTerminalListByContext ¶ added in v0.0.3
GetTerminalListByContext gets current user terminal list GetTerminalListByContext 鑾峰彇褰撳墠鐢ㄦ埛缁堢鍒楄〃
func GetTicketStatusByContext ¶ added in v0.0.3
GetTicketStatusByContext gets ticket status GetTicketStatusByContext 鑾峰彇 Ticket 鐘舵€?
func GetTicketTTLByContext ¶ added in v0.0.3
GetTicketTTLByContext gets ticket TTL GetTicketTTLByContext 鑾峰彇 Ticket 鍓╀綑鏈夋晥鏈?
func GetTokenCreateTimeByContext ¶
GetTokenCreateTimeByContext gets current token create time GetTokenCreateTimeByContext 获取当前 token 创建时间
func GetTokenInfoByContext ¶
GetTokenInfoByContext gets current token info GetTokenInfoByContext 获取当前 token 信息
func GetTokenTTLByContext ¶
GetTokenTTLByContext gets current token TTL GetTokenTTLByContext 获取当前 token 剩余有效期
func GetTokenValueByContext ¶
GetTokenValueByContext gets token value from current Echo context GetTokenValueByContext 从当前 Echo 上下文获取 token 值
func GetTokenValueListByContext ¶
GetTokenValueListByContext gets current user token list GetTokenValueListByContext 获取当前用户 token 列表
func GetTokenValueListByDeviceAndDeviceIDByContext ¶ added in v0.0.3
func GetTokenValueListByDeviceAndDeviceIDByContext(c echo4.Context, device, deviceId string, checkAlive ...bool) ([]string, error)
GetTokenValueListByDeviceAndDeviceIDByContext gets current user tokens by device ID GetTokenValueListByDeviceAndDeviceIDByContext 鎸夎澶囧拰璁惧 ID 鑾峰彇褰撳墠鐢ㄦ埛 Token 鍒楄〃
func GetTokenValueListByDeviceByContext ¶ added in v0.0.3
func GetTokenValueListByDeviceByContext(c echo4.Context, device string, checkAlive ...bool) ([]string, error)
GetTokenValueListByDeviceByContext gets current user tokens by device GetTokenValueListByDeviceByContext 鎸夎澶囪幏鍙栧綋鍓嶇敤鎴?Token 鍒楄〃
func HasPermissionByContext ¶
HasPermissionByContext checks current user permission HasPermissionByContext 检查当前用户权限
func HasPermissionsAndByContext ¶
HasPermissionsAndByContext checks whether current user has all permissions HasPermissionsAndByContext 检查当前用户是否拥有全部权限
func HasPermissionsByContext ¶
HasPermissionsByContext checks whether current user has any permission HasPermissionsByContext 检查当前用户是否拥有任一权限
func HasPermissionsOrByContext ¶
HasPermissionsOrByContext checks whether current user has any permission HasPermissionsOrByContext 检查当前用户是否拥有任一权限
func HasRoleByContext ¶
HasRoleByContext checks current user role HasRoleByContext 检查当前用户角色
func HasRolesAndByContext ¶
HasRolesAndByContext checks whether current user has all roles HasRolesAndByContext 检查当前用户是否拥有全部角色
func HasRolesByContext ¶
HasRolesByContext checks whether current user has any role HasRolesByContext 检查当前用户是否拥有任一角色
func HasRolesOrByContext ¶
HasRolesOrByContext checks whether current user has any role HasRolesOrByContext 检查当前用户是否拥有任一角色
func IgnoreMiddleware ¶
func IgnoreMiddleware(ctx context.Context, handler echo4.HandlerFunc, failFunc func(c echo4.Context, err error) error) echo4.HandlerFunc
IgnoreMiddleware skips DToken checks for wrapped handler IgnoreMiddleware 为处理器跳过 DToken 校验
func IntrospectTokenByContext ¶ added in v0.0.3
func IntrospectTokenByContext(c echo4.Context) (*manager.TokenIntrospection, error)
IntrospectTokenByContext inspects current token without renewal side effects IntrospectTokenByContext 无续期副作用地检查当前 token 状态
func IsDisableByContext ¶
IsDisableByContext checks whether current user is disabled IsDisableByContext 检查当前用户是否被封禁
func IsDisableDeviceAndDeviceIDByContext ¶ added in v0.0.3
IsDisableDeviceAndDeviceIDByContext checks current account device ID disable state IsDisableDeviceAndDeviceIDByContext 妫€鏌ュ綋鍓嶈处鍙疯澶?ID 灏佺鐘舵€?
func IsDisableDeviceByContext ¶ added in v0.0.3
IsDisableDeviceByContext checks current account device disable state IsDisableDeviceByContext 妫€鏌ュ綋鍓嶈处鍙疯澶囧皝绂佺姸鎬?
func IsDisableServiceByContext ¶ added in v0.0.3
IsDisableServiceByContext checks current account service disable state IsDisableServiceByContext 妫€鏌ュ綋鍓嶈处鍙锋湇鍔″皝绂佺姸鎬?
func IsDisableServiceLevelByContext ¶ added in v0.0.3
IsDisableServiceLevelByContext checks current account service level disable state IsDisableServiceLevelByContext 妫€鏌ュ綋鍓嶈处鍙锋湇鍔$瓑绾у皝绂佺姸鎬?
func IsLoginByContext ¶
IsLoginByContext checks current request login state IsLoginByContext 检查当前请求登录状态
func IsValidNonceByContext ¶ added in v0.0.3
IsValidNonceByContext checks nonce state IsValidNonceByContext 妫€鏌?Nonce 鐘舵€?
func KickoutByContext ¶
KickoutByContext kicks out current request token KickoutByContext 踢出当前请求 token
func KickoutByDeviceAndDeviceIDByContext ¶ added in v0.0.3
KickoutByDeviceAndDeviceIDByContext kicks out current user by device ID KickoutByDeviceAndDeviceIDByContext 鎸夎澶囧拰璁惧 ID 韪㈠嚭褰撳墠鐢ㄦ埛
func KickoutByDeviceByContext ¶ added in v0.0.3
KickoutByDeviceByContext kicks out current user by device KickoutByDeviceByContext 鎸夎澶囪涪鍑哄綋鍓嶇敤鎴?
func KickoutByLoginIDByContext ¶ added in v0.0.3
KickoutByLoginIDByContext kicks out all terminals of current user KickoutByLoginIDByContext 踢出当前用户全部终端
func LoginByContext ¶ added in v0.0.3
LoginByContext logs in current Echo request LoginByContext 在当前 Echo 请求中登录
func LoginByTokenByContext ¶
LoginByTokenByContext renews current token login state LoginByTokenByContext 使用当前 token 续期登录态
func LoginWithCookieByContext ¶ added in v0.0.3
func LoginWithCookieByContext(c echo4.Context, loginID string, deviceAndDeviceId ...string) (string, error)
LoginWithCookieByContext logs in and writes token cookie LoginWithCookieByContext 登录并写入 Token Cookie
func LoginWithCookieOptionsByContext ¶ added in v0.0.3
LoginWithCookieOptionsByContext logs in with options and writes token cookie LoginWithCookieOptionsByContext 使用登录选项登录并写入 Token Cookie
func LoginWithCookieTimeoutByContext ¶ added in v0.0.3
func LoginWithCookieTimeoutByContext(c echo4.Context, loginID string, timeout time.Duration, deviceAndDeviceId ...string) (string, error)
LoginWithCookieTimeoutByContext logs in with timeout and writes token cookie LoginWithCookieTimeoutByContext 使用指定有效期登录并写入 Token Cookie
func LoginWithOptionsByContext ¶ added in v0.0.3
LoginWithOptionsByContext logs in current Echo request with options LoginWithOptionsByContext 使用登录选项登录当前 Echo 请求
func LoginWithRefreshTokenByContext ¶ added in v0.0.3
func LoginWithRefreshTokenByContext(c echo4.Context, loginID string, deviceAndDeviceId ...string) (*manager.RefreshTokenPair, error)
LoginWithRefreshTokenByContext logs in and issues refresh token LoginWithRefreshTokenByContext 登录并签发刷新 Token
func LoginWithRefreshTokenOptionsByContext ¶ added in v0.0.3
func LoginWithRefreshTokenOptionsByContext(c echo4.Context, opts manager.RefreshTokenOptions) (*manager.RefreshTokenPair, error)
LoginWithRefreshTokenOptionsByContext logs in with refresh token options LoginWithRefreshTokenOptionsByContext 使用刷新 Token 选项登录
func LoginWithTimeoutByContext ¶ added in v0.0.3
func LoginWithTimeoutByContext(c echo4.Context, loginID string, timeout time.Duration, deviceAndDeviceId ...string) (string, error)
LoginWithTimeoutByContext logs in current Echo request with timeout LoginWithTimeoutByContext 使用指定有效期登录当前 Echo 请求
func LogoutByContext ¶
LogoutByContext logs out current request token LogoutByContext 登出当前请求 token
func LogoutByDeviceAndDeviceIdByContext ¶
LogoutByDeviceAndDeviceIdByContext logs out current user by device and id LogoutByDeviceAndDeviceIdByContext 按设备和设备 ID 登出当前用户
func LogoutByDeviceByContext ¶
LogoutByDeviceByContext logs out current user by device LogoutByDeviceByContext 按设备登出当前用户
func LogoutByLoginIDByContext ¶
LogoutByLoginIDByContext logs out all terminals of current user LogoutByLoginIDByContext 登出当前用户所有终端
func LogoutWithCookieByContext ¶ added in v0.0.3
LogoutWithCookieByContext logs out and clears token cookie LogoutWithCookieByContext 閫€鍑虹櫥褰曞苟娓呯悊 Token Cookie
func NewBuilder ¶
NewBuilder creates a default DToken builder NewBuilder 鍒涘缓榛樿 DToken 鏋勫缓鍣ㄣ€?
func NewEchoContext ¶
func NewEchoContext(c echo4.Context) adapter.RequestContext
NewEchoContext creates Echo request context adapter 创建 Echo 请求上下文适配器
func OAuth2ClientCredentialsTokenByContext ¶ added in v0.0.3
func OAuth2ClientCredentialsTokenByContext(c echo4.Context, clientID, clientSecret string, scopes []string) (*oauth2.AccessToken, error)
OAuth2ClientCredentialsTokenByContext gets OAuth2 token by client credentials OAuth2ClientCredentialsTokenByContext 使用客户端凭证获取 OAuth2 Token
func OAuth2PasswordGrantTokenByContext ¶ added in v0.0.3
func OAuth2PasswordGrantTokenByContext(c echo4.Context, clientID, clientSecret, username, password string, scopes []string, validateUser oauth2.UserValidator) (*oauth2.AccessToken, error)
OAuth2PasswordGrantTokenByContext gets OAuth2 token by password grant OAuth2PasswordGrantTokenByContext 使用密码模式获取 OAuth2 Token
func OAuth2TokenByContext ¶ added in v0.0.3
func OAuth2TokenByContext(c echo4.Context, req *oauth2.TokenRequest, validateUser oauth2.UserValidator) (*oauth2.AccessToken, error)
OAuth2TokenByContext handles OAuth2 token request OAuth2TokenByContext 处理 OAuth2 Token 请求
func PermissionGroup ¶
func PermissionGroup(ctx context.Context, group *echo4.Group, perms []string, failFunc func(c echo4.Context, err error) error, authType ...string) *echo4.Group
PermissionGroup attaches login and permission middleware to Echo group PermissionGroup 为 Echo 路由组挂载登录与权限校验
func PermissionMiddleware ¶
func PermissionMiddleware(ctx context.Context, permissions []string, opts ...AuthOption) echo4.MiddlewareFunc
PermissionMiddleware checks whether current token has required permissions PermissionMiddleware 校验当前 token 是否具备所需权限
func RefreshOAuth2AccessTokenByContext ¶ added in v0.0.3
func RefreshOAuth2AccessTokenByContext(c echo4.Context, clientID, refreshToken, clientSecret string) (*oauth2.AccessToken, error)
RefreshOAuth2AccessTokenByContext refreshes OAuth2 access token RefreshOAuth2AccessTokenByContext 刷新 OAuth2 访问 Token
func RefreshTokenByContext ¶ added in v0.0.3
RefreshTokenByContext refreshes access token RefreshTokenByContext 鍒锋柊璁块棶 Token
func RegisterDTokenContextMiddleware ¶
func RegisterDTokenContextMiddleware(ctx context.Context, opts ...AuthOption) echo4.MiddlewareFunc
RegisterDTokenContextMiddleware initializes DToken context per request RegisterDTokenContextMiddleware 初始化每个请求的 DToken 上下文
func RegisterOAuth2ClientByContext ¶ added in v0.0.3
RegisterOAuth2ClientByContext registers OAuth2 client RegisterOAuth2ClientByContext 注册 OAuth2 客户端
func RemovePermissionsByContext ¶
RemovePermissionsByContext removes permissions from current token RemovePermissionsByContext 从当前 token 移除权限
func RemoveRolesByContext ¶
RemoveRolesByContext removes roles from current token RemoveRolesByContext 从当前 token 移除角色
func RenewTimeoutByContext ¶
RenewTimeoutByContext renews current token timeout RenewTimeoutByContext 续期当前 token 过期时间
func ReplaceByContext ¶
ReplaceByContext replaces current request token ReplaceByContext 顶替当前请求 token
func ReplaceByDeviceAndDeviceIDByContext ¶ added in v0.0.3
ReplaceByDeviceAndDeviceIDByContext replaces current user by device ID ReplaceByDeviceAndDeviceIDByContext 鎸夎澶囧拰璁惧 ID 椤舵浛褰撳墠鐢ㄦ埛
func ReplaceByDeviceByContext ¶ added in v0.0.3
ReplaceByDeviceByContext replaces current user by device ReplaceByDeviceByContext 鎸夎澶囬《鏇垮綋鍓嶇敤鎴?
func ReplaceByLoginIDByContext ¶ added in v0.0.3
ReplaceByLoginIDByContext replaces all terminals of current user ReplaceByLoginIDByContext 顶替当前用户全部终端
func RevokeOAuth2TokenByContext ¶ added in v0.0.3
RevokeOAuth2TokenByContext revokes OAuth2 token RevokeOAuth2TokenByContext 撤销 OAuth2 Token
func RevokeRefreshTokenByContext ¶ added in v0.0.3
RevokeRefreshTokenByContext revokes refresh token RevokeRefreshTokenByContext 鎾ら攢鍒锋柊 Token
func RevokeShortKeyByContext ¶ added in v0.0.3
RevokeShortKeyByContext revokes short key RevokeShortKeyByContext 鎾ら攢鐭?Key
func RevokeTicketByContext ¶ added in v0.0.3
RevokeTicketByContext revokes ticket RevokeTicketByContext 鎾ら攢 Ticket
func RoleAndPermissionGroup ¶
func RoleAndPermissionGroup(ctx context.Context, group *echo4.Group, roles []string, perms []string, failFunc func(c echo4.Context, err error) error, authType ...string) *echo4.Group
RoleAndPermissionGroup attaches login role and permission middleware to Echo group RoleAndPermissionGroup 为 Echo 路由组挂载登录角色权限校验
func RoleGroup ¶
func RoleGroup(ctx context.Context, group *echo4.Group, roles []string, failFunc func(c echo4.Context, err error) error, authType ...string) *echo4.Group
RoleGroup attaches login and role middleware to Echo group RoleGroup 为 Echo 路由组挂载登录与角色校验
func RoleMiddleware ¶
func RoleMiddleware(ctx context.Context, roles []string, opts ...AuthOption) echo4.MiddlewareFunc
RoleMiddleware checks whether current token has required roles RoleMiddleware 校验当前 token 是否具备所需角色
func SearchSessionIDByContext ¶ added in v0.0.3
SearchSessionIDByContext searches session ids SearchSessionIDByContext 鎼滅储 Session ID
func SearchTokenValueByContext ¶ added in v0.0.3
SearchTokenValueByContext searches token values SearchTokenValueByContext 鎼滅储 Token 鍊?
func SetSessionValueByContext ¶ added in v0.0.3
SetSessionValueByContext sets current session value SetSessionValueByContext 璁剧疆褰撳墠浼氳瘽鍊?
func SetTokenCookieByContext ¶ added in v0.0.3
SetTokenCookieByContext writes token cookie SetTokenCookieByContext 鍐欏叆 Token Cookie
func TerminateByContext ¶ added in v0.0.3
func TerminateByContext(c echo4.Context, opts manager.TerminateOptions) error
TerminateByContext terminates current or specified terminal TerminateByContext 涓嬬嚎褰撳墠鎴栨寚瀹氱粓绔?
func UnregisterOAuth2ClientByContext ¶ added in v0.0.3
UnregisterOAuth2ClientByContext unregisters OAuth2 client UnregisterOAuth2ClientByContext 注销 OAuth2 客户端
func UntieByContext ¶
UntieByContext removes current user disable state UntieByContext 解封当前用户
func UntieDeviceAndDeviceIDByContext ¶ added in v0.0.3
UntieDeviceAndDeviceIDByContext removes current account device ID disable state UntieDeviceAndDeviceIDByContext 瑙e皝褰撳墠璐﹀彿璁惧 ID
func UntieDeviceByContext ¶ added in v0.0.3
UntieDeviceByContext removes current account device disable state UntieDeviceByContext 瑙e皝褰撳墠璐﹀彿璁惧
func UntieServiceByContext ¶ added in v0.0.3
UntieServiceByContext removes current account service disable state UntieServiceByContext 瑙e皝褰撳墠璐﹀彿鏈嶅姟
func ValidateOAuth2AccessTokenAndGetInfoByContext ¶ added in v0.0.3
func ValidateOAuth2AccessTokenAndGetInfoByContext(c echo4.Context, accessToken string) (*oauth2.AccessToken, error)
ValidateOAuth2AccessTokenAndGetInfoByContext validates OAuth2 access token and gets info ValidateOAuth2AccessTokenAndGetInfoByContext 校验 OAuth2 访问 Token 并获取信息
func ValidateOAuth2AccessTokenByContext ¶ added in v0.0.3
ValidateOAuth2AccessTokenByContext validates OAuth2 access token ValidateOAuth2AccessTokenByContext 校验 OAuth2 访问 Token
func ValidateShortKeyByContext ¶ added in v0.0.3
func ValidateShortKeyByContext(c echo4.Context, key string, opts ...shortkey.ValidateOptions) (*shortkey.ShortKey, error)
ValidateShortKeyByContext validates short key ValidateShortKeyByContext 鏍¢獙鐭?Key
func ValidateTicketByContext ¶ added in v0.0.3
func ValidateTicketByContext(c echo4.Context, ticketValue string, opts ...ticket.ValidateOptions) (*ticket.Ticket, error)
ValidateTicketByContext validates ticket ValidateTicketByContext 鏍¢獙 Ticket
func VerifyAndConsumeNonceByContext ¶
VerifyAndConsumeNonceByContext verifies and consumes nonce with current manager VerifyAndConsumeNonceByContext 使用当前管理器验证并消费 nonce
Types ¶
type AccessProvider ¶
type AccessProvider = manager.AccessProvider
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type AccessProviderFunc ¶
type AccessProviderFunc = manager.AccessProviderFunc
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type AccessSubject ¶
type AccessSubject = manager.AccessSubject
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type AccessToken ¶
type AccessToken = oauth2.AccessToken
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type AdminStorage ¶
type AdminStorage = adapter.AdminStorage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type Annotation ¶
type Annotation struct {
AuthType string
CheckLogin bool
CheckRole []string
CheckPermission []string
CheckDisable bool
Ignore bool
LogicType LogicType
}
Annotation describes declarative auth requirements Annotation 描述声明式认证要求
type AtomicStorage ¶
type AtomicStorage = adapter.AtomicStorage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type AuthHandleRequest ¶
type AuthHandleRequest struct {
AuthType string
CheckLogin bool
CheckDisable bool
Permissions []string
Roles []string
LogicType LogicType
// contains filtered or unexported fields
}
AuthHandleRequest carries auth check metadata AuthHandleRequest 携带认证校验元数据
func (*AuthHandleRequest) Exit ¶
func (req *AuthHandleRequest) Exit()
Exit stops dtoken checks after custom handling Exit 自定义处理后停止 dtoken 校验
func (*AuthHandleRequest) IsHandled ¶
func (req *AuthHandleRequest) IsHandled() bool
IsHandled reports whether request has been handled IsHandled 判断请求是否已处理
func (*AuthHandleRequest) Next ¶
func (req *AuthHandleRequest) Next()
Next continues request and stops dtoken checks Next 放行请求并停止 dtoken 校验
type AuthOption ¶
type AuthOption func(*AuthOptions)
AuthOption defines auth option setter AuthOption 定义认证选项设置器
func WithAuthType ¶
func WithAuthType(authType string) AuthOption
WithAuthType sets middleware auth type WithAuthType 设置中间件认证类型
func WithBeforeAuthHandler ¶
func WithBeforeAuthHandler(fn BeforeAuthHandler) AuthOption
WithBeforeAuthHandler sets pre auth handler WithBeforeAuthHandler 设置认证前置处理器
func WithFailFunc ¶
func WithFailFunc(fn func(c echo4.Context, err error) error) AuthOption
WithFailFunc sets auth failure callback WithFailFunc 设置认证失败回调
func WithLogicType ¶
func WithLogicType(logicType LogicType) AuthOption
WithLogicType sets middleware logic type WithLogicType 设置中间件逻辑类型
func WithRouteAccessHandler ¶ added in v0.0.3
func WithRouteAccessHandler(fn RouteAccessHandler) AuthOption
WithRouteAccessHandler sets route access handler WithRouteAccessHandler 设置路由访问处理器
type AuthOptions ¶
type AuthOptions struct {
AuthType string
LogicType LogicType
FailFunc func(c echo4.Context, err error) error
BeforeAuthHandler BeforeAuthHandler
RouteAccessHandler RouteAccessHandler
}
AuthOptions carries middleware auth options AuthOptions 保存中间件认证选项
type AuthorizationCode ¶
type AuthorizationCode = oauth2.AuthorizationCode
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type Base64Serializer ¶
type Base64Serializer = base64codec.Base64Serializer
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type BeforeAuthHandler ¶
type BeforeAuthHandler func(ctx context.Context, c echo4.Context, req *AuthHandleRequest)
BeforeAuthHandler handles request before dtoken checks BeforeAuthHandler 在 dtoken 校验前处理请求
type CodecFactory ¶
type CodecFactory = builder.CodecFactory
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ComponentFactories ¶
type ComponentFactories = builder.ComponentFactories
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type Components ¶
type Components = builder.Components
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ConcurrencyScope ¶
type ConcurrencyScope = config.ConcurrencyScope
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type CookieConfig ¶
type CookieConfig = config.CookieConfig
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type CookieOptions ¶
type CookieOptions = adapter.CookieOptions
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type DTokenBuilder ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type DTokenContext ¶
type DTokenContext = corecontext.DTokenContext
DTokenContext exposes request scoped DToken context DTokenContext 鏆撮湶璇锋眰绾?DToken 涓婁笅鏂囩被鍨嬨€?
type DTokenError ¶
type DTokenError = derror.DTokenError
DTokenError exposes the core DToken error type.
type DefaultGenerator ¶
type DefaultGenerator = dgenerator.Generator
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type DeviceDisableInfo ¶
type DeviceDisableInfo = manager.DeviceDisableInfo
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type DeviceDisableOptions ¶
type DeviceDisableOptions = dtoken.DeviceDisableOptions
Typed option aliases keep framework imports self-contained.
type DisableInfo ¶
type DisableInfo = manager.DisableInfo
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type DisableOptions ¶
type DisableOptions = dtoken.DisableOptions
Typed option aliases keep framework imports self-contained.
type EchoContext ¶
type EchoContext struct {
// contains filtered or unexported fields
}
EchoContext adapts Echo request context to DToken request context Echo 请求上下文适配到 DToken 请求上下文
func (*EchoContext) Abort ¶
func (e *EchoContext) Abort()
Abort implements adapter.RequestContext Abort 实现 adapter.RequestContext 接口
func (*EchoContext) Get ¶
func (e *EchoContext) Get(key string) (interface{}, bool)
Get implements adapter.RequestContext Get 实现 adapter.RequestContext 接口
func (*EchoContext) GetBody ¶
func (e *EchoContext) GetBody() ([]byte, error)
GetBody implements adapter.RequestContext GetBody 实现 adapter.RequestContext 接口
func (*EchoContext) GetClientIP ¶
func (e *EchoContext) GetClientIP() string
GetClientIP implements adapter.RequestContext GetClientIP 实现 adapter.RequestContext 接口
func (*EchoContext) GetCookie ¶
func (e *EchoContext) GetCookie(key string) string
GetCookie implements adapter.RequestContext GetCookie 实现 adapter.RequestContext 接口
func (*EchoContext) GetHeader ¶
func (e *EchoContext) GetHeader(key string) string
GetHeader implements adapter.RequestContext GetHeader 实现 adapter.RequestContext 接口
func (*EchoContext) GetHeaders ¶
func (e *EchoContext) GetHeaders() map[string][]string
GetHeaders implements adapter.RequestContext GetHeaders 实现 adapter.RequestContext 接口
func (*EchoContext) GetMethod ¶
func (e *EchoContext) GetMethod() string
GetMethod implements adapter.RequestContext GetMethod 实现 adapter.RequestContext 接口
func (*EchoContext) GetPath ¶
func (e *EchoContext) GetPath() string
GetPath implements adapter.RequestContext GetPath 实现 adapter.RequestContext 接口
func (*EchoContext) GetPostForm ¶
func (e *EchoContext) GetPostForm(key string) string
GetPostForm implements adapter.RequestContext GetPostForm 实现 adapter.RequestContext 接口
func (*EchoContext) GetQuery ¶
func (e *EchoContext) GetQuery(key string) string
GetQuery implements adapter.RequestContext GetQuery 实现 adapter.RequestContext 接口
func (*EchoContext) GetQueryAll ¶
func (e *EchoContext) GetQueryAll() map[string][]string
GetQueryAll implements adapter.RequestContext GetQueryAll 实现 adapter.RequestContext 接口
func (*EchoContext) GetString ¶
func (e *EchoContext) GetString(key string) string
GetString implements adapter.RequestContext GetString 实现 adapter.RequestContext 接口
func (*EchoContext) GetURL ¶
func (e *EchoContext) GetURL() string
GetURL implements adapter.RequestContext GetURL 实现 adapter.RequestContext 接口
func (*EchoContext) GetUserAgent ¶
func (e *EchoContext) GetUserAgent() string
GetUserAgent implements adapter.RequestContext GetUserAgent 实现 adapter.RequestContext 接口
func (*EchoContext) IsAborted ¶
func (e *EchoContext) IsAborted() bool
IsAborted implements adapter.RequestContext IsAborted 实现 adapter.RequestContext 接口
func (*EchoContext) IsTLS ¶
func (e *EchoContext) IsTLS() bool
IsTLS implements adapter.RequestContext IsTLS 实现 adapter.RequestContext 接口
func (*EchoContext) MustGet ¶
func (e *EchoContext) MustGet(key string) any
MustGet implements adapter.RequestContext MustGet 实现 adapter.RequestContext 接口
func (*EchoContext) Set ¶
func (e *EchoContext) Set(key string, value interface{})
Set implements adapter.RequestContext Set 实现 adapter.RequestContext 接口
func (*EchoContext) SetCookie ¶
func (e *EchoContext) SetCookie(name, value string, maxAge int, path, domain string, secure, httpOnly bool)
SetCookie implements adapter.RequestContext SetCookie 实现 adapter.RequestContext 接口
func (*EchoContext) SetCookieWithOptions ¶
func (e *EchoContext) SetCookieWithOptions(options *adapter.CookieOptions)
SetCookieWithOptions implements adapter.RequestContext SetCookieWithOptions 实现 adapter.RequestContext 接口
func (*EchoContext) SetHeader ¶
func (e *EchoContext) SetHeader(key, value string)
SetHeader implements adapter.RequestContext SetHeader 实现 adapter.RequestContext 接口
func (*EchoContext) SetStatusCode ¶
func (e *EchoContext) SetStatusCode(code int)
SetStatusCode implements adapter.RequestContext SetStatusCode 实现 adapter.RequestContext 接口
type EventFilter ¶
type EventFilter = listener.EventFilter
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type EventManager ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type EventStats ¶
type EventStats = listener.EventStats
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type FullStorage ¶
type FullStorage = adapter.FullStorage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type GeneratorFactory ¶
type GeneratorFactory = builder.GeneratorFactory
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type JSONSerializer ¶
type JSONSerializer = jsoncodec.JSONSerializer
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ListenerConfig ¶
type ListenerConfig = listener.ListenerConfig
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ListenerFunc ¶
type ListenerFunc = listener.ListenerFunc
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type LogControl ¶
type LogControl = adapter.LogControl
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type LogFactory ¶
type LogFactory = builder.LogFactory
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type LoggerConfig ¶
type LoggerConfig = dlog.LoggerConfig
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type LogicType ¶
LogicType defines permission and role check logic LogicType 定义权限与角色校验逻辑
const ( // DTokenCtxKey stores request scoped DToken context DTokenCtxKey 存储请求级 DToken 上下文 DTokenCtxKey = "DCtx" // LogicOr uses OR logic for checks LogicOr 使用 OR 逻辑校验 LogicOr LogicType = authcheck.LogicOr // LogicAnd uses AND logic for checks LogicAnd 使用 AND 逻辑校验 LogicAnd LogicType = authcheck.LogicAnd )
type LoginOptions ¶
type LoginOptions = dtoken.LoginOptions
Typed option aliases keep framework imports self-contained.
type LogoutMode ¶
type LogoutMode = config.LogoutMode
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type LogoutOptions ¶
type LogoutOptions = dtoken.LogoutOptions
Typed option aliases keep framework imports self-contained.
type ManagerOption ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ManagerRefreshTokenOptions ¶ added in v0.0.3
type ManagerRefreshTokenOptions = manager.RefreshTokenOptions
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type MemoryStorage ¶
type MemoryStorage = memorystorage.Storage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type MsgPackSerializer ¶
type MsgPackSerializer = msgpackcodec.MsgPackSerializer
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type NonceConfig ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type NonceManager ¶
type NonceManager = nonce.NonceManager
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type OAuth2Client ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type OAuth2Config ¶
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type OAuth2Server ¶
type OAuth2Server = oauth2.OAuth2Server
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type PermissionOptions ¶
type PermissionOptions = dtoken.PermissionOptions
Typed option aliases keep framework imports self-contained.
type PoolFactory ¶
type PoolFactory = builder.PoolFactory
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RedisConfig ¶
type RedisConfig = redisstorage.Config
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RedisStorage ¶
type RedisStorage = redisstorage.Storage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RefreshTokenInfo ¶ added in v0.0.3
type RefreshTokenInfo = manager.RefreshTokenInfo
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RefreshTokenOptions ¶ added in v0.0.3
type RefreshTokenOptions = dtoken.RefreshTokenOptions
Typed option aliases keep framework imports self-contained.
type RefreshTokenPair ¶ added in v0.0.3
type RefreshTokenPair = manager.RefreshTokenPair
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RenewPoolConfig ¶
type RenewPoolConfig = ants.RenewPoolConfig
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RenewPoolManager ¶
type RenewPoolManager = ants.RenewPoolManager
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ReplacedLoginExitMode ¶
type ReplacedLoginExitMode = config.ReplacedLoginExitMode
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ReplacedLoginMode ¶
type ReplacedLoginMode = config.ReplacedLoginExitMode
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RequestContext ¶
type RequestContext = adapter.RequestContext
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RequestContextExt ¶
type RequestContextExt = adapter.RequestContextExt
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type RoleOptions ¶
type RoleOptions = dtoken.RoleOptions
Typed option aliases keep framework imports self-contained.
type RouteAccessHandler ¶ added in v0.0.3
type RouteAccessHandler func(ctx context.Context, c echo4.Context, req *RouteAccessRequest)
RouteAccessHandler resolves route auth, permission, and role rules RouteAccessHandler 解析路由认证、权限、角色规则
type RouteAccessRequest ¶ added in v0.0.3
type RouteAccessRequest struct {
AuthType string
LogicType LogicType
CheckDisable bool
Permissions []string
Roles []string
// contains filtered or unexported fields
}
RouteAccessRequest carries route access rules RouteAccessRequest 携带路由访问规则
func (*RouteAccessRequest) RequirePermissions ¶ added in v0.0.3
func (req *RouteAccessRequest) RequirePermissions(permissions ...string)
RequirePermissions appends required permissions RequirePermissions 追加当前路由所需权限
func (*RouteAccessRequest) RequireRoles ¶ added in v0.0.3
func (req *RouteAccessRequest) RequireRoles(roles ...string)
RequireRoles appends required roles RequireRoles 追加当前路由所需角色
func (*RouteAccessRequest) SetLogicType ¶ added in v0.0.3
func (req *RouteAccessRequest) SetLogicType(logicType LogicType)
SetLogicType sets permission and role logic type SetLogicType 设置权限和角色逻辑类型
func (*RouteAccessRequest) SkipAuth ¶ added in v0.0.3
func (req *RouteAccessRequest) SkipAuth()
SkipAuth skips login, permission, and role checks SkipAuth 跳过登录、权限、角色校验
func (*RouteAccessRequest) SkipPermission ¶ added in v0.0.3
func (req *RouteAccessRequest) SkipPermission()
SkipPermission skips permission and role checks after login SkipPermission 登录后跳过权限和角色校验
type SameSiteMode ¶
type SameSiteMode = config.SameSiteMode
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ScannerStorage ¶
type ScannerStorage = adapter.ScannerStorage
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ServiceDisableInfo ¶
type ServiceDisableInfo = manager.ServiceDisableInfo
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type ServiceDisableOptions ¶
type ServiceDisableOptions = dtoken.ServiceDisableOptions
Typed option aliases keep framework imports self-contained.
type StorageFactory ¶
type StorageFactory = builder.StorageFactory
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TerminalInfo ¶
type TerminalInfo = manager.TerminalInfo
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TerminalRemovalFunc ¶
type TerminalRemovalFunc = manager.TerminalRemovalFunc
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TerminalVisitor ¶
type TerminalVisitor = manager.TerminalVisitor
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TokenIntrospection ¶ added in v0.0.3
type TokenIntrospection = manager.TokenIntrospection
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TokenRequest ¶
type TokenRequest = oauth2.TokenRequest
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TokenState ¶
type TokenState = manager.TokenState
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type TokenStyle ¶
type TokenStyle = adapter.TokenStyle
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
type UserValidator ¶
type UserValidator = oauth2.UserValidator
Core aliases keep framework imports self-contained. Core 别名让框架包可以独立使用 dtoken。
Source Files
¶
- annotation.go
- api_export.go
- component_export.go
- context.go
- context_access_facade.go
- context_auth_facade.go
- context_cookie_facade.go
- context_disable_facade.go
- context_facade.go
- context_nonce_facade.go
- context_oauth2_facade.go
- context_refresh_facade.go
- context_session_facade.go
- context_shortkey_facade.go
- context_terminal_facade.go
- context_ticket_facade.go
- error_export.go
- export.go
- facade_export.go
- middleware.go