[feat] Add header authentication support
In some cases there are needs to authenticate user not in Taskcafe itself. For this reason option server.remote_user_header was added. ```toml [server] remote_user_header = "X-Remote-User" ``` With turned on Taskcafe listens X-Remote-User http header and skip password checking. But still check user existence and activity flag.
This commit is contained in:
@ -9,6 +9,11 @@ import (
|
||||
type SecurityConfig struct {
|
||||
AccessTokenExpiration time.Duration
|
||||
Secret []byte
|
||||
UserAuthHeader string
|
||||
}
|
||||
|
||||
func (c SecurityConfig) IsRemoteAuth() bool {
|
||||
return c.UserAuthHeader != ""
|
||||
}
|
||||
|
||||
func GetSecurityConfig(accessTokenExp string, secret []byte) (SecurityConfig, error) {
|
||||
|
Reference in New Issue
Block a user