forked from shaba/openuds
Added new "future" url paths for some dispatchers
This commit is contained in:
parent
416a11c0ed
commit
b238bba7a4
@ -42,16 +42,19 @@ from django.utils.translation import get_language
|
||||
from django.urls import reverse
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
from uds.core.util.config import GlobalConfig
|
||||
from uds.core.util import log
|
||||
from uds.core.util.decorators import deprecated
|
||||
|
||||
from uds.core import auths
|
||||
from uds.core.util import log
|
||||
from uds.core.util import net
|
||||
from uds.core.util.config import GlobalConfig
|
||||
from uds.core.util.decorators import deprecated
|
||||
from uds.core.util.stats import events
|
||||
from uds.core.managers import cryptoManager
|
||||
from uds.core.util.state import State
|
||||
from uds.models import User, Authenticator
|
||||
from uds.core.managers import cryptoManager
|
||||
from uds.core.auths import Authenticator as AuthenticatorInstance
|
||||
|
||||
from uds.models import User, Authenticator
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
authLogger = logging.getLogger('authLog')
|
||||
@ -140,7 +143,6 @@ def trustedSourceRequired(view_func: typing.Callable[..., RT]) -> typing.Callabl
|
||||
"""
|
||||
Wrapped function for decorator
|
||||
"""
|
||||
from uds.core.util import net
|
||||
if net.ipInNetwork(request.ip, GlobalConfig.TRUSTED_SOURCES.get(True)) is False:
|
||||
return HttpResponseForbidden()
|
||||
return view_func(request, *args, **kwargs)
|
||||
|
@ -55,6 +55,10 @@ class RedirectMiddleware:
|
||||
'rest',
|
||||
'pam',
|
||||
'guacamole',
|
||||
# For new paths
|
||||
# 'uds/rest', # REST must be HTTPS if redirect is enabled
|
||||
'uds/pam',
|
||||
'uds/guacamole'
|
||||
]
|
||||
|
||||
def __init__(self, get_response):
|
||||
|
@ -34,5 +34,8 @@ from django.conf.urls import url
|
||||
from .views import guacamole
|
||||
|
||||
urlpatterns = [
|
||||
# Old, compat
|
||||
url(r'^guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
|
||||
# New path
|
||||
url(r'^uds/guacamole/(?P<tunnelId>.+)$', guacamole, name='dispatcher.guacamole'),
|
||||
]
|
||||
|
@ -34,5 +34,8 @@ from django.conf.urls import url
|
||||
from .views import pam
|
||||
|
||||
urlpatterns = [
|
||||
# Old, compat
|
||||
url(r'^pam$', pam, name='dispatcher.pam'),
|
||||
# New
|
||||
url(r'^uds/pam$', pam, name='dispatcher.pam'),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user