mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-18 14:33:50 +02:00
Enable simple security
This commit is contained in:
parent
3839058eb8
commit
afe33a9204
3 changed files with 36 additions and 11 deletions
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue