microsoft / CCF

Confidential Consortium Framework
https://microsoft.github.io/CCF/
Apache License 2.0
784 stars 212 forks source link

Framework support for gRPC #4211

Open jumaffre opened 2 years ago

jumaffre commented 2 years ago

Now that we have support for gRPC at the application level, the framework should also support gRPC to report consistent errors to clients. For example, currently, if a gRPC application defines an authentication policy throws an authorisation error, this error will be formatted by the framework and returned as JSON, which at best will be confusing to the gRPC client.

Instead, we should format the errors based on the content type header of the incoming request. The existing governance and operator endpoints will remain as JSON only.

Tasks:

jumaffre commented 1 year ago

This work will be necessary to support gRPC apps, e.g. https://github.com/microsoft/LSKV.

eddyashton commented 1 year ago

Protobuf v22 includes a hard dependency on Abseil, so we don't want to include that as a dependency for all CCF apps. We think that's fine - the framework can speak HTTP/2 and produce gRPC error trailers, and protobuf parsing/encoding is only necessary in the application. We may still want to build an enclave-friendly, mitigated version of protobuf, and distribute it with CCF for easy app consumption, but we don't want to link it in every app.