github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/api/v1beta1/grafana/auth/Github/github.go (about) 1 package github 2 3 import ( 4 secret2 "github.com/caos/orbos/pkg/secret" 5 ) 6 7 type Auth struct { 8 ClientID *secret2.Secret `json:"clientID,omitempty" yaml:"clientID,omitempty"` 9 //Existing secret with the clientID 10 ExistingClientIDSecret *secret2.Existing `json:"existingClientIDSecret,omitempty" yaml:"existingClientIDSecret,omitempty"` 11 ClientSecret *secret2.Secret `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"` 12 //Existing secret with the clientSecret 13 ExistingClientSecretSecret *secret2.Existing `json:"existingClientSecretSecret,omitempty" yaml:"existingClientSecretSecret,omitempty"` 14 // Organizations allowed to login 15 AllowedOrganizations []string `json:"allowedOrganizations,omitempty" yaml:"allowedOrganizations,omitempty"` 16 // TeamIDs where the user is required to have at least one membership 17 TeamIDs []string `json:"teamIDs,omitempty" yaml:"teamIDs,omitempty"` 18 } 19 20 func (a *Auth) IsZero() bool { 21 if (a.ClientID == nil || a.ClientID.IsZero()) && 22 (a.ClientSecret == nil || a.ClientSecret.IsZero()) && 23 a.ExistingClientIDSecret == nil && 24 a.ExistingClientSecretSecret == nil && 25 a.AllowedOrganizations == nil && 26 a.TeamIDs == nil { 27 return true 28 } 29 30 return false 31 }