credentialmanager

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalCheckForContextChange bool

GlobalCheckForContextChange ...Since credential manager is called at multiple times, we don't want to check for context switch for one command at multiple places, it should be called only for the first time.

View Source
var MockAuthCreds bool
View Source
var MockKubeConfigCheck bool

Functions

This section is empty.

Types

type CredentialManager

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

func NewCredentialManager

func NewCredentialManager(autoApplyNewContext bool) *CredentialManager

NewCredentialManager creates a new credential manager

func (*CredentialManager) GetCreds

func (cm *CredentialManager) GetCreds(namespace string) (url.URL, string, error)

GetCreds reads the credentials and returns an endpoint, the api token, or potentially an error.

func (*CredentialManager) GetCurrentKeptnCLIConfig

func (cm *CredentialManager) GetCurrentKeptnCLIConfig() config.CLIConfig

func (*CredentialManager) GetCurrentKubeConfig

func (cm *CredentialManager) GetCurrentKubeConfig() KubeConfigFileType

func (*CredentialManager) GetInstallCreds

func (cm *CredentialManager) GetInstallCreds() (string, error)

GetInstallCreds gets the install credentials

func (*CredentialManager) SetCreds

func (cm *CredentialManager) SetCreds(endPoint url.URL, apiToken string, namespace string) error

SetCreds stores the credentials consisting of an endpoint and an api token using pass or into a file in case pass is unavailable.

func (*CredentialManager) SetCurrentKeptnCLIConfig

func (cm *CredentialManager) SetCurrentKeptnCLIConfig(cliConfig config.CLIConfig)

func (*CredentialManager) SetCurrentKubeConfig

func (cm *CredentialManager) SetCurrentKubeConfig(kubeConfig KubeConfigFileType)

func (*CredentialManager) SetInstallCreds

func (cm *CredentialManager) SetInstallCreds(creds string) error

SetInstallCreds sets the install credentials

type CredentialManagerInterface

type CredentialManagerInterface interface {
	SetCreds(endPoint url.URL, apiToken string, namespace string) error
	GetCreds(namespace string) (url.URL, string, error)
	SetInstallCreds(creds string) error
	GetInstallCreds() (string, error)
	SetCurrentKubeConfig(kubeConfig KubeConfigFileType)
	GetCurrentKubeConfig() KubeConfigFileType
	SetCurrentKeptnCLIConfig(cliConfig config.CLIConfig)
	GetCurrentKeptnCLIConfig() config.CLIConfig
}

type KubeConfigFileType

type KubeConfigFileType struct {
	CurrentContext string `yaml:"current-context"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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