Fixed guacamole urls && small pam fix

This commit is contained in:
Adolfo Gómez García 2021-06-29 14:48:04 +02:00
parent 6e0292e76e
commit c98933b6ed
2 changed files with 6 additions and 7 deletions

View File

@ -31,13 +31,11 @@
@author: Adolfo Gómez, dkmaster at dkmon dot com
"""
from django.conf.urls import url
from .views import guacamole
from .views import guacamole, guacamole_authenticated
urlpatterns = [
# Old, compat
url(r'^guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
# New path
url(r'^uds/guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
# Authenticated path
url(r'^uds/guacamole/auth/(?P<authId>[^/]+)/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
url(r'^uds/guacamole/auth/(?P<authId>[^/]+)/(?P<tunnelId>.+)$', guacamole_authenticated, name='dispatcher.guacamole'),
# Non authenticated path. Disabled
# url(r'^uds/guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole.noauth'),
]

View File

@ -35,6 +35,7 @@ import logging
from django.http import HttpResponseNotAllowed, HttpResponse, HttpRequest
from uds.models import TicketStore
from uds.core.auths import auth
from uds.core.util.request import ExtendedHttpRequestWithUser
logger = logging.getLogger(__name__)
@ -42,7 +43,7 @@ logger = logging.getLogger(__name__)
@auth.trustedSourceRequired
def pam(request: HttpRequest) -> HttpResponse:
def pam(request: ExtendedHttpRequestWithUser) -> HttpResponse:
response = ''
if request.method == 'POST':
return HttpResponseNotAllowed(['GET'])