client

package
v0.4.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 23 Imported by: 15

Documentation

Index

Constants

View Source
const (
	SettingAdminPasswordHashKey = "admin.password"
	// SettingAdminPasswordMtimeKey designates the key for a root password mtime inside a Kubernetes secret.
	SettingAdminPasswordMtimeKey = "admin.passwordMtime"
	SettingAdminEnabledKey       = "admin.enabled"
	SettingAdminTokensKey        = "admin.tokens"
	SettingServerSignatureKey    = "server.secretkey"
	SettingURLKey                = "url"
	CallbackEndpoint             = "/auth/callback"
	SettingDexConfigKey          = "dex.config"
	DexCallbackEndpoint          = "/api/dex/callback"
	InitialPasswordLength        = 16
	DevtronSecretName            = "devtron-secret"
	DevtronConfigMapName         = "devtron-cm"

	ArgocdConfigMapName        = "argocd-cm"
	ArgocdSecretName           = "argocd-secret"
	ADMIN_PASSWORD             = "ADMIN_PASSWORD"
	SettingAdminAcdPasswordKey = "ACD_PASSWORD"
)

argocd specific conf

Variables

This section is empty.

Functions

func GetOidcClient

func GetOidcClient(conf *DexConfig, userVerifier oidc.UserVerifier, RedirectUrlSanitiser oidc.RedirectUrlSanitiser) (*oidc.ClientApp, func(writer http.ResponseWriter, request *http.Request), error)

func GetSettings

func GetSettings(conf *DexConfig) (*oidc.Settings, error)

Types

type DexConfig

type DexConfig struct {
	DexHost          string `env:"DEX_HOST" envDefault:"http://localhost"`
	DexPort          string `env:"DEX_PORT" envDefault:"5556"`
	DexClientID      string `env:"DEX_CLIENT_ID" envDefault:"argo-cd"`
	DexServerAddress string
	Url              string
	DexClientSecret  string
	ServerSecret     string
	// Specifies token expiration duration
	UserSessionDurationSeconds int       `env:"USER_SESSION_DURATION_SECONDS" envDefault:"86400"`
	AdminPasswordMtime         time.Time `json:"ADMIN_PASSWORD_MTIME"`
	DexConfigRaw               string
	DevtronSecretName          string `env:"DEVTRON_SECRET_NAME" envDefault:"devtron-secret"`
}

func BuildDexConfig

func BuildDexConfig(k8sClient *K8sClient) (*DexConfig, error)

func DexConfigConfigFromEnv added in v0.4.31

func DexConfigConfigFromEnv() (*DexConfig, error)

func (*DexConfig) DexOAuth2ClientSecret added in v0.4.21

func (c *DexConfig) DexOAuth2ClientSecret() string

func (*DexConfig) DexRedirectURL added in v0.4.21

func (c *DexConfig) DexRedirectURL() (string, error)

func (*DexConfig) GetDexProxyUrl added in v0.4.31

func (c *DexConfig) GetDexProxyUrl() (string, error)

func (*DexConfig) RedirectURL added in v0.4.21

func (c *DexConfig) RedirectURL() (string, error)

type K8sClient

type K8sClient struct {
	// contains filtered or unexported fields
}

func NewK8sClient

func NewK8sClient(runtimeConfig *RuntimeConfig) (*K8sClient, error)

func (*K8sClient) ConfigUpdateNotify added in v0.4.21

func (impl *K8sClient) ConfigUpdateNotify() (chan bool, error)

func (*K8sClient) GenerateDexConfigYAML added in v0.4.21

func (impl *K8sClient) GenerateDexConfigYAML(settings *DexConfig) ([]byte, error)

func (*K8sClient) GetArgocdConfig added in v0.4.31

func (impl *K8sClient) GetArgocdConfig() (secret *v1.Secret, cm *v1.ConfigMap, err error)

func (*K8sClient) GetDevtronConfig added in v0.4.31

func (impl *K8sClient) GetDevtronConfig() (secret *v1.Secret, err error)

func (*K8sClient) GetRestClient added in v0.4.21

func (impl *K8sClient) GetRestClient() (*kubernetes.Clientset, error)

func (*K8sClient) GetServerSettings

func (impl *K8sClient) GetServerSettings() (*DexConfig, error)

type LocalDevMode

type LocalDevMode bool

type RuntimeConfig added in v0.4.20

type RuntimeConfig struct {
	LocalDevMode                LocalDevMode `env:"RUNTIME_CONFIG_LOCAL_DEV" envDefault:"false"`
	DevtronDefaultNamespaceName string       `env:"DEVTRON_DEFAULT_NAMESPACE" envDefault:"devtroncd"`
}

func GetRuntimeConfig added in v0.4.20

func GetRuntimeConfig() (*RuntimeConfig, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL