profile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the directory for pinax config files.

func EnsureStoredSecret added in v0.1.6

func EnsureStoredSecret(name string) (string, error)

func ProfilesPath

func ProfilesPath() string

ProfilesPath returns the path to profiles.yaml.

func ResolveSecretRef

func ResolveSecretRef(ref string) (string, error)

ResolveSecretRef resolves a secret reference to the actual secret value.

func ResolveTarget

func ResolveTarget(target string) (endpoint, workspace, device, secretRef string, err error)

ResolveTarget resolves a target string to backend connection parameters. If target matches a profile name, returns that profile's parameters. If target is a URI (contains ://), returns it as-is for endpoint.

func Save

func Save(cfg *ProfilesConfig) error

Save writes profiles to disk.

func SecretsPath added in v0.1.6

func SecretsPath() string

func SetStoredSecret added in v0.1.6

func SetStoredSecret(name, value string) (string, error)

SetStoredSecret stores a specific plaintext value under name in the user-level secret store and returns a stored:// reference. Used by the sync repo compiler to persist a freshly unlocked secret as a device-local reference so the plaintext never enters the generated runtime config. The value never enters project or vault state.

Types

type AWSStaticCredentials added in v0.2.0

type AWSStaticCredentials struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

AWSStaticCredentials is the complete static credential set from one AWS shared-credentials profile. Callers must keep values in memory only.

func LoadAWSStaticCredentials added in v0.2.0

func LoadAWSStaticCredentials(profileName string) (AWSStaticCredentials, error)

LoadAWSStaticCredentials reads one AWS shared-credentials profile without invoking a shell or exposing values in errors.

type Profile

type Profile struct {
	Endpoint     string `yaml:"endpoint" json:"endpoint"`
	Workspace    string `yaml:"workspace" json:"workspace,omitempty"`
	Device       string `yaml:"device" json:"device,omitempty"`
	SecretRef    string `yaml:"secret_ref,omitempty" json:"secret_ref,omitempty"`
	DefaultScope string `yaml:"default_scope,omitempty" json:"default_scope,omitempty"`
}

Profile represents a named backend connection configuration.

type ProfilesConfig

type ProfilesConfig struct {
	Profiles map[string]Profile `yaml:"profiles"`
	Defaults struct {
		Profile      string `yaml:"profile,omitempty"`
		WriteProfile string `yaml:"write_profile,omitempty"`
	} `yaml:"defaults,omitempty"`
}

ProfilesConfig holds all profiles and defaults.

func Load

func Load() (*ProfilesConfig, error)

Load reads profiles from disk.

Jump to

Keyboard shortcuts

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