mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-09 16:05:33 +02:00
revert: secrets as []byte instead of string
Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
@@ -48,10 +48,10 @@ var _ = BeforeSuite(func() {
|
||||
|
||||
certOut := new(bytes.Buffer)
|
||||
Expect(pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: certBytes})).To(Succeed())
|
||||
ipv4CertDataSource.Value = certOut.String()
|
||||
ipv4CertDataSource.Value = certOut.Bytes()
|
||||
keyOut := new(bytes.Buffer)
|
||||
Expect(pem.Encode(keyOut, &pem.Block{Type: "PRIVATE KEY", Bytes: keyBytes})).To(Succeed())
|
||||
ipv4KeyDataSource.Value = keyOut.String()
|
||||
ipv4KeyDataSource.Value = keyOut.Bytes()
|
||||
})
|
||||
|
||||
By("Generating a ipv6 self-signed cert for TLS tests", func() {
|
||||
@@ -61,16 +61,16 @@ var _ = BeforeSuite(func() {
|
||||
|
||||
certOut := new(bytes.Buffer)
|
||||
Expect(pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: certBytes})).To(Succeed())
|
||||
ipv6CertDataSource.Value = certOut.String()
|
||||
ipv6CertDataSource.Value = certOut.Bytes()
|
||||
keyOut := new(bytes.Buffer)
|
||||
Expect(pem.Encode(keyOut, &pem.Block{Type: "PRIVATE KEY", Bytes: keyBytes})).To(Succeed())
|
||||
ipv6KeyDataSource.Value = keyOut.String()
|
||||
ipv6KeyDataSource.Value = keyOut.Bytes()
|
||||
})
|
||||
|
||||
By("Setting up a http client", func() {
|
||||
ipv4cert, err := tls.X509KeyPair([]byte(ipv4CertDataSource.Value), []byte(ipv4KeyDataSource.Value))
|
||||
ipv4cert, err := tls.X509KeyPair(ipv4CertDataSource.Value, ipv4KeyDataSource.Value)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
ipv6cert, err := tls.X509KeyPair([]byte(ipv6CertDataSource.Value), []byte(ipv6KeyDataSource.Value))
|
||||
ipv6cert, err := tls.X509KeyPair(ipv6CertDataSource.Value, ipv6KeyDataSource.Value)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
ipv4certificate, err := x509.ParseCertificate(ipv4cert.Certificate[0])
|
||||
|
||||
@@ -234,7 +234,7 @@ var _ = Describe("Server", func() {
|
||||
SecureBindAddress: "127.0.0.1:0",
|
||||
TLS: &options.TLS{
|
||||
Key: &options.SecretSource{
|
||||
Value: "invalid",
|
||||
Value: []byte("invalid"),
|
||||
},
|
||||
Cert: &ipv4CertDataSource,
|
||||
},
|
||||
@@ -250,7 +250,7 @@ var _ = Describe("Server", func() {
|
||||
TLS: &options.TLS{
|
||||
Key: &ipv4KeyDataSource,
|
||||
Cert: &options.SecretSource{
|
||||
Value: "invalid",
|
||||
Value: []byte("invalid"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -506,7 +506,7 @@ var _ = Describe("Server", func() {
|
||||
SecureBindAddress: "[::1]:0",
|
||||
TLS: &options.TLS{
|
||||
Key: &options.SecretSource{
|
||||
Value: "invalid",
|
||||
Value: []byte("invalid"),
|
||||
},
|
||||
Cert: &ipv6CertDataSource,
|
||||
},
|
||||
@@ -523,7 +523,7 @@ var _ = Describe("Server", func() {
|
||||
TLS: &options.TLS{
|
||||
Key: &ipv6KeyDataSource,
|
||||
Cert: &options.SecretSource{
|
||||
Value: "invalid",
|
||||
Value: []byte("invalid"),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user