mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 18:39:58 +00:00
AUTH-3394: Creates a token per app instead of per path
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -33,10 +32,10 @@ type signingArguments struct {
|
||||
}
|
||||
|
||||
func TestCertGenSuccess(t *testing.T) {
|
||||
url, _ := url.Parse("https://cf-test-access.com/testpath")
|
||||
appInfo := &cfpath.AppInfo{AppAUD: "abcd1234", AppDomain: "mySite.com"}
|
||||
token := tokenGenerator()
|
||||
|
||||
fullName, err := cfpath.GenerateAppTokenFilePathFromURL(url, keyName)
|
||||
fullName, err := cfpath.GenerateAppTokenFilePathFromURL(appInfo.AppDomain, appInfo.AppAUD, keyName)
|
||||
assert.NoError(t, err)
|
||||
|
||||
pubKeyName := fullName + ".pub"
|
||||
@@ -66,7 +65,7 @@ func TestCertGenSuccess(t *testing.T) {
|
||||
return w.Result(), nil
|
||||
}
|
||||
|
||||
err = GenerateShortLivedCertificate(url, token)
|
||||
err = GenerateShortLivedCertificate(appInfo, token)
|
||||
assert.NoError(t, err)
|
||||
|
||||
exist, err := config.FileExists(fullName)
|
||||
|
Reference in New Issue
Block a user