MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / platformToken

Function platformToken

cli/internal/platform/inject.go:138–146  ·  view source on GitHub ↗

platformToken returns the platform-destination cqpd_ token from its explicit CQ_PLATFORM_TOKEN env, or from CLOUDQUERY_API_KEY when that holds a cqpd_ (the standard credential env doubling as the platform token). "" when neither applies — i.e. no headless platform-destination token is configured. On

()

Source from the content-addressed store, hash-verified

136// applies — i.e. no headless platform-destination token is configured. One
137// helper so download, injection, and tenant detection treat both envs alike.
138func platformToken() string {
139 if t := os.Getenv(EnvPlatformToken); t != "" {
140 return t
141 }
142 if k := os.Getenv("CLOUDQUERY_API_KEY"); strings.HasPrefix(k, cqpdPrefix) {
143 return k
144 }
145 return ""
146}
147
148// PropagatePluginCredential makes a headless cqpd_ token available to spawned
149// source/destination plugins as CLOUDQUERY_API_KEY. Plugins validate premium

Callers 3

DetectTenantFunction · 0.85
DownloadAuthFunction · 0.85
MaybeInjectDestinationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected