Documentation
¶
Overview ¶
Package downloaders provides the Downloader type which represents the init container that will download a static asset (target) to be scanned.
Copyright (C) 2025 Crash Override, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the FSF, either version 3 of the License, or (at your option) any later version. See the LICENSE file in the root of this repository for full license text or visit: <https://www.gnu.org/licenses/gpl-3.0.html>.
Copyright (C) 2025 Crash Override, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the FSF, either version 3 of the License, or (at your option) any later version. See the LICENSE file in the root of this repository for full license text or visit: <https://www.gnu.org/licenses/gpl-3.0.html>.
Index ¶
- func ValidateParameterDefinitions(params map[string]schemas.ParameterDefinition) error
- func ValidateParameterName(name string) error
- func ValidateParameters(req map[string]string, parameters map[string]schemas.ParameterDefinition) error
- func ValidateUserContainer(ctx context.Context, clusterCtx cluster.Context, ctnr schemas.UserContainer) error
- func ValidateUserContainerWithParameters(ctx context.Context, clusterCtx cluster.Context, ...) error
- type Crawler
- type CrawlerStorageBackend
- type Downloader
- type DownloaderStorageBackend
- type Profile
- type ProfileStorageBackend
- type Secret
- type SecretStorageBackend
- type Uploader
- type UploaderStorageBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateParameterDefinitions ¶
func ValidateParameterDefinitions(params map[string]schemas.ParameterDefinition) error
ValidateParameterDefinitions validates the parameter definitions and returns an errs.Error of type errs.TypeBadRequest if any of the parameters are invalid. It will first validate the name of each the parameter using ValidateParameterName and then check if the parameter has a default value if not required.
func ValidateParameterName ¶
ValidateParameterName checks that the parameter name is valid. It will check that the name is not empty, is not longer than 63 characters, and that it only contains alphanumeric characters, underscores, and dashes.
func ValidateParameters ¶
func ValidateParameters( req map[string]string, parameters map[string]schemas.ParameterDefinition, ) error
ValidateParameters checks that the parameters specified by a user are valid. It will check that the parameters are defined in the parameter definitions and that the required parameters are set.
func ValidateUserContainer ¶
func ValidateUserContainer( ctx context.Context, clusterCtx cluster.Context, ctnr schemas.UserContainer, ) error
It will check that the image is not empty, that the command is not empty,
func ValidateUserContainerWithParameters ¶
func ValidateUserContainerWithParameters( ctx context.Context, clusterCtx cluster.Context, u schemas.UserContainerWithParameters, ) error
ValidateUserContainerWithParameters checks that the UserContainerWithParameters is valid. It will check that the UserContainer is valid and that the parameters are valid. See ValidateUserContainer for more information on validating the UserContainer and ValidateParameterDefinitions for more information on validating the parameters.
Types ¶
type Crawler ¶
Crawler see the schemas.Crawler type for more details.
func (Crawler) GetUserContainerWithParameters ¶
func (c Crawler) GetUserContainerWithParameters() schemas.UserContainerWithParameters
type CrawlerStorageBackend ¶
CrawlerStorageBackend is the type of the storage backend used to store Crawler configurations.
func NewCrawlerStorageBackend ¶
func NewCrawlerStorageBackend(clusterCtx cluster.Context) CrawlerStorageBackend
NewCrawlerStorageBackend creates a new CrawlerStorageBackend for the given cluster.Context.
type Downloader ¶
type Downloader schemas.Downloader
Downloader see the schemas.Downloader type for more details.
func (Downloader) GetUserContainer ¶
func (d Downloader) GetUserContainer() schemas.UserContainer
type DownloaderStorageBackend ¶
type DownloaderStorageBackend = storage.Backend[Downloader]
func NewDownloaderStorageBackend ¶
func NewDownloaderStorageBackend(clusterCtx cluster.Context) DownloaderStorageBackend
type ProfileStorageBackend ¶
func NewProfileStorageBackend ¶
func NewProfileStorageBackend(clusterCtx cluster.Context) ProfileStorageBackend
type SecretStorageBackend ¶
func NewSecretStorageBackend ¶
func NewSecretStorageBackend(clusterCtx cluster.Context) SecretStorageBackend
type Uploader ¶
type Uploader schemas.UserContainerWithParameters
func (Uploader) GetUserContainerWithParameters ¶
func (u Uploader) GetUserContainerWithParameters() schemas.UserContainerWithParameters
type UploaderStorageBackend ¶
func NewUploaderStorageBackend ¶
func NewUploaderStorageBackend(clusterCtx cluster.Context) UploaderStorageBackend