Documentation
¶
Index ¶
- Constants
- Variables
- func FormatInvalidError(input, path, errorMsg string) []error
- func ValidateAnnotations(annotations *map[string]string) []error
- func ValidateBase64Field(s string, path string, maxLen int) []error
- func ValidateBearerToken(token *string, path string) []error
- func ValidateCSR(csr []byte) []error
- func ValidateCSRUsages(u *[]string) []error
- func ValidateExpirationSeconds(e *int32) []error
- func ValidateFileOrDirectoryPath(s *string, path string) []error
- func ValidateFilePath(s *string, path string) []error
- func ValidateGenericName(name *string, path string) []error
- func ValidateGitRevision(name *string, path string) []error
- func ValidateLabels(labels *map[string]string) []error
- func ValidateLabelsWithPath(labels *map[string]string, path string) []error
- func ValidateLinuxFileMode(m *int, path string) []error
- func ValidateLinuxUserGroup(s *string, path string) []error
- func ValidateOciImageReference(s *string, path string) []error
- func ValidateResourceName(name *string) []error
- func ValidateResourceNameReference(name *string, path string) []error
- func ValidateSignerName(s string) []error
- func ValidateString(s *string, path string, minLen int, maxLen int, patternRegexp *regexp.Regexp, ...) []error
- func ValidateStringMap(m *map[string]string, path string, minLen int, maxLen int, ...) []error
Constants ¶
const ( Dns1123LabelFmt string = `[a-z0-9]([-a-z0-9]*[a-z0-9])?` DNS1123MaxLength int = 253 )
const ( OciImageDomainFmt string = ociDomainCompFmt + `(?:[.]` + ociDomainCompFmt + `)*` + `(?::[0-9]+)?` OciImageNameFmt string = `(?:` + OciImageDomainFmt + `\/)?` + ociNameCompFmt + `(?:\/` + ociNameCompFmt + `)*` OciImageTagFmt string = `[\w][\w.-]{0,127}` OciImageDigestFmt string = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` OciImageReferenceFmt string = `(` + OciImageNameFmt + `)(?:\:(` + OciImageTagFmt + `))?(?:\@(` + OciImageDigestFmt + `))?` OciImageReferenceMaxLength int = 2048 )
const ( // as per https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names#naming-branches-and-tags GitRevisionFmt string = `[a-zA-Z0-9]([a-zA-Z0-9\.\-\_\/])*` // GitHub limits to 255 minus "refs/heads/" GitRevisionMaxLength int = 244 )
Variables ¶
var GenericNameRegexp = regexp.MustCompile("^" + Dns1123LabelFmt + "$")
var GitRevisionRegexp = regexp.MustCompile("^" + GitRevisionFmt + "$")
var (
OciImageReferenceRegexp = regexp.MustCompile("^" + OciImageReferenceFmt + "$")
)
Functions ¶
func FormatInvalidError ¶ added in v0.4.0
func ValidateAnnotations ¶
ValidateAnnotations validates that a set of annotations are valid K8s annotations.
func ValidateBearerToken ¶
func ValidateCSR ¶
func ValidateCSRUsages ¶
func ValidateExpirationSeconds ¶
TODO: this should log a warning if less than minExpirationSeconds using the configured logger
func ValidateFileOrDirectoryPath ¶ added in v0.4.0
func ValidateFilePath ¶ added in v0.3.0
func ValidateGenericName ¶
func ValidateGitRevision ¶
func ValidateLabels ¶
ValidateLabels validates that a set of labels are valid K8s labels.
func ValidateLabelsWithPath ¶
ValidateLabelsWithPath validates that a set of labels are valid K8s labels, with fieldPath being the path to the label field.
func ValidateLinuxFileMode ¶ added in v0.3.0
func ValidateLinuxUserGroup ¶ added in v0.3.0
func ValidateOciImageReference ¶
Validates an OCI image reference.
func ValidateResourceName ¶
ValidateResourceName validates that metadata.name is not empty and is a valid name in K8s.
func ValidateResourceNameReference ¶ added in v0.2.0
ValidateResourceRef validates that metadata.name is not empty and is a valid name in K8s.
func ValidateSignerName ¶
Currently every request is sent to the only signer, named "ca" and defined in cmd/flightctl-api/main.go
Types ¶
This section is empty.