(ctx context.Context, in *pb.Num)
| 17 | ) |
| 18 | |
| 19 | func forwardAssignUidsToZero(ctx context.Context, in *pb.Num) (*pb.AssignedIds, error) { |
| 20 | if in.Type != pb.Num_UID { |
| 21 | return &pb.AssignedIds{}, errors.Errorf("Cannot lease %s via zero proxy", in.Type.String()) |
| 22 | } |
| 23 | |
| 24 | if x.WorkerConfig.AclEnabled { |
| 25 | var err error |
| 26 | ctx, err = x.AttachJWTNamespaceOutgoing(ctx) |
| 27 | if err != nil { |
| 28 | return &pb.AssignedIds{}, err |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | pl := groups().Leader(0) |
| 33 | if pl == nil { |
| 34 | return nil, conn.ErrNoConnection |
| 35 | } |
| 36 | zc := pb.NewZeroClient(pl.Get()) |
| 37 | return zc.AssignIds(ctx, in) |
| 38 | } |
| 39 | |
| 40 | // RegisterZeroProxyServer forwards select GRPC calls over to Zero |
| 41 | func RegisterZeroProxyServer(s *grpc.Server) { |
no test coverage detected