Documentation
¶
Index ¶
- func CreateCertificateFiles(secret *apicorev1.Secret, filenamesPrefix string, zipFilesPassword string, ...) (string, error)
- func ProcessEmail(cw *certwatchv1.CertWatcher, certFilesDir string, ...) error
- func ProcessJob(certwatcher *certwatchv1.CertWatcher) (*v1.Job, error)
- func ProcessScp(cw *certwatchv1.CertWatcher, credentialSecret v1.Secret, certFilesDir string) error
- func RandoHash(numCharacters int) (string, error)
- func SecretDataChecksum(s *v1.Secret) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertificateFiles ¶
func CreateCertificateFiles(secret *apicorev1.Secret, filenamesPrefix string, zipFilesPassword string, pkcs12Password string) (string, error)
CreateCertificateFiles Export certificates from the Secret, namely tls.key and tls.crt, into a temporary working directory. The path for this temporary directory will be returned and is expected to be removed after CertWatcher Action processing is completed.
Along with the original tls.key and tls.crt files, additional converted versions of the same files will be included. The full list:
- tls.key - tls.crt - tls.p12 (tls.key and tls.crt included) - tls.crt.p12 (tls.crt included)
And also zipped versions of each one:
- tls.key.zip (tls.key zipped) - tls.crt.zip (tls.crt zipped) - tls.zip (tls.crt and tls.key zipped) - tls.p12.zip (tls.p12 zipped) - tls.crt.p12.zip (tls.crt.p12 zipped) - tls.all.zip (tls.key, tls.crt, tls.p12 and tls.crt.p12 zipped)
The "tls" filename prefix is determined by the filenamesPrefix argument.
If a pkcs12Password is provided, *.p12 files will be created with that password.
If a zipFilesPassword is provided, *.zip files will be created with that password.
If the function finishes successfully, creating all files, the path of the temporary working directory followed by a nil error is returned. Otherwise, an empty string followed by the error is returned.
func ProcessEmail ¶
func ProcessEmail(cw *certwatchv1.CertWatcher, certFilesDir string, emailConfiguration *properties.Properties) error
func ProcessJob ¶
func ProcessJob(certwatcher *certwatchv1.CertWatcher) (*v1.Job, error)
func ProcessScp ¶
func ProcessScp(cw *certwatchv1.CertWatcher, credentialSecret v1.Secret, certFilesDir string) error
func SecretDataChecksum ¶
Calculate SHA256 from the Secret data. For simplicity, mashal the entire Data map into a json string and calculate the hash from that. Includes the object's labels as a way to give users change the checksum even when the certificate data itself did not change. This could be useful when users want to force trigger cert-watch to react to test or rerun actions.
Types ¶
This section is empty.