mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-17 22:13:50 +02:00
Use encryption for cookies
This commit is contained in:
parent
46e1e9b9f4
commit
5de3767e70
5 changed files with 27 additions and 24 deletions
27
api/web.go
27
api/web.go
|
@ -24,18 +24,19 @@ const (
|
|||
type TokenGeneratorFunc func(string, string) (string, error)
|
||||
|
||||
type Config struct {
|
||||
SessionKey []byte
|
||||
TokenGenerator TokenGeneratorFunc
|
||||
OAuth2Config *oauth2.Config
|
||||
store *sessions.CookieStore
|
||||
TokenVerifier *oidc.IDTokenVerifier
|
||||
stateStore *cache.Cache
|
||||
Hosts []string
|
||||
GatewayAddress string
|
||||
UsernameTemplate string
|
||||
NetworkAutoDetect int
|
||||
BandwidthAutoDetect int
|
||||
ConnectionType int
|
||||
SessionKey []byte
|
||||
SessionEncryptionKey []byte
|
||||
TokenGenerator TokenGeneratorFunc
|
||||
OAuth2Config *oauth2.Config
|
||||
store *sessions.CookieStore
|
||||
TokenVerifier *oidc.IDTokenVerifier
|
||||
stateStore *cache.Cache
|
||||
Hosts []string
|
||||
GatewayAddress string
|
||||
UsernameTemplate string
|
||||
NetworkAutoDetect int
|
||||
BandwidthAutoDetect int
|
||||
ConnectionType int
|
||||
}
|
||||
|
||||
func (c *Config) NewApi() {
|
||||
|
@ -45,7 +46,7 @@ func (c *Config) NewApi() {
|
|||
if len(c.Hosts) < 1 {
|
||||
log.Fatal("Not enough hosts to connect to specified")
|
||||
}
|
||||
c.store = sessions.NewCookieStore(c.SessionKey)
|
||||
c.store = sessions.NewCookieStore(c.SessionKey, c.SessionEncryptionKey)
|
||||
c.stateStore = cache.New(time.Minute*2, 5*time.Minute)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue