(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func 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 | |
| 154 | func TestDownloadAuth_HeadlessCQPDToken(t *testing.T) { |
| 155 | tok := cqpdTokenWithClaims(t, map[string]any{"tm": "acme", "u": "https://x"}) |
nothing calls this directly
no test coverage detected