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
| 53 | // calls SetConfig with its own token/endpoint, and the URL source is re-initialized. |
| 54 | // A mutex serialises concurrent Get() calls during initialisation. |
| 55 | type 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(). |
nothing calls this directly
no outgoing calls
no test coverage detected