Make sure to validate the client's ip address

This commit is contained in:
Bolke de Bruin 2020-07-25 21:00:58 +02:00
parent 5fc75ef877
commit 0b299619ff
6 changed files with 70 additions and 10 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"github.com/bolkedebruin/rdpgw/api"
"github.com/bolkedebruin/rdpgw/client"
"github.com/bolkedebruin/rdpgw/config"
"github.com/bolkedebruin/rdpgw/protocol"
"github.com/bolkedebruin/rdpgw/security"
@ -122,8 +123,8 @@ func main() {
HandlerConf: &handlerConfig,
}
http.HandleFunc("/remoteDesktopGateway/", gw.HandleGatewayProtocol)
http.Handle("/connect", api.Authenticated(http.HandlerFunc(api.HandleDownload)))
http.Handle("/remoteDesktopGateway/", client.EnrichContext(http.HandlerFunc(gw.HandleGatewayProtocol)))
http.Handle("/connect", client.EnrichContext(api.Authenticated(http.HandlerFunc(api.HandleDownload))))
http.Handle("/metrics", promhttp.Handler())
http.HandleFunc("/callback", api.HandleCallback)