Documentation ¶
Index ¶
- Constants
- Variables
- func Authn(perm string, w http.ResponseWriter, r *http.Request) (string, error)
- func BasicAuthCheck(username, password string) bool
- func BasicAuthzCheck(username, perm string) bool
- func ConnectToKube()
- func CreateRMDataTask(storageSpec crv1.PgStorageSpec, clusterName, pvcName string, ...) error
- func GetBackrestStorageTypes() []string
- func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
- func GetNamespace(clientset *kubernetes.Clientset, username, requestedNS string) (string, error)
- func GetPVCName(pod *v1.Pod) map[string]string
- func GetPodStatus(deployName, ns string) (string, string)
- func GetSecrets(cluster *crv1.Pgcluster, ns string) ([]msgs.ShowUserSecret, error)
- func GetTLS(certPath, keyPath string) error
- func HasPerm(role string, perm string) bool
- func Initialize()
- func InitializePerms()
- func IsStringOneOf(testVal string, acceptedVals ...string) bool
- func IsValidBackrestStorageType(storageType string) bool
- func IsValidContainerResource(name string) bool
- func IsValidContainerResourceValues() bool
- func IsValidNodeLabel(key, value string) (bool, bool, error)
- func IsValidPVC(pvcName, ns string) bool
- func IsValidStorageName(name string) bool
- func UserIsPermittedInNamespace(username, requestedNS string) bool
- func ValidateNodeLabel(nodeLabel string) error
- type CredentialDetail
Constants ¶
const APPLY_POLICY_PERM = "ApplyPolicy"
const CAT_PERM = "Cat"
MISC
const CREATE_BACKUP_PERM = "CreateBackup"
CREATE
const CREATE_BENCHMARK_PERM = "CreateBenchmark"
const CREATE_CLUSTER_PERM = "CreateCluster"
const CREATE_DUMP_PERM = "CreateDump"
const CREATE_FAILOVER_PERM = "CreateFailover"
const CREATE_INGEST_PERM = "CreateIngest"
const CREATE_PGBOUNCER_PERM = "CreatePgbouncer"
const CREATE_PGPOOL_PERM = "CreatePgpool"
const CREATE_POLICY_PERM = "CreatePolicy"
const CREATE_SCHEDULE_PERM = "CreateSchedule"
const CREATE_UPGRADE_PERM = "CreateUpgrade"
const CREATE_USER_PERM = "CreateUser"
const DELETE_BACKUP_PERM = "DeleteBackup"
DELETE
const DELETE_BENCHMARK_PERM = "DeleteBenchmark"
const DELETE_CLUSTER_PERM = "DeleteCluster"
const DELETE_INGEST_PERM = "DeleteIngest"
const DELETE_PGBOUNCER_PERM = "DeletePgbouncer"
const DELETE_PGPOOL_PERM = "DeletePgpool"
const DELETE_POLICY_PERM = "DeletePolicy"
const DELETE_SCHEDULE_PERM = "DeleteSchedule"
const DELETE_USER_PERM = "DeleteUser"
const DF_CLUSTER_PERM = "DfCluster"
const LABEL_PERM = "Label"
const LOAD_PERM = "Load"
const LS_PERM = "Ls"
const PGOSecretName = "pgo.tls"
const RELOAD_PERM = "Reload"
const RESTORE_DUMP_PERM = "RestoreDump"
RESTORE
const RESTORE_PERM = "Restore"
const RESTORE_PGBASEBACKUP_PERM = "RestorePgbasebackup"
const SCALE_CLUSTER_PERM = "ScaleCluster"
SCALE
const SHOW_BACKUP_PERM = "ShowBackup"
SHOW
const SHOW_BENCHMARK_PERM = "ShowBenchmark"
const SHOW_CLUSTER_PERM = "ShowCluster"
const SHOW_CONFIG_PERM = "ShowConfig"
const SHOW_INGEST_PERM = "ShowIngest"
const SHOW_NAMESPACE_PERM = "ShowNamespace"
const SHOW_POLICY_PERM = "ShowPolicy"
const SHOW_PVC_PERM = "ShowPVC"
const SHOW_SCHEDULE_PERM = "ShowSchedule"
const SHOW_SECRETS_PERM = "ShowSecrets"
const SHOW_WORKFLOW_PERM = "ShowWorkflow"
const STATUS_PERM = "Status"
const TEST_CLUSTER_PERM = "TestCluster"
const TreeBranch = "├── "
TreeBranch is for debugging only in this context
const TreeTrunk = "└── "
TreeTrunk is for debugging only in this context
const UPDATE_CLUSTER_PERM = "UpdateCluster"
UPDATE
const USER_PERM = "User"
const VERSION_MISMATCH_ERROR = "pgo client and server version mismatch"
const VERSION_PERM = "Version"
Variables ¶
var AuditFlag bool
AuditFlag if set to true will cause auditing to occur in the logs
var BasicAuth bool
BasicAuth comes from the apiserver config
var CRUNCHY_DEBUG bool
var Clientset *kubernetes.Clientset
Clientset ...
var Credentials map[string]CredentialDetail
Credentials holds the BasicAuth credentials found in the config
var DebugFlag bool
DebugFlag is the debug flag value
var MetricsFlag, BadgerFlag bool
MetricsFlag if set to true will cause crunchy-collect to be added into new clusters
var Namespace string
var PermMap map[string]string
var Pgo config.PgoConfig
var PgoNamespace string
Namespace comes from the apiserver config in this version
var RESTClient *rest.RESTClient
RESTClient ...
var RESTConfig *rest.Config
var RoleMap map[string]map[string]string
Functions ¶
func BasicAuthCheck ¶
func BasicAuthzCheck ¶
func CreateRMDataTask ¶
func GetBackrestStorageTypes ¶
func GetBackrestStorageTypes() []string
func GetContainerResourcesJSON ¶
func GetContainerResourcesJSON(resources *crv1.PgContainerResources) string
GetContainerResources ...
func GetNamespace ¶
func GetNamespace(clientset *kubernetes.Clientset, username, requestedNS string) (string, error)
GetNamespace determines if a user has permission for a namespace they are requesting a valid requested namespace is required
func GetPodStatus ¶
func GetSecrets ¶
func Initialize ¶
func Initialize()
func InitializePerms ¶
func InitializePerms()
func IsStringOneOf ¶
IsStringOneOf tests to see string testVal is included in the list of strings provided using acceptedVals
func IsValidBackrestStorageType ¶
IsValidBackrestStorageType determines if the storageType string contains valid pgBackRest storage type values
func IsValidContainerResourceValues ¶
func IsValidContainerResourceValues() bool
func IsValidNodeLabel ¶
IsValidNodeLabel returns bool for key validity returns bool for value validity returns error
func IsValidPVC ¶
IsValidPVC determines if a PVC with the name provided exits
func IsValidStorageName ¶
func ValidateNodeLabel ¶
ValidateNodeLabel returns error if node label is invalid