Documentation
¶
Overview ¶
Package vertex provides token storage for Google Vertex AI Gemini via service account credentials. It serialises service account JSON into an auth file that is consumed by the runtime executor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeServiceAccountJSON ¶
NormalizeServiceAccountJSON normalizes the given JSON-encoded service account payload. It returns the normalized JSON (with sanitized private_key) or, if normalization fails, the original bytes and the encountered error.
Types ¶
type VertexCredentialStorage ¶
type VertexCredentialStorage struct {
// ServiceAccount holds the parsed service account JSON content.
ServiceAccount map[string]any `json:"service_account"`
// ProjectID is derived from the service account JSON (project_id).
ProjectID string `json:"project_id"`
// Email is the client_email from the service account JSON.
Email string `json:"email"`
// Location optionally sets a default region (e.g., us-central1) for Vertex endpoints.
Location string `json:"location,omitempty"`
// Type is the provider identifier stored alongside credentials. Always "vertex".
Type string `json:"type"`
}
VertexCredentialStorage stores the service account JSON for Vertex AI access. The content is persisted verbatim under the "service_account" key, together with helper fields for project, location and email to improve logging and discovery.
func (*VertexCredentialStorage) SaveTokenToFile ¶
func (s *VertexCredentialStorage) SaveTokenToFile(authFilePath string) error
SaveTokenToFile writes the credential payload to the given file path in JSON format. It ensures the parent directory exists and logs the operation for transparency.