Skip to content

Commit

Permalink
Merge pull request #173 from ractf/fix-auth
Browse files Browse the repository at this point in the history
Add authorization middleware for metrics.
  • Loading branch information
0xAda authored Aug 10, 2021
2 parents 7eae571 + 37d6f0d commit 23d0a97
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sockets/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

application = ProtocolTypeRouter(
{
"http": URLRouter(
[
path("ws/metrics", consumers.PrometheusConsumer.as_asgi()),
path("api/v2/ws/metrics", consumers.PrometheusConsumer.as_asgi()),
],
"http": AuthMiddlewareStack(
URLRouter(
[
path("ws/metrics", consumers.PrometheusConsumer.as_asgi()),
path("api/v2/ws/metrics", consumers.PrometheusConsumer.as_asgi()),
],
),
),
"websocket": AuthMiddlewareStack(
URLRouter(
Expand Down

0 comments on commit 23d0a97

Please sign in to comment.