Websockets now use rest_framework configed auth

* 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
This commit is contained in:
Chris Meyers 2024-02-07 14:20:23 -05:00 committed by Dave
parent f429ef6ca7
commit 2259047527

View File

@ -4,9 +4,10 @@ import logging
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
@ -34,6 +35,6 @@ websocket_urlpatterns = [
application = AWXProtocolTypeRouter(
{
'websocket': AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
'websocket': DrfAuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
}
)