cred

package
v0.1.0-preview Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cred is an internal helper that loads ~/.vxcloud/credentials.json — the same file vxcli writes during `vxcli auth login`. Read-only.

Importing this package is optional: the SDK can be initialized purely from explicit options. cred is provided so that an existing vxcli user can construct an SDK Client without re-supplying their key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path() string

Path returns the OS-appropriate path to the credentials file.

Types

type File

type File struct {
	APIKey       string `json:"api_key"`
	Username     string `json:"username"`
	Organization string `json:"organization,omitempty"`
	Workspace    string `json:"workspace,omitempty"`
	Environment  string `json:"environment,omitempty"`
	BaseURL      string `json:"base_url,omitempty"`
	AccessToken  string `json:"access_token,omitempty"`
	RefreshToken string `json:"refresh_token,omitempty"`
	NodeURL      string `json:"node_url,omitempty"`
	// TenantID / OrganizationID identify the tenant for the agentcontrol
	// surface (X-Tenant-ID header). vxcli may write either key.
	TenantID       string `json:"tenant_id,omitempty"`
	OrganizationID string `json:"organization_id,omitempty"`
	IsValid        bool   `json:"is_valid"`
}

File describes the on-disk credentials file produced by vxcli. Field names match the JSON keys vxcli writes today.

func Load

func Load() (*File, error)

Load reads and parses the credentials file. Returns os.ErrNotExist if vxcli has never been used on this machine.

Jump to

Keyboard shortcuts

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