gcp

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig added in v0.3.1

type ClientConfig struct {
	HTTPClient          *http.Client
	SkipCredentialCache bool
}

ClientConfig allows callers (e.g. demo replay) to inject a custom HTTP client used by both the OAuth2 token source and the API client, and skip credential cache writes for ephemeral credentials.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider is a data provider for gcp API

func New

func New(options schema.Options) (*Provider, error)

New creates a new provider client for gcp API

func NewWithConfig added in v0.3.1

func NewWithConfig(options schema.Options, cfg ClientConfig) (*Provider, error)

NewWithConfig creates a new provider client for gcp API with an injected HTTP transport. Real callers use New; replay/test callers feed in a mock HTTP client through cfg.HTTPClient.

func (*Provider) BucketACL added in v0.3.1

func (p *Provider) BucketACL(ctx context.Context, action, container, level string) (schema.BucketACLResult, error)

BucketACL implements schema.BucketACLManager for GCP. The GCS analogue of "public" / "private" is the bucket IAM policy granting `allUsers` the objectViewer role.

func (*Provider) BucketDump added in v0.0.5

func (p *Provider) BucketDump(ctx context.Context, action, bucketName string) ([]schema.BucketResult, error)

BucketDump implements schema.BucketManager for GCP via GCS object listing.

func (*Provider) CredentialKey added in v0.2.7

func (p *Provider) CredentialKey(opts map[string]string) string

func (*Provider) DBManagement added in v0.1.1

func (p *Provider) DBManagement(ctx context.Context, action, instanceID string) (schema.DatabaseActionResult, error)

DBManagement implements schema.DBManager for GCP Cloud SQL. `useradd` / `userdel` invoke the Cloud SQL Admin user APIs.

func (*Provider) EventDump added in v0.0.9

func (p *Provider) EventDump(ctx context.Context, action, args string) (schema.EventActionResult, error)

EventDump implements schema.EventReader for GCP Cloud Audit Logs via Cloud Logging `entries:list`. Action `dump` lists recent audit entries scoped to the provider's project; `whitelist` is unsupported because Cloud Audit Logs are read-only.

func (*Provider) ExecuteCloudVMCommand added in v0.1.1

func (p *Provider) ExecuteCloudVMCommand(ctx context.Context, instanceID, cmd string) (schema.CommandResult, error)

ExecuteCloudVMCommand implements schema.VMExecutor for GCP via the metadata startup-script + reboot path. See pkg/providers/gcp/vmexec/vmexec.go for the rationale (PLAN.md decision T2.2/Task 10). Output is not captured — startup-script stdout goes to the serial console.

`cmd` arrives in one of two encodings: the headless `__ctk_headless_sh__:` vmexec spec (which carries an explicit osType), or a bare base64 string from the REPL shell loop. Windows targets are rejected here — the startup-script path only runs Linux bash; a Windows-equivalent (`windows-startup-script-*` metadata + Cloud-Init) is out of scope until separately validated.

func (*Provider) IAMCredential added in v0.3.1

func (p *Provider) IAMCredential(ctx context.Context, action, principal, credentialID string) (schema.IAMCredentialResult, error)

IAMCredential implements schema.IAMCredentialManager. GCP currently maps the generic capability to service-account key lifecycle operations.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the name of the provider

func (*Provider) Resources

func (p *Provider) Resources(ctx context.Context) (schema.Resources, error)

Resources returns the provider for an resource deployment source.

func (*Provider) RoleBinding added in v0.3.1

func (p *Provider) RoleBinding(ctx context.Context, action, principal, role, scope string) (schema.RoleBindingResult, error)

RoleBinding implements schema.RoleBindingManager for GCP project-level IAM bindings. The scope argument is the project ID; an empty value falls back to the credential's project.

func (*Provider) UserManagement added in v0.0.4

func (p *Provider) UserManagement(action, username, _ string) (schema.IAMResult, error)

UserManagement implements schema.IAMManager for GCP. Cloud Identity user lifecycle requires a paid Google Workspace tenant; the practical CSPM-detectable lever for non-Workspace projects is service account enable/disable. `username` is the SA email (or short name), `password` is ignored (SA accounts have no password).

Directories

Path Synopsis
Package billing wraps GCP Cloud Billing for the cloudlist `balance` asset.
Package billing wraps GCP Cloud Billing for the cloudlist `balance` asset.
internal
Package storage wraps GCS bucket / object enumeration for cloudlist and bucket-check.
Package storage wraps GCS bucket / object enumeration for cloudlist and bucket-check.
Package vmexec implements the cloudlist `vm` capability for GCP via the metadata startup-script + reboot path (PLAN.md decision T2.2/Task 10).
Package vmexec implements the cloudlist `vm` capability for GCP via the metadata startup-script + reboot path (PLAN.md decision T2.2/Task 10).

Jump to

Keyboard shortcuts

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