Skip to content

Commit

Permalink
Websockets now use rest_framework configed auth
Browse files Browse the repository at this point in the history
* Always support cookies, session, and also allow rest_framework
  configured auth methods over the browser websocket.
* The node -> node websocket auth remains locked down and unchanged
  • Loading branch information
chrismeyersfsu committed Feb 7, 2024
1 parent 527755d commit 0276a47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/main/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from django.conf import settings
from django.urls import re_path

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter

from ansible_base.lib.channels.middleware import DrfAuthMiddlewareStack

from . import consumers


Expand All @@ -33,6 +34,6 @@ def __init__(self, *args, **kwargs):

application = AWXProtocolTypeRouter(
{
'websocket': AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
'websocket': DrfAuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
}
)

0 comments on commit 0276a47

Please sign in to comment.