MCPcopy
hub / github.com/grafana/k6 / SecretSource

Struct SecretSource

internal/secretsource/cloud/cloud.go:55–62  ·  view source on GitHub ↗

SecretSource wraps the URL secret source for cloud-based secrets. It is automatically registered for 'k6 cloud run --local-execution' (unless --no-cloud-secrets is passed). Configuration arrives via SetConfig from the CreateTestRun API response (createCloudTest) before the first Get() call. The URL

Source from the content-addressed store, hash-verified

53// calls SetConfig with its own token/endpoint, and the URL source is re-initialized.
54// A mutex serialises concurrent Get() calls during initialisation.
55type SecretSource struct {
56 params secretsource.Params
57 configPtr *atomic.Pointer[Config]
58 mu sync.Mutex
59 activeCfg *Config // the Config pointer that urlSource was built from
60 urlSource secretsource.Source
61 initErr error
62}
63
64// SetConfig stores the cloud secrets configuration. Called from createCloudTest once the
65// CreateTestRun API response is available, before any VU goroutine can call Get().

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected