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

Function TestDetectTenant_DirectToken

cli/internal/platform/inject_test.go:196–201  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

194}
195
196func TestDetectTenant_DirectToken(t *testing.T) {
197 t.Setenv(EnvPlatformToken, cqpdTokenWithURL(t, "https://acme.us.platform.cloudquery.io"))
198 url, ok := DetectTenant(context.Background(), "", "")
199 require.True(t, ok, "a CQ_PLATFORM_TOKEN means a tenant is present")
200 require.Equal(t, "https://acme.us.platform.cloudquery.io", url, "url comes from the token's u claim")
201}
202
203func TestDetectTenant_Disabled(t *testing.T) {
204 t.Setenv(envDisable, "1")

Callers

nothing calls this directly

Calls 2

cqpdTokenWithURLFunction · 0.85
DetectTenantFunction · 0.85

Tested by

no test coverage detected