Documentation
¶
Index ¶
- type AuthMiddleware
- type AuthModule
- func (m *AuthModule) AddCacheStore(convert Serializer)
- func (m *AuthModule) GetAuthConfig() ([]interface{}, error)
- func (m *AuthModule) GetAuthPluginByName(name string) harukap.AuthPlugin
- func (m *AuthModule) InitModule() error
- func (m *AuthModule) ParseAuthHeader(c *haruka.Context) string
- func (m *AuthModule) ParseToken(jwtToken string) (commons.AuthUser, error)
- type AuthModuleConfig
- type Serializer
- type TokenStoreManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct { OnError func(c *haruka.Context, err error) Module *AuthModule RequestFilter func(c *haruka.Context) bool }
func (AuthMiddleware) OnRequest ¶
func (m AuthMiddleware) OnRequest(c *haruka.Context)
type AuthModule ¶
type AuthModule struct { Plugins []harukap.AuthPlugin AuthMiddleware AuthMiddleware ConfigProvider *config.Provider Config AuthModuleConfig CacheStore *TokenStoreManager }
func (*AuthModule) AddCacheStore ¶
func (m *AuthModule) AddCacheStore(convert Serializer)
func (*AuthModule) GetAuthConfig ¶
func (m *AuthModule) GetAuthConfig() ([]interface{}, error)
func (*AuthModule) GetAuthPluginByName ¶
func (m *AuthModule) GetAuthPluginByName(name string) harukap.AuthPlugin
func (*AuthModule) InitModule ¶
func (m *AuthModule) InitModule() error
func (*AuthModule) ParseAuthHeader ¶
func (m *AuthModule) ParseAuthHeader(c *haruka.Context) string
func (*AuthModule) ParseToken ¶
func (m *AuthModule) ParseToken(jwtToken string) (commons.AuthUser, error)
type AuthModuleConfig ¶
type AuthModuleConfig struct {
EnableAnonymous bool
}
type Serializer ¶
type TokenStoreManager ¶
type TokenStoreManager struct { DB *bolt.DB Serializer Serializer // contains filtered or unexported fields }
func (*TokenStoreManager) GetUserByToken ¶
func (m *TokenStoreManager) GetUserByToken(token string) (commons.AuthUser, error)
func (*TokenStoreManager) Init ¶
func (m *TokenStoreManager) Init() error
Click to show internal directories.
Click to hide internal directories.