Revert "TUN-6935: Cloudflared should use APIToken instead of serviceKey"
This reverts commit 1c6316c1c9
.
This commit is contained in:
parent
1c6316c1c9
commit
b50f172bdb
|
@ -1,21 +1,25 @@
|
||||||
package certutil
|
package certutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/x509"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type namedTunnelToken struct {
|
type namedTunnelToken struct {
|
||||||
ZoneID string `json:"zoneID"`
|
ZoneID string `json:"zoneID"`
|
||||||
AccountID string `json:"accountID"`
|
AccountID string `json:"accountID"`
|
||||||
APIToken string `json:"apiToken"`
|
ServiceKey string `json:"serviceKey"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OriginCert struct {
|
type OriginCert struct {
|
||||||
ZoneID string
|
PrivateKey interface{}
|
||||||
APIToken string
|
Cert *x509.Certificate
|
||||||
AccountID string
|
ZoneID string
|
||||||
|
ServiceKey string
|
||||||
|
AccountID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
|
func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
|
||||||
|
@ -29,11 +33,29 @@ func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
switch block.Type {
|
switch block.Type {
|
||||||
case "PRIVATE KEY", "CERTIFICATE":
|
case "PRIVATE KEY":
|
||||||
// this is for legacy purposes.
|
if originCert.PrivateKey != nil {
|
||||||
break
|
return nil, fmt.Errorf("Found multiple private key in the certificate")
|
||||||
case "ARGO TUNNEL TOKEN":
|
}
|
||||||
if originCert.ZoneID != "" || originCert.APIToken != "" {
|
// RSA private key
|
||||||
|
privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Cannot parse private key")
|
||||||
|
}
|
||||||
|
originCert.PrivateKey = privateKey
|
||||||
|
case "CERTIFICATE":
|
||||||
|
if originCert.Cert != nil {
|
||||||
|
return nil, fmt.Errorf("Found multiple certificates in the certificate")
|
||||||
|
}
|
||||||
|
cert, err := x509.ParseCertificates(block.Bytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("Cannot parse certificate")
|
||||||
|
} else if len(cert) > 1 {
|
||||||
|
return nil, fmt.Errorf("Found multiple certificates in the certificate")
|
||||||
|
}
|
||||||
|
originCert.Cert = cert[0]
|
||||||
|
case "WARP TOKEN", "ARGO TUNNEL TOKEN":
|
||||||
|
if originCert.ZoneID != "" || originCert.ServiceKey != "" {
|
||||||
return nil, fmt.Errorf("Found multiple tokens in the certificate")
|
return nil, fmt.Errorf("Found multiple tokens in the certificate")
|
||||||
}
|
}
|
||||||
// The token is a string,
|
// The token is a string,
|
||||||
|
@ -41,8 +63,18 @@ func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
|
||||||
ntt := namedTunnelToken{}
|
ntt := namedTunnelToken{}
|
||||||
if err := json.Unmarshal(block.Bytes, &ntt); err == nil {
|
if err := json.Unmarshal(block.Bytes, &ntt); err == nil {
|
||||||
originCert.ZoneID = ntt.ZoneID
|
originCert.ZoneID = ntt.ZoneID
|
||||||
originCert.APIToken = ntt.APIToken
|
originCert.ServiceKey = ntt.ServiceKey
|
||||||
originCert.AccountID = ntt.AccountID
|
originCert.AccountID = ntt.AccountID
|
||||||
|
} else {
|
||||||
|
// Try the older format, where the zoneID and service key are separated by
|
||||||
|
// a new line character
|
||||||
|
token := string(block.Bytes)
|
||||||
|
s := strings.Split(token, "\n")
|
||||||
|
if len(s) != 2 {
|
||||||
|
return nil, fmt.Errorf("Cannot parse token")
|
||||||
|
}
|
||||||
|
originCert.ZoneID = s[0]
|
||||||
|
originCert.ServiceKey = s[1]
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("Unknown block %s in the certificate", block.Type)
|
return nil, fmt.Errorf("Unknown block %s in the certificate", block.Type)
|
||||||
|
@ -50,7 +82,11 @@ func DecodeOriginCert(blocks []byte) (*OriginCert, error) {
|
||||||
block, rest = pem.Decode(rest)
|
block, rest = pem.Decode(rest)
|
||||||
}
|
}
|
||||||
|
|
||||||
if originCert.ZoneID == "" || originCert.APIToken == "" {
|
if originCert.PrivateKey == nil {
|
||||||
|
return nil, fmt.Errorf("Missing private key in the certificate")
|
||||||
|
} else if originCert.Cert == nil {
|
||||||
|
return nil, fmt.Errorf("Missing certificate in the certificate")
|
||||||
|
} else if originCert.ZoneID == "" || originCert.ServiceKey == "" {
|
||||||
return nil, fmt.Errorf("Missing token in the certificate")
|
return nil, fmt.Errorf("Missing token in the certificate")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,33 +13,49 @@ func TestLoadOriginCert(t *testing.T) {
|
||||||
assert.Equal(t, fmt.Errorf("Cannot decode empty certificate"), err)
|
assert.Equal(t, fmt.Errorf("Cannot decode empty certificate"), err)
|
||||||
assert.Nil(t, cert)
|
assert.Nil(t, cert)
|
||||||
|
|
||||||
blocks, err := ioutil.ReadFile("test-cert-unknown-block.pem")
|
blocks, err := ioutil.ReadFile("test-cert-no-key.pem")
|
||||||
|
assert.Nil(t, err)
|
||||||
|
cert, err = DecodeOriginCert(blocks)
|
||||||
|
assert.Equal(t, fmt.Errorf("Missing private key in the certificate"), err)
|
||||||
|
assert.Nil(t, cert)
|
||||||
|
|
||||||
|
blocks, err = ioutil.ReadFile("test-cert-two-certificates.pem")
|
||||||
|
assert.Nil(t, err)
|
||||||
|
cert, err = DecodeOriginCert(blocks)
|
||||||
|
assert.Equal(t, fmt.Errorf("Found multiple certificates in the certificate"), err)
|
||||||
|
assert.Nil(t, cert)
|
||||||
|
|
||||||
|
blocks, err = ioutil.ReadFile("test-cert-unknown-block.pem")
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
cert, err = DecodeOriginCert(blocks)
|
cert, err = DecodeOriginCert(blocks)
|
||||||
assert.Equal(t, fmt.Errorf("Unknown block RSA PRIVATE KEY in the certificate"), err)
|
assert.Equal(t, fmt.Errorf("Unknown block RSA PRIVATE KEY in the certificate"), err)
|
||||||
assert.Nil(t, cert)
|
assert.Nil(t, cert)
|
||||||
}
|
|
||||||
|
|
||||||
func TestJSONArgoTunnelTokenEmpty(t *testing.T) {
|
blocks, err = ioutil.ReadFile("test-cert.pem")
|
||||||
cert, err := DecodeOriginCert([]byte{})
|
|
||||||
blocks, err := ioutil.ReadFile("test-cert-no-token.pem")
|
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
cert, err = DecodeOriginCert(blocks)
|
cert, err = DecodeOriginCert(blocks)
|
||||||
assert.Equal(t, fmt.Errorf("Missing token in the certificate"), err)
|
assert.Nil(t, err)
|
||||||
assert.Nil(t, cert)
|
assert.NotNil(t, cert)
|
||||||
|
assert.Equal(t, "7b0a4d77dfb881c1a3b7d61ea9443e19", cert.ZoneID)
|
||||||
|
key := "v1.0-58bd4f9e28f7b3c28e05a35ff3e80ab4fd9644ef3fece537eb0d12e2e9258217-183442fbb0bbdb3e571558fec9b5589ebd77aafc87498ee3f09f64a4ad79ffe8791edbae08b36c1d8f1d70a8670de56922dff92b15d214a524f4ebfa1958859e-7ce80f79921312a6022c5d25e2d380f82ceaefe3fbdc43dd13b080e3ef1e26f7"
|
||||||
|
assert.Equal(t, key, cert.ServiceKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestNewlineArgoTunnelToken(t *testing.T) {
|
||||||
|
ArgoTunnelTokenTest(t, "test-argo-tunnel-cert.pem")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestJSONArgoTunnelToken(t *testing.T) {
|
func TestJSONArgoTunnelToken(t *testing.T) {
|
||||||
// The given cert's Argo Tunnel Token was generated by base64 encoding this JSON:
|
// The given cert's Argo Tunnel Token was generated by base64 encoding this JSON:
|
||||||
// {
|
// {
|
||||||
// "zoneID": "7b0a4d77dfb881c1a3b7d61ea9443e19",
|
// "zoneID": "7b0a4d77dfb881c1a3b7d61ea9443e19",
|
||||||
// "apiToken": "test-service-key",
|
// "serviceKey": "test-service-key",
|
||||||
// "accountID": "abcdabcdabcdabcd1234567890abcdef"
|
// "accountID": "abcdabcdabcdabcd1234567890abcdef"
|
||||||
// }
|
// }
|
||||||
CloudflareTunnelTokenTest(t, "test-cloudflare-tunnel-cert-json.pem")
|
ArgoTunnelTokenTest(t, "test-argo-tunnel-cert-json.pem")
|
||||||
}
|
}
|
||||||
|
|
||||||
func CloudflareTunnelTokenTest(t *testing.T, path string) {
|
func ArgoTunnelTokenTest(t *testing.T, path string) {
|
||||||
blocks, err := ioutil.ReadFile(path)
|
blocks, err := ioutil.ReadFile(path)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
cert, err := DecodeOriginCert(blocks)
|
cert, err := DecodeOriginCert(blocks)
|
||||||
|
@ -47,5 +63,5 @@ func CloudflareTunnelTokenTest(t *testing.T, path string) {
|
||||||
assert.NotNil(t, cert)
|
assert.NotNil(t, cert)
|
||||||
assert.Equal(t, "7b0a4d77dfb881c1a3b7d61ea9443e19", cert.ZoneID)
|
assert.Equal(t, "7b0a4d77dfb881c1a3b7d61ea9443e19", cert.ZoneID)
|
||||||
key := "test-service-key"
|
key := "test-service-key"
|
||||||
assert.Equal(t, key, cert.APIToken)
|
assert.Equal(t, key, cert.ServiceKey)
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ K5rShE/l+90YAOzHC89OH/wUz3I5KYOFuehoAiEA8e92aIf9XBkr0K6EvFCiSsD+
|
||||||
x+Yo/cL8fGfVpPt4UM8=
|
x+Yo/cL8fGfVpPt4UM8=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN ARGO TUNNEL TOKEN-----
|
-----BEGIN ARGO TUNNEL TOKEN-----
|
||||||
eyJ6b25lSUQiOiAiN2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkiLCAiYWNjb3VudElE
|
eyJ6b25lSUQiOiAiN2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkiLCAi
|
||||||
IjogImFiY2RhYmNkYWJjZGFiY2QxMjM0NTY3ODkwYWJjZGVmIn0=
|
c2VydmljZUtleSI6ICJ0ZXN0LXNlcnZpY2Uta2V5IiwgImFjY291bnRJRCI6ICJh
|
||||||
|
YmNkYWJjZGFiY2RhYmNkMTIzNDU2Nzg5MGFiY2RlZiJ9
|
||||||
-----END ARGO TUNNEL TOKEN-----
|
-----END ARGO TUNNEL TOKEN-----
|
|
@ -51,7 +51,6 @@ K5rShE/l+90YAOzHC89OH/wUz3I5KYOFuehoAiEA8e92aIf9XBkr0K6EvFCiSsD+
|
||||||
x+Yo/cL8fGfVpPt4UM8=
|
x+Yo/cL8fGfVpPt4UM8=
|
||||||
-----END CERTIFICATE-----
|
-----END CERTIFICATE-----
|
||||||
-----BEGIN ARGO TUNNEL TOKEN-----
|
-----BEGIN ARGO TUNNEL TOKEN-----
|
||||||
eyJ6b25lSUQiOiAiN2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkiLCAiYXBpVG9rZW4i
|
N2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkKdGVzdC1zZXJ2aWNlLWtl
|
||||||
OiAidGVzdC1zZXJ2aWNlLWtleSIsICJhY2NvdW50SUQiOiAiYWJjZGFiY2RhYmNkYWJjZDEyMzQ1
|
eQ==
|
||||||
Njc4OTBhYmNkZWYifQ==
|
|
||||||
-----END ARGO TUNNEL TOKEN-----
|
-----END ARGO TUNNEL TOKEN-----
|
|
@ -0,0 +1,33 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID+jCCA6CgAwIBAgIUJhFxUKEGvTRc3CjCok6dbPGH/P4wCgYIKoZIzj0EAwIw
|
||||||
|
gagxCzAJBgNVBAY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FoAU2qfBlqxKMZnf0QeTeYiMelfqJfgw
|
||||||
|
RAYIKwYBBQUHAQEEODA2MDQGCCsGAQUFBzABhihodHRwOi8vb2NzcC5jbG91ZGZs
|
||||||
|
YXJlLmNvbS9vcmlnaW5fZWNjX2NhMCMGA1UdEQQcMBqCDCouYXJub2xkLmNvbYIK
|
||||||
|
YXJub2xkLmNvbTA8BgNVHR8ENTAzMDGgL6AthitodHRwOi8vY3JsLmNsb3VkZmxh
|
||||||
|
cmUuY29tL29yaWdpbl9lY2NfY2EuY3JsMAoGCCqGSM49BAMCA0gAMEUCIDV7HoMj
|
||||||
|
K5rShE/l+90YAOzHC89OH/wUz3I5KYOFuehoAiEA8e92aIf9XBkr0K6EvFCiSsD+
|
||||||
|
x+Yo/cL8fGfVpPt4UM8=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN WARP TOKEN-----
|
||||||
|
N2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkKdjEuMC01OGJkNGY5ZTI4
|
||||||
|
ZjdiM2MyOGUwNWEzNWZmM2U4MGFiNGZkOTY0NGVmM2ZlY2U1MzdlYjBkMTJlMmU5
|
||||||
|
MjU4MjE3LTE4MzQ0MmZiYjBiYmRiM2U1NzE1NThmZWM5YjU1ODllYmQ3N2FhZmM4
|
||||||
|
NzQ5OGVlM2YwOWY2NGE0YWQ3OWZmZTg3OTFlZGJhZTA4YjM2YzFkOGYxZDcwYTg2
|
||||||
|
NzBkZTU2OTIyZGZmOTJiMTVkMjE0YTUyNGY0ZWJmYTE5NTg4NTllLTdjZTgwZjc5
|
||||||
|
OTIxMzEyYTYwMjJjNWQyNWUyZDM4MGY4MmNlYWVmZTNmYmRjNDNkZDEzYjA4MGUz
|
||||||
|
ZWYxZTI2Zjc=
|
||||||
|
-----END WARP TOKEN-----
|
|
@ -0,0 +1,85 @@
|
||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIIEvwIBADANBgkqhkiG9w0BAQEF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
|
||||||
|
QYL60FMl4geZn6w9hwxaL1r+g/tUjTnpBPQtS1r2Ed2gXby5zspN1g/PW8U3t3to
|
||||||
|
P7zHIJ/sLBXrCh5RJko3hUgGhDNOOCIQj4IaKUfvHYvEIbIxlyI0vdsXsgXgMuQ8
|
||||||
|
pb9Yifn5QQKBgQCmGu0EtYQlyOlDP10EGSrN3Dm45l9CrKZdi326cN4eCkikSoLs
|
||||||
|
G2x/YumouItiydP5QiNzuXOPrbmse4bwumwb2s0nJSMw6iSmDsFMlmuJxW2zO5e0
|
||||||
|
6qGH7fUyhgcaTanJIfk6hrm7/mKkH/S4hGpYCc8NCRsmc/35M+D4AoAoYQKBgQC0
|
||||||
|
LWpZaxDlF30MbAHHN3l6We2iU+vup0sMYXGb2ZOcwa/fir+ozIr++l8VmJmdWTan
|
||||||
|
OWSM96zgMghx8Os4hhJTxF+rvqK242OfcVsc2x31X94zUaP2z+peh5uhA6Pb3Nxr
|
||||||
|
W+iyA9k+Vujiwhr+h5D3VvtvH++aG6/KpGtoCf5nAQKBgQDXX2+d7bd5CLNLLFNd
|
||||||
|
M2i4QoOFcSKIG+v4SuvgEJHgG8vGvxh2qlSxnMWuPV+7/1P5ATLqDj1PlKms+BNR
|
||||||
|
y7sc5AT9PclkL3Y9MNzOu0LXyBkGYcl8M0EQfLv9VPbWT+NXiMg/O2CHiT02pAAz
|
||||||
|
uQicoQq3yzeQh20wtrtaXzTNmA==
|
||||||
|
-----END PRIVATE KEY-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID+jCCA6CgAwIBAgIUJhFxUKEGvTRc3CjCok6dbPGH/P4wCgYIKoZIzj0EAwIw
|
||||||
|
gagxCzAJBgNVBAYTAlVTMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTgwNgYD
|
||||||
|
VQQLEy9DbG91ZEZsYXJlIE9yaWdpbiBTU0wgRUNDIENlcnRpZmljYXRlIEF1dGhv
|
||||||
|
cml0eTEWMBQGA1UEBx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NOOCIQj4IaKUfvHYvEIbIxlyI0vdsXsgXgMuQ8
|
||||||
|
pb9Yifn5QQKBgQCmGu0EtYQlyOlDP10EGSrN3Dm45l9CrKZdi326cN4eCkikSoLs
|
||||||
|
G2x/YumouItiydP5QiNzuXOPrbmse4bwumwb2s0nJSMw6iSmDsFMlmuJxW2zO5e0
|
||||||
|
6qGH7fUyhgcaTanJIfk6hrm7/mKkH/S4hGpYCc8NCRsmc/35M+D4AoAoYQKBgQC0
|
||||||
|
LWpZaxDlF30MbAHHN3l6We2iU+vup0sMYXGb2ZOcwa/fir+ozIr++l8VmJmdWTan
|
||||||
|
OWSM96zgMghx8Os4hhJTxF+rvqK242OfcVsc2x31X94zUaP2z+peh5uhA6Pb3Nxr
|
||||||
|
W+iyA9k+Vujiwhr+h5D3VvtvH++aG6/KpGtoCf5nAQKBgQDXX2+d7bd5CLNLLFNd
|
||||||
|
M2i4QoOFcSKIG+v4SuvgEJHgG8vGvxh2qlSxnMWuPV+7/1P5ATLqDj1PlKms+BNR
|
||||||
|
y7sc5AT9PclkL3Y9MNzOu0LXyBkGYcl8M0EQfLv9VPbWT+NXiMg/O2CHiT02pAAz
|
||||||
|
uQicoQq3yzeQh20wtrtaXzTNmA==
|
||||||
|
-----END PRIVATE KEY-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID+jCCA6CgAwIBAgIUJhFxUKEGvTRc3CjCok6dbPGH/P4wCgYIKoZIzj0EAwIw
|
||||||
|
gagxCzAJBgNVBAYTAlVTMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTgwNgYD
|
||||||
|
VQQLEy9DbG91ZEZsYXJlIE9yaWdpbiBTU0wgRUNDIENlcnRpZmljYXRlIEF1dGhv
|
||||||
|
cml0eTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzETMBEGA1UECBMKQ2FsaWZvcm5p
|
||||||
|
YTEXMBUGA1UEAxMOKGRldiB1c2Ugb25seSkwHhcNMTcxMDEzMTM1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cmUuY29tL29yaWdpbl9lY2NfY2EuY3JsMAoGCCqGSM49BAMCA0gAMEUCIDV7HoMj
|
||||||
|
K5rShE/l+90YAOzHC89OH/wUz3I5KYOFuehoAiEA8e92aIf9XBkr0K6EvFCiSsD+
|
||||||
|
x+Yo/cL8fGfVpPt4UM8=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN WARP TOKEN-----
|
||||||
|
N2IwYTRkNzdkZmI4ODFjMWEzYjdkNjFlYTk0NDNlMTkKdjEuMC01OGJkNGY5ZTI4
|
||||||
|
ZjdiM2MyOGUwNWEzNWZmM2U4MGFiNGZkOTY0NGVmM2ZlY2U1MzdlYjBkMTJlMmU5
|
||||||
|
MjU4MjE3LTE4MzQ0MmZiYjBiYmRiM2U1NzE1NThmZWM5YjU1ODllYmQ3N2FhZmM4
|
||||||
|
NzQ5OGVlM2YwOWY2NGE0YWQ3OWZmZTg3OTFlZGJhZTA4YjM2YzFkOGYxZDcwYTg2
|
||||||
|
NzBkZTU2OTIyZGZmOTJiMTVkMjE0YTUyNGY0ZWJmYTE5NTg4NTllLTdjZTgwZjc5
|
||||||
|
OTIxMzEyYTYwMjJjNWQyNWUyZDM4MGY4MmNlYWVmZTNmYmRjNDNkZDEzYjA4MGUz
|
||||||
|
ZWYxZTI2Zjc=
|
||||||
|
-----END WARP TOKEN-----
|
|
@ -104,7 +104,7 @@ func (r *RESTClient) sendRequest(method string, url url.URL, body interface{}) (
|
||||||
if bodyReader != nil {
|
if bodyReader != nil {
|
||||||
req.Header.Set("Content-Type", jsonContentType)
|
req.Header.Set("Content-Type", jsonContentType)
|
||||||
}
|
}
|
||||||
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", r.authToken))
|
req.Header.Add("X-Auth-User-Service-Key", r.authToken)
|
||||||
req.Header.Add("Accept", "application/json;version=1")
|
req.Header.Add("Accept", "application/json;version=1")
|
||||||
return r.client.Do(req)
|
return r.client.Do(req)
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ func (sc *subcommandContext) client() (cfapi.Client, error) {
|
||||||
sc.c.String("api-url"),
|
sc.c.String("api-url"),
|
||||||
credential.cert.AccountID,
|
credential.cert.AccountID,
|
||||||
credential.cert.ZoneID,
|
credential.cert.ZoneID,
|
||||||
credential.cert.APIToken,
|
credential.cert.ServiceKey,
|
||||||
userAgent,
|
userAgent,
|
||||||
sc.log,
|
sc.log,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue