cluster.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package models
  2. // ClusterAuth is an auth mechanism that a cluster candidate can resolve
  3. type ClusterAuth string
  4. // The support cluster candidate auth mechanisms
  5. const (
  6. X509 ClusterAuth = "x509"
  7. Basic ClusterAuth = "basic"
  8. Bearer ClusterAuth = "bearerToken"
  9. OIDC ClusterAuth = "oidc"
  10. GCP ClusterAuth = "gcp-sa"
  11. AWS ClusterAuth = "aws-sa"
  12. DO ClusterAuth = "do-oauth"
  13. Local ClusterAuth = "local"
  14. )
  15. // Cluster is an integration that can connect to a Kubernetes cluster via
  16. // a specific auth mechanism
  17. type Cluster struct {
  18. // The auth mechanism that this cluster will use
  19. AuthMechanism ClusterAuth `json:"auth_mechanism"`
  20. // The project that this integration belongs to
  21. ProjectID uint `json:"project_id"`
  22. // Name of the cluster
  23. Name string `json:"name"`
  24. // Server endpoint for the cluster
  25. Server string `json:"server"`
  26. // Additional fields optionally used by the kube client
  27. ClusterLocationOfOrigin string `json:"location_of_origin,omitempty"`
  28. TLSServerName string `json:"tls-server-name,omitempty"`
  29. InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"`
  30. ProxyURL string `json:"proxy-url,omitempty"`
  31. UserLocationOfOrigin string
  32. UserImpersonate string `json:"act-as,omitempty"`
  33. UserImpersonateGroups string `json:"act-as-groups,omitempty"`
  34. InfraID uint `json:"infra_id"`
  35. // ------------------------------------------------------------------
  36. // All fields below this line are encrypted before storage
  37. // ------------------------------------------------------------------
  38. // The various auth mechanisms available to the integration
  39. KubeIntegrationID uint
  40. OIDCIntegrationID uint
  41. GCPIntegrationID uint
  42. AWSIntegrationID uint
  43. DOIntegrationID uint
  44. // CertificateAuthorityData for the cluster, encrypted at rest
  45. CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
  46. }