(ctx context.Context, id string, f rights.EntityFetcher)
| 32 | ) |
| 33 | |
| 34 | func fetchEntityRights(ctx context.Context, id string, f rights.EntityFetcher) (res struct { // nolint:unparam |
| 35 | AppRights *ttnpb.Rights |
| 36 | AppErr error |
| 37 | CliRights *ttnpb.Rights |
| 38 | CliErr error |
| 39 | GtwRights *ttnpb.Rights |
| 40 | GtwErr error |
| 41 | OrgRights *ttnpb.Rights |
| 42 | OrgErr error |
| 43 | UsrRights *ttnpb.Rights |
| 44 | UsrErr error |
| 45 | }, |
| 46 | ) { |
| 47 | var wg sync.WaitGroup |
| 48 | wg.Add(5) |
| 49 | go func() { |
| 50 | res.AppRights, res.AppErr = f.ApplicationRights(ctx, &ttnpb.ApplicationIdentifiers{ApplicationId: id}) |
| 51 | wg.Done() |
| 52 | }() |
| 53 | go func() { |
| 54 | res.CliRights, res.CliErr = f.ClientRights(ctx, &ttnpb.ClientIdentifiers{ClientId: id}) |
| 55 | wg.Done() |
| 56 | }() |
| 57 | go func() { |
| 58 | res.GtwRights, res.GtwErr = f.GatewayRights(ctx, &ttnpb.GatewayIdentifiers{GatewayId: id}) |
| 59 | wg.Done() |
| 60 | }() |
| 61 | go func() { |
| 62 | res.OrgRights, res.OrgErr = f.OrganizationRights(ctx, &ttnpb.OrganizationIdentifiers{OrganizationId: id}) |
| 63 | wg.Done() |
| 64 | }() |
| 65 | go func() { |
| 66 | res.UsrRights, res.UsrErr = f.UserRights(ctx, &ttnpb.UserIdentifiers{UserId: id}) |
| 67 | wg.Done() |
| 68 | }() |
| 69 | wg.Wait() |
| 70 | return res |
| 71 | } |
| 72 | |
| 73 | func fetchAuthInfo(ctx context.Context, f rights.AuthInfoFetcher) (*ttnpb.AuthInfoResponse, error) { |
| 74 | return f.AuthInfo(ctx) |
no test coverage detected