awakesecurity / gRPC-haskell

Haskell gRPC support
https://hackage.haskell.org/package/grpc-haskell
Apache License 2.0
238 stars 75 forks source link

The `StatusCode` enum defines `StatusCodeDoNotUse`. #160

Closed riz0id closed 3 months ago

riz0id commented 7 months ago

The StatusCode enum is currently defined via c2hs. This means that the Haskell enumeration includes a constructor StatusCodeDoNotUse since we convert directly from the C enumeration. As the name suggests, we probably should not have a constructor for StatusCodeDoNotUse. The googleapis gRPC reflection protos excludes a do_not_use enum from their status code enum. If possible, I suggest that we redefine the StatusCode enumeration so that a StatusCodeDoNotUse constructor is no longer included. However, this would require that we redefine StatusCode as a typical Haskell enum that exactly matches the grpc_status_code enumeration 1-to-1 other than the do_not_use case. Moreover, we would need to ensure that making this change does not have a meaningful impact at the gRPC-Haskell to grpc-core boundry.

I can make this change unless someone raises a good reason as to why we should include StatusCodeDoNotUse.