Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeCertPEM(cert *x509.Certificate) []byte
- func ModuleAssert(ctx context.Context, options ExecOptions) (string, string)
- func ModuleCommand(ctx context.Context, options ExecOptions) (string, string)
- func ModuleCopy(ctx context.Context, options ExecOptions) (string, string)
- func ModuleDebug(_ context.Context, options ExecOptions) (string, string)
- func ModuleFetch(ctx context.Context, options ExecOptions) (string, string)
- func ModuleGenCert(ctx context.Context, options ExecOptions) (string, string)
- func ModuleImage(ctx context.Context, options ExecOptions) (string, string)
- func ModuleSetFact(_ context.Context, options ExecOptions) (string, string)
- func ModuleTemplate(ctx context.Context, options ExecOptions) (string, string)
- func NewSelfSignedCACert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer) (*x509.Certificate, error)
- func NewSignedCert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer, ...) (*x509.Certificate, error)
- func RegisterModule(moduleName string, exec ModuleExecFunc) error
- func RemoveDuplicateAltNames(altNames *cgutilcert.AltNames)
- func TryLoadCertChainFromDisk(rootCert string) (*x509.Certificate, []*x509.Certificate, error)
- func TryLoadKeyFromDisk(rootKey string) (crypto.Signer, error)
- func ValidateCertPeriod(cert *x509.Certificate, offset time.Duration) error
- func VerifyCertChain(cert *x509.Certificate, intermediates []*x509.Certificate, ...) error
- func WriteCert(outCert string, cert *x509.Certificate, policy string) error
- func WriteKey(outKey string, key crypto.Signer, policy string) error
- type ExecOptions
- type ModuleExecFunc
Constants ¶
const ( // StdoutSuccess message for common module StdoutSuccess = "success" StdoutSkip = "skip" // StdoutTrue for bool module StdoutTrue = "True" // StdoutFalse for bool module StdoutFalse = "False" )
message for stdout
Variables ¶
var ConnKey = struct{}{}
ConnKey for connector which store in context
Functions ¶
func EncodeCertPEM ¶
func EncodeCertPEM(cert *x509.Certificate) []byte
EncodeCertPEM returns PEM-endcoded certificate data
func ModuleAssert ¶
func ModuleAssert(ctx context.Context, options ExecOptions) (string, string)
ModuleAssert deal "assert" module
func ModuleCommand ¶
func ModuleCommand(ctx context.Context, options ExecOptions) (string, string)
ModuleCommand deal "command" module.
func ModuleCopy ¶
func ModuleCopy(ctx context.Context, options ExecOptions) (string, string)
ModuleCopy deal "copy" module
func ModuleDebug ¶
func ModuleDebug(_ context.Context, options ExecOptions) (string, string)
ModuleDebug deal "debug" module
func ModuleFetch ¶
func ModuleFetch(ctx context.Context, options ExecOptions) (string, string)
ModuleFetch deal fetch module
func ModuleGenCert ¶
func ModuleGenCert(ctx context.Context, options ExecOptions) (string, string)
ModuleGenCert generate cert file. if root_key and root_cert is empty, generate Self-signed certificate.
func ModuleImage ¶
func ModuleImage(ctx context.Context, options ExecOptions) (string, string)
ModuleImage deal "image" module
func ModuleSetFact ¶
func ModuleSetFact(_ context.Context, options ExecOptions) (string, string)
ModuleSetFact deal "set_fact" module
func ModuleTemplate ¶
func ModuleTemplate(ctx context.Context, options ExecOptions) (string, string)
ModuleTemplate deal "template" module
func NewSelfSignedCACert ¶
func NewSelfSignedCACert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer) (*x509.Certificate, error)
NewSelfSignedCACert creates a CA certificate
func NewSignedCert ¶
func NewSignedCert(cfg cgutilcert.Config, after time.Duration, key crypto.Signer, caCert *x509.Certificate, caKey crypto.Signer, isCA bool) (*x509.Certificate, error)
NewSignedCert creates a signed certificate using the given CA certificate and key
func RegisterModule ¶
func RegisterModule(moduleName string, exec ModuleExecFunc) error
RegisterModule register module
func RemoveDuplicateAltNames ¶
func RemoveDuplicateAltNames(altNames *cgutilcert.AltNames)
RemoveDuplicateAltNames removes duplicate items in altNames.
func TryLoadCertChainFromDisk ¶
func TryLoadCertChainFromDisk(rootCert string) (*x509.Certificate, []*x509.Certificate, error)
TryLoadCertChainFromDisk tries to load the cert chain from the disk
func TryLoadKeyFromDisk ¶
TryLoadKeyFromDisk tries to load the key from the disk and validates that it is valid
func ValidateCertPeriod ¶
func ValidateCertPeriod(cert *x509.Certificate, offset time.Duration) error
ValidateCertPeriod checks if the certificate is valid relative to the current time (+/- offset)
func VerifyCertChain ¶
func VerifyCertChain(cert *x509.Certificate, intermediates []*x509.Certificate, root *x509.Certificate) error
VerifyCertChain verifies that a certificate has a valid chain of intermediate CAs back to the root CA
Types ¶
type ExecOptions ¶
type ExecOptions struct { // the defined Args for module Args runtime.RawExtension // which Host to execute Host string // the variable module need variable.Variable // the task to be executed Task kkcorev1alpha1.Task // the pipeline to be executed Pipeline kkcorev1.Pipeline }
ExecOptions for module
type ModuleExecFunc ¶
type ModuleExecFunc func(ctx context.Context, options ExecOptions) (stdout string, stderr string)
ModuleExecFunc exec module
func FindModule ¶
func FindModule(moduleName string) ModuleExecFunc
FindModule by module name which has register.