credentials

package
v0.124.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCredentialsNotFound = errors.New("credentials not found")
	ErrProfileNotFound     = errors.New("profile not found")
)
View Source
var (
	ErrNoBrowser = errors.New("no browser could be found")
)

Functions

func AddProfile added in v0.117.0

func AddProfile(name string, profile types.Profile) error

AddProfile adds or updates a profile in the config file

func Fetch

func Fetch(endpoint string) error

func GetCredentialsWithProfile added in v0.117.0

func GetCredentialsWithProfile(profileName string) (*types.Credentials, error)

GetCredentialsWithProfile retrieves credentials with the following priority: 1. Environment variables (REPLICATED_API_TOKEN) 2. Named profile (if profileName is provided) 3. Default profile from config file (if profileName is empty) 4. Legacy single token from config file (backward compatibility)

func GetCurrentCredentials

func GetCurrentCredentials() (*types.Credentials, error)

func GetDefaultProfile added in v0.117.0

func GetDefaultProfile() (string, error)

GetDefaultProfile returns the name of the default profile

func GetProfile added in v0.117.0

func GetProfile(name string) (*types.Profile, error)

GetProfile retrieves a specific profile by name

func GetProfileOrigins added in v0.117.0

func GetProfileOrigins(profileName string) (apiOrigin, registryOrigin string, err error)

GetProfileOrigins returns the API and registry origins for a given profile Returns empty strings if profile doesn't exist or doesn't specify origins

func ListProfiles added in v0.117.0

func ListProfiles() (map[string]types.Profile, string, error)

ListProfiles returns all profiles and the default profile name

func RemoveCurrentCredentials added in v0.59.0

func RemoveCurrentCredentials() error

func RemoveProfile added in v0.117.0

func RemoveProfile(name string) error

RemoveProfile removes a profile from the config file

func SetCurrentCredentials

func SetCurrentCredentials(token string) error

func SetDefaultProfile added in v0.117.0

func SetDefaultProfile(name string) error

SetDefaultProfile sets the default profile

Types

type OriginConfig added in v0.117.0

type OriginConfig struct {
	VendorAPI      string
	VendorWeb      string
	Registry       string
	Linter         string
	KurlSH         string
	UsingNamespace bool
}

OriginConfig holds the resolved origins for all services

func ResolveOrigins added in v0.117.0

func ResolveOrigins(profile types.Profile) OriginConfig

ResolveOrigins resolves all service origins from a profile If the profile has a namespace, it generates okteto URLs Otherwise, it uses explicit origins or defaults

func ResolveOriginsFromProfileName added in v0.117.0

func ResolveOriginsFromProfileName(profileName string) (OriginConfig, error)

ResolveOriginsFromProfileName is a convenience function that loads a profile and resolves its origins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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