Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API and exception support (WIP) #37

Open
vvdb-architecture opened this issue Oct 7, 2022 · 1 comment
Open

API and exception support (WIP) #37

vvdb-architecture opened this issue Oct 7, 2022 · 1 comment
Labels

Comments

@vvdb-architecture
Copy link
Contributor

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!

@GFlisch
Copy link
Owner

GFlisch commented Nov 7, 2022

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.

@rdarko rdarko added the help wanted Extra attention is needed label Apr 12, 2023
@rdarko rdarko added .net 8 and removed help wanted Extra attention is needed labels May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants