Documentation
¶
Overview ¶
Package workspace covers the entire /api/v2/setup/* surface — workspace + organization lifecycle, cloud provider credential storage (AWS / GCP / Azure), AI provider credential storage (16 providers), Git provider connections, payment / SMTP / SSL / OAuth / OKTA / CyberArk creds, and the API token lifecycle.
The platform stores everything in HashiCorp Vault under a per-workspace path; this SDK never logs request bodies and all credential POSTs are over TLS.
Roughly 35 endpoints are wrapped here. Most follow the same shape: POST /api/v2/setup/<thing>-credentials with a JSON body containing the secret + a name, returning { "stored": true, "vault_path": "..." }.
Index ¶
- type AICredentialsInput
- type APIToken
- type AWSCredentials
- type AzureCredentials
- type Client
- func (c *Client) CreateAPIToken(ctx context.Context, in CreateAPITokenInput) (*APIToken, error)
- func (c *Client) CreateOrganization(ctx context.Context, in CreateOrganizationInput) (map[string]interface{}, error)
- func (c *Client) CreateWorkspace(ctx context.Context, in CreateWorkspaceInput) (*WorkspaceResult, error)
- func (c *Client) DeleteCredential(ctx context.Context, name string) (map[string]interface{}, error)
- func (c *Client) DeleteDockerRegistry(ctx context.Context, registrySlug string) (map[string]interface{}, error)
- func (c *Client) DeleteRandomCredential(ctx context.Context, credentialSlug string) (map[string]interface{}, error)
- func (c *Client) DeleteServer(ctx context.Context, serverSlug string) (map[string]interface{}, error)
- func (c *Client) DeleteWorkspace(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAPIToken(ctx context.Context, name string) (*APIToken, error)
- func (c *Client) GetAllAICredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllDockerCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllDockerRegistries(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllMessagingCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllPaymentCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllRandomCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllSMTPCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllServers(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetAllVMCredentials(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) GetDockerCredentialsByRegistry(ctx context.Context, registrySlug string) (map[string]interface{}, error)
- func (c *Client) GetDockerRegistry(ctx context.Context, registrySlug string) (map[string]interface{}, error)
- func (c *Client) GetRandomCredential(ctx context.Context, credentialSlug string) (map[string]interface{}, error)
- func (c *Client) GetServer(ctx context.Context, serverSlug string) (map[string]interface{}, error)
- func (c *Client) GetVMCredentialsByKeypair(ctx context.Context, keyPairName string) (map[string]interface{}, error)
- func (c *Client) GetVaultCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreAICredentials(ctx context.Context, provider string, in AICredentialsInput) (map[string]interface{}, error)
- func (c *Client) StoreAWSCredentials(ctx context.Context, in AWSCredentials) (map[string]interface{}, error)
- func (c *Client) StoreAzureCredentials(ctx context.Context, in AzureCredentials) (map[string]interface{}, error)
- func (c *Client) StoreCyberarkCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreDockerCredentials(ctx context.Context, in DockerCredentials) (map[string]interface{}, error)
- func (c *Client) StoreDockerRegistry(ctx context.Context, in DockerRegistry) (map[string]interface{}, error)
- func (c *Client) StoreExternalVaultCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreGCPCredentials(ctx context.Context, in GCPCredentials) (map[string]interface{}, error)
- func (c *Client) StoreGitCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreGitHubCredentials(ctx context.Context, in GitHubCredentials) (map[string]interface{}, error)
- func (c *Client) StoreGitlabCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreKubeconfigCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreMessagingBotCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreOAuthCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreOktaCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StorePaymentCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreRandomCredential(ctx context.Context, in RandomCredential) (map[string]interface{}, error)
- func (c *Client) StoreSMTPCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreSSLCertificateCredentials(ctx context.Context, body map[string]interface{}) (map[string]interface{}, error)
- func (c *Client) StoreServer(ctx context.Context, in ServerEntry) (map[string]interface{}, error)
- func (c *Client) StoreVMCredentials(ctx context.Context, in VMCredentials) (map[string]interface{}, error)
- type CreateAPITokenInput
- type CreateOrganizationInput
- type CreateWorkspaceInput
- type DockerCredentials
- type DockerRegistry
- type GCPCredentials
- type GitHubCredentials
- type RandomCredential
- type ServerEntry
- type VMCredentials
- type WorkspaceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AICredentialsInput ¶
type AICredentialsInput struct {
APIKey string `json:"api_key,omitempty"`
OrgID string `json:"org_id,omitempty"`
Endpoint string `json:"endpoint,omitempty"` // for self-hosted Ollama / Hermes
}
AICredentialsInput is the body shape every /api/v2/setup/ai-*-credentials endpoint accepts. Most providers want only ApiKey; some accept extras.
type AWSCredentials ¶
type AWSCredentials struct {
AccessKeyID string `json:"AWS_ACCESS_KEY_ID"`
SecretAccessKey string `json:"AWS_SECRET_ACCESS_KEY"`
Region string `json:"AWS_REGION,omitempty"`
IAMUser string `json:"AWS_IAM_USER,omitempty"`
AccountID string `json:"AWS_ACCOUNT_ID,omitempty"`
}
AWSCredentials — JSON tags mirror AWSVariablesRequest in vxnode/services/workspace/workspace.go (UPPER_SNAKE, not snake_case).
type AzureCredentials ¶
type AzureCredentials struct {
ClientID string `json:"AZURE_CLIENT_ID"`
ClientSecret string `json:"AZURE_CLIENT_SECRET"`
TenantID string `json:"AZURE_TENANT_ID"`
SubscriptionID string `json:"AZURE_SUBSCRIPTION_ID"`
}
AzureCredentials — JSON tags mirror AzureVariablesRequest (workspace.go).
type Client ¶
type Client struct {
T *transport.Transport
NodeURL string
// AuthedUsername / AuthedOrganization are injected into every
// /api/v2/setup/* body by post(); the server validates both
// (VaultCredentialsRequest in vxnode/services/workspace/workspace.go).
AuthedUsername string
AuthedOrganization string
}
Client — construct via c.Workspace().
func (*Client) CreateAPIToken ¶
func (*Client) CreateOrganization ¶
func (c *Client) CreateOrganization(ctx context.Context, in CreateOrganizationInput) (map[string]interface{}, error)
CreateOrganization under the current workspace.
func (*Client) CreateWorkspace ¶
func (c *Client) CreateWorkspace(ctx context.Context, in CreateWorkspaceInput) (*WorkspaceResult, error)
Create a new tenant workspace with Vault-backed storage.
func (*Client) DeleteCredential ¶
DeleteCredential removes a stored credential by name.
func (*Client) DeleteDockerRegistry ¶
func (*Client) DeleteRandomCredential ¶
func (*Client) DeleteServer ¶
func (*Client) DeleteWorkspace ¶
DeleteWorkspace tears down the current workspace and all resources.
func (*Client) GetAPIToken ¶
func (*Client) GetAllAICredentials ¶
GetAllAICredentials lists every AI provider with stored credentials in the current workspace.
func (*Client) GetAllCredentials ¶
GetAllCredentials lists every cloud credential stored in the current workspace (names + types only — never returns the secret values).
func (*Client) GetAllDockerCredentials ¶
GetAllDockerCredentials lists every Docker credential entry (sensitive fields masked).
func (*Client) GetAllDockerRegistries ¶
func (*Client) GetAllMessagingCredentials ¶
func (*Client) GetAllPaymentCredentials ¶
func (*Client) GetAllRandomCredentials ¶
func (*Client) GetAllSMTPCredentials ¶
func (*Client) GetAllServers ¶
func (*Client) GetAllVMCredentials ¶
func (*Client) GetDockerCredentialsByRegistry ¶
func (c *Client) GetDockerCredentialsByRegistry(ctx context.Context, registrySlug string) (map[string]interface{}, error)
GetDockerCredentialsByRegistry fetches one Docker credential by registry slug.
func (*Client) GetDockerRegistry ¶
func (*Client) GetRandomCredential ¶
func (*Client) GetVMCredentialsByKeypair ¶
func (*Client) GetVaultCredentials ¶
func (*Client) StoreAICredentials ¶
func (*Client) StoreAWSCredentials ¶
func (*Client) StoreAzureCredentials ¶
func (*Client) StoreCyberarkCredentials ¶
func (*Client) StoreDockerCredentials ¶
func (*Client) StoreDockerRegistry ¶
func (*Client) StoreExternalVaultCredentials ¶
func (*Client) StoreGCPCredentials ¶
func (*Client) StoreGitCredentials ¶
func (*Client) StoreGitHubCredentials ¶
func (*Client) StoreGitlabCredentials ¶
func (*Client) StoreKubeconfigCredentials ¶
func (*Client) StoreMessagingBotCredentials ¶
func (*Client) StoreOAuthCredentials ¶
func (*Client) StoreOktaCredentials ¶
func (*Client) StorePaymentCredentials ¶
func (*Client) StoreRandomCredential ¶
func (*Client) StoreSMTPCredentials ¶
func (*Client) StoreSSLCertificateCredentials ¶
func (*Client) StoreServer ¶
func (*Client) StoreVMCredentials ¶
type CreateAPITokenInput ¶
type CreateOrganizationInput ¶
type CreateWorkspaceInput ¶
type DockerCredentials ¶
type DockerCredentials struct {
DockerUser string `json:"DOCKER_USERNAME"`
DockerPass string `json:"DOCKER_PASSWORD"`
DockerEmail string `json:"DOCKER_EMAIL,omitempty"`
DockerServer string `json:"DOCKER_SERVER,omitempty"`
DockerRegistryName string `json:"DOCKER_REGISTRY_NAME"`
DockerRegistryType string `json:"DOCKER_REGISTRY_TYPE,omitempty"`
}
DockerCredentials mirrors DockerVariablesRequest (workspace.go). DockerRegistryName is the slug — multiple registries can coexist in one workspace.
type DockerRegistry ¶
type DockerRegistry struct {
RegistryName string `json:"registry_name"`
RegistryType string `json:"registry_type"` // dockerhub|ecr|gcr|acr|ghcr|gitlab|quay|harbor|jfrog|custom
RegistryURL string `json:"registry_url"`
Namespace string `json:"namespace,omitempty"`
Region string `json:"region,omitempty"`
DefaultCredentialSlug string `json:"default_credential_slug,omitempty"`
Description string `json:"description,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
}
DockerRegistry mirrors DockerRegistryRequest. Stored at docker/registry-endpoints/<slug>. May reference a saved Docker credential by slug via DefaultCredentialSlug.
type GCPCredentials ¶
type GCPCredentials struct {
ProjectID string `json:"GCP_PROJECT_ID"`
ServiceAccountKey string `json:"GCP_SERVICE_ACCOUNT_KEY"` // raw JSON string
}
GCPCredentials — JSON tags mirror GCPVariablesRequest (workspace.go).
type GitHubCredentials ¶
type RandomCredential ¶
type RandomCredential struct {
CredentialName string `json:"credential_name"`
CredentialType string `json:"credential_type,omitempty"` // free-form tag
Description string `json:"description,omitempty"`
Fields map[string]interface{} `json:"fields,omitempty"`
JSONBlob string `json:"json_blob,omitempty"`
}
RandomCredential is a free-form credential entry. Fields holds arbitrary K/V; JSONBlob is opaque text (e.g. a full GCP service-account JSON document).
type ServerEntry ¶
type ServerEntry struct {
Name string `json:"name"`
IPAddress string `json:"ip_address"`
Hostname string `json:"hostname,omitempty"`
Port int `json:"port,omitempty"`
Description string `json:"description,omitempty"`
KeypairName string `json:"keypair_name,omitempty"`
KeypairLocation string `json:"keypair_location,omitempty"`
Tags []string `json:"tags,omitempty"`
}
ServerEntry is one row in the workspace server inventory. Name + IPAddress are required; KeypairName / KeypairLocation are optional.