Documentation
¶
Index ¶
- Variables
- func AssertYamlEquality(t *testing.T, a, b []byte)
- func CompleteDockerComposeYaml(maintainer, appName, filePath, host string) error
- func IsValidURLPath(path string) bool
- func ReadBody[T any](w http.ResponseWriter, r *http.Request) (*T, error)
- func ValidateSecret(input string) error
- func ValidateStruct(s any) error
- func ValidateVersion(zipBytes []byte, maintainerName, appName string) error
- func ZipDirectory(dirPath string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidationTypeMap = map[string]*regexp.Regexp{ "user_name": regexp.MustCompile("^[a-z0-9]{3,20}$"), "app_name": regexp.MustCompile("^[a-z0-9]{3,20}$"), "version_name": regexp.MustCompile("^[a-z0-9.]{3,20}$"), "search_term": regexp.MustCompile("^[a-z0-9]{0,20}$"), "password": regexp.MustCompile("^[a-zA-Z0-9._-]{8,30}$"), "email": regexp.MustCompile("^" + emailRegexSuffix), "number": regexp.MustCompile("^[0-9]{1,20}$"), "host": regexp.MustCompile("^[a-zA-Z0-9:._-]{0,64}$"), "known_hosts": regexp.MustCompile(`^[A-Za-z0-9.:,/_+=#@\[\]| \r\n-]{0,}$`), "restic_backup_id": regexp.MustCompile(`^[a-f0-9]{64}$`), "remote_host": regexp.MustCompile("^[a-zA-Z0-9._-]{0,64}$"), "email_or_empty": regexp.MustCompile(`^$|^` + emailRegexSuffix), }
Functions ¶
func AssertYamlEquality ¶
func IsValidURLPath ¶
func ValidateSecret ¶ added in v0.0.77
As we do not receive sensitive data in request bodies such as secrets or cookie values, this is a separate concern in a separate function.
func ValidateStruct ¶ added in v0.0.78
func ValidateVersion ¶
func ZipDirectory ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.