Documentation
¶
Index ¶
- func DeleteSecret(ctx context.Context, orgID, environment, name string) error
- func FetchSecrets(ctx context.Context, orgID, environment string, names []string, fetchAll bool, ...) error
- func GetActiveOrg() (string, error)
- func GetLastCheck() time.Time
- func GetProfile(ctx context.Context) (*cratev1.GetProfileResponse, error)
- func GetSecret(ctx context.Context, orgID, environment, name string) error
- func ListSecrets(ctx context.Context, orgID, environment string) error
- func ListTags(ctx context.Context, orgID string) error
- func LoadEnvFile(filename string) (map[string]string, error)
- func Login(ctx context.Context, endpoint string) error
- func Logout(ctx context.Context) error
- func RetrieveSecrets(ctx context.Context, orgID, environment string, names []string, fetchAll bool, ...) (map[string]string, error)
- func SetActiveOrg(orgID string) error
- func StoreSecret(ctx context.Context, orgID, environment, name, value string, tags []string) error
- func UpdateLastCheck(t time.Time) error
- func ValidateConfig(ctx context.Context, filename string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSecret ¶
DeleteSecret deletes a secret. If name is empty, prompts the user interactively with a confirmation step.
func FetchSecrets ¶
func FetchSecrets(ctx context.Context, orgID, environment string, names []string, fetchAll bool, tags []string) error
FetchSecrets retrieves multiple secrets securely and prints them to stdout.
func GetActiveOrg ¶
GetActiveOrg retrieves the currently active organization from the configuration file.
func GetLastCheck ¶
GetLastCheck returns the time of the last update check.
func GetProfile ¶
func GetProfile(ctx context.Context) (*cratev1.GetProfileResponse, error)
GetProfile retrieves the user profile and their organizations via the gRPC connect endpoint.
func GetSecret ¶
GetSecret retrieves a secret using sealed transport. If name is empty, prompts the user interactively.
func ListSecrets ¶
ListSecrets lists all secrets for the given organization and environment.
func LoadEnvFile ¶ added in v1.0.4
LoadEnvFile reads a key-value .env file and returns a map of environment variables. It skips empty lines, comments (lines starting with #), and trims surrounding quotes from values.
func RetrieveSecrets ¶
func RetrieveSecrets(ctx context.Context, orgID, environment string, names []string, fetchAll bool, tags []string) (map[string]string, error)
RetrieveSecrets retrieves multiple secrets securely and returns them as a map. If fetchAll is true or --names is provided, skips prompting (ideal for CI/deploy). Otherwise, prompts the user to choose between fetching all or entering specific names.
func SetActiveOrg ¶
SetActiveOrg saves the given organization ID to the configuration file.
func StoreSecret ¶
StoreSecret stores a secret using sealed transport. If name or value are empty, prompts the user interactively.
func UpdateLastCheck ¶
UpdateLastCheck updates the LastUpdateCheck timestamp in the config.