You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, we are the biggest consumers of our own APIs. Tomorrow, this may change.
Concretely, this means that we cannot keep relying on clients calling our back-ends to be clients written with the Arc4u framework. This is normally not a problem since we work with http/rest or grpc. There are two instances for which interoperability is problematic:
language support
exception support
This issue deals with exception support. A separate issue has been filed for language support (#31) .
Note that this is a work in progress (WIP). The problem is easy to identify, but a good solution is hard and depends on many factors.
The problem
The current way of propagating exceptions is not interoperable. It relies on the serialization of a Arc4u-specific exception (AppException) which is only known at both client and server side providing they both use the Arc4u framework.
If we want to be interoperable, we need a better way to do this, while keeping the flexibility of relaying exception information to Arc4u clients who "know" how to deal with dotnet exceptions in general, and AppException in particular.
The solution
HTTP/2 defines Problem Details for HTTP APIs. This applies to Grpc as well, since it is really based on HTTP/2. Since .NET Core 2.1, the ProblemDetails structure has been available.
Implementing middleware to return ProblemDetails when exceptions are thrown is certainly possible, and some suggestions are available. Normally, I would have written them in this issue.
However, starting from .NET 7.0, there is finally a better way to deal with this, including the customization for your own exception information, as explained here. Moving forward, this is probably the best way to go.
The discussion point is: do we keep the status quo until .NET 7+, or do we need to have something right now?
To be discussed!
The text was updated successfully, but these errors were encountered:
Implement minimal solution to disable the propagation of sensitive data.
The new advanced features available on .NET 7 and more will be used only when we decide to go to this version.
Waiting PR for this.
Today, we are the biggest consumers of our own APIs. Tomorrow, this may change.
Concretely, this means that we cannot keep relying on clients calling our back-ends to be clients written with the Arc4u framework. This is normally not a problem since we work with http/rest or grpc. There are two instances for which interoperability is problematic:
This issue deals with exception support. A separate issue has been filed for language support (#31) .
Note that this is a work in progress (WIP). The problem is easy to identify, but a good solution is hard and depends on many factors.
The problem
The current way of propagating exceptions is not interoperable. It relies on the serialization of a Arc4u-specific exception (AppException) which is only known at both client and server side providing they both use the Arc4u framework.
If we want to be interoperable, we need a better way to do this, while keeping the flexibility of relaying exception information to Arc4u clients who "know" how to deal with dotnet exceptions in general, and
AppException
in particular.The solution
HTTP/2 defines Problem Details for HTTP APIs. This applies to Grpc as well, since it is really based on HTTP/2. Since .NET Core 2.1, the ProblemDetails structure has been available.
Implementing middleware to return
ProblemDetails
when exceptions are thrown is certainly possible, and some suggestions are available. Normally, I would have written them in this issue.However, starting from .NET 7.0, there is finally a better way to deal with this, including the customization for your own exception information, as explained here. Moving forward, this is probably the best way to go.
The discussion point is: do we keep the status quo until .NET 7+, or do we need to have something right now?
To be discussed!
The text was updated successfully, but these errors were encountered: