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 language/culture support #31

Open
vvdb-architecture opened this issue Oct 7, 2022 · 0 comments
Open

API and language/culture support #31

vvdb-architecture opened this issue Oct 7, 2022 · 0 comments

Comments

@vvdb-architecture
Copy link
Contributor

vvdb-architecture commented Oct 7, 2022

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 language support. A separate issue has been filed for exception support (#37)

Currently, Arc4u has its own way of propagating culture information to API calls. This is done by clients injecting a custom header called "culture" in th request, and parsing it in the back-end middleware.
See the following code for handlers:

... for grpc interceptors:

... and for middleware:

This is problematic for two reasons:

  • it ignores the standard protocol for transferring culture in http (and grpc as well, since it's really http2): Content-Language.
  • the culture information is only passed in the context of authentication. However, authentication and culture information are orthogonal issues: one has nothing to do with another. It is not currently possible to pass culture information to anonymous calls. This might not be a use case today, but there might be one tomorrow.

There is built-in support for Content-Language in .NET, see Content-Language HTTP header. The Arc4u framework should switch to that support. For compatibility reasons, one may decide to keep the current mechanism, but the time should be as short as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant