/area runtime
/area operator
/area placement
/area docs
/area test-and-release
v0.6.0-5-gbff71a5a
Middleware from component-contrib is available to use as a component in the dapr runtime. including:
It looks like the component contrib middleware is not being registered with the dapr runtime. Unless I've missed something the only middleware being registered with the runtime is the default uppercase and oauth2. This is leading people to try using other middleware receiving the following error:
level=warning msg="failed to build HTTP pipeline: couldn't find HTTP middleware middleware.http.ratelimit"
Deploy a middleware component
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: ratelimit
spec:
type: middleware.http.ratelimit
metadata:
- name: maxRequestsPerSecond
value: "10"
Deploy a middleware config
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
name: pipeline
spec:
httpPipeline:
handlers:
- name: ratelimit
type: middleware.http.ratelimit
Launch dapr and watch the logs for an error.
cc: @benc-uk @cmendible
I think the maxRequestsPerSecond value needs to be in double quotes otherwise the component won't load
Updated the example, thanks @benc-uk.
Copying from Gitter:
There's 2 subtly different errors,
couldn't find middleware middleware.http.bearer of type middleware.http.bearerwhich is when the middleware in the config doesn't match the component (or the component is invalid). The other error iscouldn't find http middleware middleware.http.bearerwhich is when the middleware registry doesn't have a middleware with a matching name registered. Probably worth changing these to be more distinct too
Yep... seems that there are no calls to add other middleware than oauth2 and uppercase:
https://github.com/dapr/dapr/blob/bff71a5ab2e8fe0d83f2914796b8ed4b5d5db806/cmd/daprd/main.go#L308
/cc @youngbupark @Haishi2016 @msfussell @orizohar
If this is the case, we need to update daprd and issue a 0.6.1 release.
A PR for this would be most welcome.
I'll post a fix ASAP
Most helpful comment
I'll post a fix ASAP