Enable simple security

This commit is contained in:
Bolke de Bruin 2020-07-21 12:52:25 +02:00
parent 3839058eb8
commit afe33a9204
3 changed files with 36 additions and 11 deletions

View file

@ -1,5 +1,21 @@
package security
func VerifyServerTemplate(server string) (bool, err) {
import (
"github.com/bolkedebruin/rdpgw/protocol"
"github.com/patrickmn/go-cache"
"log"
)
type Config struct {
Store *cache.Cache
}
func (c *Config) VerifyPAAToken(s *protocol.SessionInfo, token string) (bool, error) {
_, found := c.Store.Get(token)
if !found {
log.Printf("PAA Token %s not found", token)
return false, nil
}
return true, nil
}