internal

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentContextName

func GetCurrentContextName(reader io.Reader) (string, error)

GetCurrentContextName return the current contextName

func IsKeychainEnabled

func IsKeychainEnabled() bool

IsKeychainEnabled returns true is keychain is enable

func SetCurrentContext

func SetCurrentContext(reader io.Reader, writer io.Writer, contextName string) error

SetCurrentContext set the current context and returns it

func StoreContext

func StoreContext(reader io.Reader, writer io.Writer, cdsctx CDSContext) error

StoreContext writes the .cdsrc file

Types

type CDSConfigFile

type CDSConfigFile struct {
	Current  string
	Contexts map[string]CDSContext
}

CDSConfigFile represents a CDS Config File

func GetConfigFile

func GetConfigFile(reader io.Reader) (*CDSConfigFile, error)

GetConfigFile returns the config file

type CDSContext

type CDSContext struct {
	Context               string `json:"context" cli:"context"`
	Host                  string `json:"host" cli:"host"`
	InsecureSkipVerifyTLS bool   `json:"-" cli:"-"`
	Verbose               bool   `json:"-" cli:"-"`
	Session               string `json:"-" cli:"-"` // Session Token
	Token                 string `json:"-" cli:"-"` // BuiltinConsumerAuthenticationToken
}

CDSContext represents a CDS Context store in .cds/cdsrc file or in keychain

func GetContext

func GetContext(reader io.Reader, contextName string) (*CDSContext, error)

GetContext return the a CDSContext from a contextName

func GetCurrentContext

func GetCurrentContext(reader io.Reader) (*CDSContext, error)

GetCurrentContext return the current context

type ContextTokens

type ContextTokens struct {
	Session string `json:"session" cli:"-"` // Session Token
	Token   string `json:"token" cli:"-"`   // BuiltinConsumerAuthenticationToken
}

ContextTokens contains a Session Token and a Sign in token this struct is use to store secret in keychain

Jump to

Keyboard shortcuts

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