MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / TestTeamFromToken

Function TestTeamFromToken

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

Source from the content-addressed store, hash-verified

143}
144
145func TestTeamFromToken(t *testing.T) {
146 t.Parallel()
147 require.Equal(t, "acme", TeamFromToken(cqpdTokenWithClaims(t, map[string]any{"tm": "acme", "u": "https://x"})),
148 "reads the tm claim so the CLI can target team-scoped endpoints from the token alone")
149 require.Empty(t, TeamFromToken(cqpdTokenWithClaims(t, map[string]any{"u": "https://x"})), "no tm claim -> empty")
150 require.Empty(t, TeamFromToken("not-a-cqpd-token"), "non-cqpd_ token -> empty")
151 require.Empty(t, TeamFromToken("cqpd_@@@.sig"), "malformed payload -> empty")
152}
153
154func TestDownloadAuth_HeadlessCQPDToken(t *testing.T) {
155 tok := cqpdTokenWithClaims(t, map[string]any{"tm": "acme", "u": "https://x"})

Callers

nothing calls this directly

Calls 2

TeamFromTokenFunction · 0.85
cqpdTokenWithClaimsFunction · 0.85

Tested by

no test coverage detected