1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-11 05:30:30 +08:00

AUTH-3394: Creates a token per app instead of per path

This commit is contained in:
Michael Borkenstein
2021-03-02 14:35:40 -06:00
parent 4296b23087
commit 8e340d9598
8 changed files with 129 additions and 83 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/cloudflare/cloudflared/config"
"github.com/cloudflare/cloudflared/h2mux"
"github.com/cloudflare/cloudflared/logger"
"github.com/cloudflare/cloudflared/token"
"github.com/cloudflare/cloudflared/validation"
"github.com/pkg/errors"
@@ -108,6 +109,17 @@ func ssh(c *cli.Context) error {
}
}
originReq, err := http.NewRequest(http.MethodGet, options.OriginURL, nil)
if err != nil {
return err
}
appInfo, err := token.GetAppInfo(originReq.URL)
if err != nil {
return err
}
options.AppInfo = appInfo
// we could add a cmd line variable for this bool if we want the SOCK5 server to be on the client side
wsConn := carrier.NewWSConnection(log)