-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for "middleware extensions" #7441
Comments
Capturing some thoughts from the discussion in the SIG call on March 29:
the role and capabilities for middleware needs to be well defined, what it has access to, what its purpose is |
Other thoughts:
|
Hi - I got here while searching for how to implement HTTP Strict Transport Security. My organization requires this setting. How soon might there be work put into a header_injector extension? Do you have recommendations on how to implement HTTP Strict Transport Security? |
From the Collector SIG meeting on 2024-12-11, we can start with an |
@dyanneo, to answer your question directly: I can't think of a way to achieve that right now, which is why I brought this to the SIG call today. We decided to move forward with this feature, but there is no ETA at the moment. |
@jpkrohling Thank you!!
So, the no ETA - is that for middleware or the confighttp components? |
Both: I'll start with the middleware part (interfaces and one or two implementations), but they can't be used until we have all plugged in as part of confighttp/configgrpc. This is currently relatively high on my queue, so while we don't have an ETA (it's end of the year, after all), I think we might be able to get it done "soon". Would you able to help me design and develop this? |
Is your feature request related to a problem? Please describe.
When developing a custom auth extension, @rlankfo mentioned he needs access to the request URI to determine the proper auth parameters (tenant, for instance). Instead of just adding the possibility of specifying the interceptors to use as part of the auth package and using the experience gathered over the past couple of years since implementing the auth capabilities, I think it might be helpful to add support for middleware extensions instead: middleware extensions would have the possibility of intercepting the incoming requests (HTTP and gRPC) and potentially doing things that are beyond auth (and possibly advanced auth scenarios, like @rlankfo's). Another example of a middleware extension would be @MovieStoreGuy's open-telemetry/opentelemetry-collector-contrib#6908.
Depending on how we progress with this idea, server auth extensions could be implemented as a specialization of a middleware extension.
Describe the solution you'd like
I had a proposal for "authorizers" as part of @MovieStoreGuy's rate limiting extension proposal, and I would change that a bit, so that it reads middleware instead:
Describe alternatives you've considered
Solving @rlankfo's problem could also be done by adding the notion of Interceptors to the server auth extension interface, with the current interptors (http.Handler, gRPC's Unary and Stream interceptors) as default implementations, allowing auth extensions to override when needed via options (WithInterceptor in addition to the current WithAuthenticate). Another possible solution to the original problem would be to add request metadata (URL, for instance) to the client's context, which is made available later on to auth extensions.
The text was updated successfully, but these errors were encountered: