-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update webhook status integration tests
- Loading branch information
1 parent
106ac31
commit 1e6e159
Showing
10 changed files
with
445 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2024 the Pinniped contributors. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package conciergetestutil | ||
|
||
import ( | ||
"crypto/tls" | ||
"encoding/base64" | ||
"encoding/pem" | ||
|
||
auth1alpha1 "go.pinniped.dev/generated/latest/apis/concierge/authentication/v1alpha1" | ||
) | ||
|
||
func TlsSpecFromTLSConfig(tls *tls.Config) *auth1alpha1.TLSSpec { | ||
pemData := make([]byte, 0) | ||
for _, certificate := range tls.Certificates { | ||
// this is the public part of the certificate, the private is the certificate.PrivateKey | ||
for _, reallyCertificate := range certificate.Certificate { | ||
pemData = append(pemData, pem.EncodeToMemory(&pem.Block{ | ||
Type: "CERTIFICATE", | ||
Bytes: reallyCertificate, | ||
})...) | ||
} | ||
} | ||
return &auth1alpha1.TLSSpec{ | ||
CertificateAuthorityData: base64.StdEncoding.EncodeToString(pemData), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.