profile

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoSpacesContextMsg = "This cluster does not have spaces installed, use `up space init` to install spaces."
	NoGroupMsg         = "The current kubeconfig context does not point to a group, use `up ctx` to select a group."
)

Variables

This section is empty.

Functions

func GetIngressHost added in v0.29.0

func GetIngressHost(ctx context.Context, cl corev1client.ConfigMapsGetter) (host string, ca []byte, err error)

GetIngressHost returns the ingress host of the Spaces cfg points to. If the ingress is not configured, it returns an empty string.

func ParseMCPK8sURL added in v0.29.0

func ParseMCPK8sURL(url string) (ctp types.NamespacedName, matches bool)

ParseMCPK8sURL attempts to parse a legacy MCP URL and returns the name of the matching control plane if it matches

func ParseSpacesK8sURL added in v0.29.0

func ParseSpacesK8sURL(url string) (base string, ctp types.NamespacedName, matches bool)

ParseSpacesK8sURL parses a URL and returns the namespace and optionally the controlplane name (if specified).

func ToSpacesK8sURL added in v0.29.0

func ToSpacesK8sURL(ingress string, ctp types.NamespacedName) string

Types

type Profile

type Profile struct {
	// ID is the referencable name of the profile.
	ID string `json:"id,omitempty"`

	// TokenType is the type of token in the profile.
	TokenType TokenType `json:"type"`

	// Session is a session token used to authenticate to Upbound.
	Session string `json:"session,omitempty"`

	// Account is the default account to use when this profile is selected.
	Account string `json:"account,omitempty"`

	// BaseConfig represent persisted settings for this profile.
	// For example:
	// * flags
	// * environment variables
	BaseConfig map[string]string `json:"base,omitempty"`
}

A Profile is a set of credentials

func (Profile) Validate

func (p Profile) Validate() error

Validate returns an error if the profile is invalid.

type Redacted

type Redacted struct {
	Profile
}

Redacted embeds a Upbound Profile for the sole purpose of redacting sensitive information.

func (Redacted) MarshalJSON

func (p Redacted) MarshalJSON() ([]byte, error)

MarshalJSON overrides the session field with `REDACTED` so as not to leak sensitive information. We're using an explicit copy here instead of updating the underlying Profile struct so as to not modifying the internal state of the struct by accident.

type TokenType added in v0.29.0

type TokenType string

TokenType is a type of Upbound session token format.

const (
	// Types of profiles.
	TokenTypeUser  TokenType = "user"
	TokenTypeToken TokenType = "token"

	DefaultName = "default"
)

Jump to

Keyboard shortcuts

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