mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
* move context flag to root Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io> * rm from httphandler Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io> --------- Signed-off-by: Daniel Grunberger <danielgrunberger@armosec.io> Co-authored-by: Daniel Grunberger <danielgrunberger@armosec.io>
32 lines
864 B
Go
32 lines
864 B
Go
package cautils
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type RootInfo struct {
|
|
Logger string // logger level
|
|
LoggerName string // logger name ("pretty"/"zap"/"none")
|
|
CacheDir string // cached dir
|
|
DisableColor bool // Disable Color
|
|
EnableColor bool // Force enable Color
|
|
DiscoveryServerURL string // Discovery Server URL (See https://github.com/kubescape/backend/tree/main/pkg/servicediscovery)
|
|
KubeContext string // context name
|
|
}
|
|
type CloudURLs struct {
|
|
CloudReportURL string
|
|
CloudAPIURL string
|
|
}
|
|
|
|
// To check if the provided account ID is valid
|
|
func ValidateAccountID(accountID string) error {
|
|
// Check if the Account-ID is valid
|
|
if _, err := uuid.Parse(accountID); accountID != "" && err != nil {
|
|
return fmt.Errorf("bad argument: accound ID must be a valid UUID")
|
|
}
|
|
|
|
return nil
|
|
}
|