package console import ( "testing" "time" "github.com/carlosframework/platform/internal/svcrole" ) // serviceToken mints a service principal and returns its bearer — the // service-principal counterpart of cliToken, and deliberately the same // shape, so a test reads the same whichever kind of caller it is exercising. // Tasks 4-8 use this; do not invent a second one. func serviceToken(t *testing.T, st *Store, accountID int64, name, app string, role svcrole.Role) string { t.Helper() raw, err := st.NewServicePrincipal(accountID, name, app, role, "paul@example.test", time.Now()) if err != nil { t.Fatalf("NewServicePrincipal(%q): %v", name, err) } return raw }