mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 09:27:31 -02:30
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:
@@ -4,9 +4,10 @@ import logging
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.urls import re_path
|
from django.urls import re_path
|
||||||
|
|
||||||
from channels.auth import AuthMiddlewareStack
|
|
||||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||||
|
|
||||||
|
from ansible_base.lib.channels.middleware import DrfAuthMiddlewareStack
|
||||||
|
|
||||||
from . import consumers
|
from . import consumers
|
||||||
|
|
||||||
|
|
||||||
@@ -34,6 +35,6 @@ websocket_urlpatterns = [
|
|||||||
|
|
||||||
application = AWXProtocolTypeRouter(
|
application = AWXProtocolTypeRouter(
|
||||||
{
|
{
|
||||||
'websocket': AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
|
'websocket': DrfAuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user