Documentation
¶
Index ¶
- func ClearEnvironmentVariables(shell utilities.ShellType)
- func ClearProcessEnvironment()
- func FormatHost(host string) string
- func GetSessionEnvKeys() []string
- func GetTokenSubject(value string) (string, error)
- func GetVariablesFromSession(session *CumulocitySession, cfg *config.Config, client *c8y.Client, ...) map[string]interface{}
- func IsSessionFilePath(path string) bool
- func LoginTypeRequiresToken(loginType string) bool
- func MarshalSession(session *CumulocitySession, cfg *config.Config) ([]byte, error)
- func PrintSessionInfo(w io.Writer, client *c8y.Client, cfg *config.Config, session CumulocitySession)
- func PrintSessionInfoAsJSON(w io.Writer, client *c8y.Client, cfg *config.Config, session CumulocitySession) error
- func ShouldReuseToken(cfg *config.Config, log *logger.Logger, token string, loginType string) bool
- func ShowSessionEnvironmentVariables(session *CumulocitySession, cfg *config.Config, c8yclient *c8y.Client, ...)
- func WriteOutput(w io.Writer, client *c8y.Client, cfg *config.Config, ...) error
- type CumulocitySession
- func (s CumulocitySession) GetDomain() string
- func (s CumulocitySession) GetHost() string
- func (s CumulocitySession) GetPassword() string
- func (s CumulocitySession) GetSessionPassphrase() string
- func (s CumulocitySession) IsAuthorized() bool
- func (s *CumulocitySession) SetAuthorized(v bool)
- func (s *CumulocitySession) SetHost(host string)
- func (s *CumulocitySession) SetPassword(password string)
- func (s *CumulocitySession) SetToken(token string)
- type CumulocitySessions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearEnvironmentVariables ¶ added in v2.42.0
func ClearProcessEnvironment ¶ added in v2.42.0
func ClearProcessEnvironment()
func FormatHost ¶
func GetSessionEnvKeys ¶ added in v2.42.0
func GetSessionEnvKeys() []string
func GetTokenSubject ¶ added in v2.53.0
func GetVariablesFromSession ¶ added in v2.42.0
func GetVariablesFromSession(session *CumulocitySession, cfg *config.Config, client *c8y.Client, setPassword bool) map[string]interface{}
GetVariablesFromSession gets all the environment variables associated with the current session
func IsSessionFilePath ¶ added in v2.42.1
func LoginTypeRequiresToken ¶ added in v2.53.0
LoginTypeRequiresToken check if the given loginType requires a token for authorization
func MarshalSession ¶ added in v2.53.0
func MarshalSession(session *CumulocitySession, cfg *config.Config) ([]byte, error)
func PrintSessionInfo ¶
func PrintSessionInfo(w io.Writer, client *c8y.Client, cfg *config.Config, session CumulocitySession)
PrintSessionInfo print out the session information to writer (i.e. console or file)
func PrintSessionInfoAsJSON ¶ added in v2.42.0
func ShouldReuseToken ¶ added in v2.52.1
ShouldReuseToken checks if the token should be reused or not
func ShowSessionEnvironmentVariables ¶ added in v2.42.0
Types ¶
type CumulocitySession ¶
type CumulocitySession struct {
Schema string `json:"$schema,omitempty"`
// authorized
Authorized *bool `json:"authorized,omitempty"`
// ID string `json:"id"`
Host string `json:"host,omitempty"`
Tenant string `json:"tenant,omitempty"`
Version string `json:"version,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Mode string `json:"mode,omitempty"`
TOTP string `json:"totp,omitempty"`
Token string `json:"token,omitempty"`
Description string `json:"description,omitempty"`
UseTenantPrefix bool `json:"useTenantPrefix"`
LoginType string `json:"loginType,omitempty"`
// Certificate-based (mTLS) auth paths — stored in session file and/or C8Y_CERTIFICATE / C8Y_CERTIFICATE_KEY env vars.
Certificate string `json:"certificate,omitempty"`
CertificateKey string `json:"certificateKey,omitempty"`
// BrowserCallbackURL is the preferred redirect URI for the browser authorization code flow.
// Stored at top-level for env-file compatibility; also written into settings.sso.browserCallbackUrl.
BrowserCallbackURL string `json:"browserCallbackUrl,omitempty"`
Settings *config.CommandSettings `json:"settings,omitempty"`
MicroserviceAliases map[string]string `json:"microserviceAliases,omitempty"`
Index int `json:"-"`
Path string `json:"-"`
Extension string `json:"-"`
Name string `json:"-"`
// How to identify the session
SessionUri string `json:"sessionUri,omitempty"`
Logger *logger.Logger `json:"-"`
Config *config.Config `json:"-"`
}
CumulocitySession contains all settings required to communicate with a Cumulocity service
func (CumulocitySession) GetDomain ¶ added in v2.42.0
func (s CumulocitySession) GetDomain() string
GetDomain gets the custom Cumulocity domain for cases where it differs from the Host
func (CumulocitySession) GetHost ¶
func (s CumulocitySession) GetHost() string
func (CumulocitySession) GetPassword ¶
func (s CumulocitySession) GetPassword() string
func (CumulocitySession) GetSessionPassphrase ¶
func (s CumulocitySession) GetSessionPassphrase() string
func (CumulocitySession) IsAuthorized ¶ added in v2.53.0
func (s CumulocitySession) IsAuthorized() bool
func (*CumulocitySession) SetAuthorized ¶ added in v2.53.0
func (s *CumulocitySession) SetAuthorized(v bool)
func (*CumulocitySession) SetHost ¶
func (s *CumulocitySession) SetHost(host string)
func (*CumulocitySession) SetPassword ¶
func (s *CumulocitySession) SetPassword(password string)
func (*CumulocitySession) SetToken ¶
func (s *CumulocitySession) SetToken(token string)
type CumulocitySessions ¶
type CumulocitySessions struct {
Sessions []CumulocitySession `json:"sessions"`
}
Click to show internal directories.
Click to hide internal directories.