Documentation
¶
Index ¶
- 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(ctx context.Context, options ExecOptions) (string, string)
- func ModuleFetch(ctx context.Context, options ExecOptions) (string, string)
- func ModuleGenCert(ctx context.Context, options ExecOptions) (stdout string, stderr string)
- func ModuleImage(ctx context.Context, options ExecOptions) (stdout string, stderr string)
- func ModuleSetFact(ctx context.Context, options ExecOptions) (string, string)
- func ModuleTemplate(ctx context.Context, options ExecOptions) (string, string)
- func NewLocalRepository(reference string) (*remote.Repository, error)
- 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 ¶
This section is empty.
Variables ¶
var ConnKey = struct{}{}
ConnKey for connector which store in context
var ResponseCreated = &http.Response{Proto: "Local", StatusCode: http.StatusCreated}
var ResponseNotAllowed = &http.Response{Proto: "Local", StatusCode: http.StatusMethodNotAllowed}
var ResponseNotFound = &http.Response{Proto: "Local", StatusCode: http.StatusNotFound}
var ResponseOK = &http.Response{Proto: "Local", StatusCode: http.StatusOK}
var ResponseServerError = &http.Response{Proto: "Local", StatusCode: http.StatusInternalServerError}
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)
func ModuleCommand ¶
func ModuleCommand(ctx context.Context, options ExecOptions) (string, string)
func ModuleCopy ¶
func ModuleCopy(ctx context.Context, options ExecOptions) (string, string)
func ModuleDebug ¶
func ModuleDebug(ctx context.Context, options ExecOptions) (string, string)
func ModuleFetch ¶
func ModuleFetch(ctx context.Context, options ExecOptions) (string, string)
func ModuleGenCert ¶
func ModuleGenCert(ctx context.Context, options ExecOptions) (stdout string, stderr 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) (stdout string, stderr string)
func ModuleSetFact ¶
func ModuleSetFact(ctx context.Context, options ExecOptions) (string, string)
func ModuleTemplate ¶
func ModuleTemplate(ctx context.Context, options ExecOptions) (string, string)
func NewLocalRepository ¶
func NewLocalRepository(reference string) (*remote.Repository, error)
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
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 kubekeyv1alpha1.Task // the pipeline to be executed Pipeline kubekeyv1.Pipeline }
type ModuleExecFunc ¶
type ModuleExecFunc func(ctx context.Context, options ExecOptions) (stdout string, stderr string)
func FindModule ¶
func FindModule(moduleName string) ModuleExecFunc