Commit c716a184 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Rework the urls to use path and re_path

parent d0e5ffeb
from django.conf.urls import url
from django.conf.urls import path, include
from django.views.decorators.csrf import csrf_exempt
from .views import webpage, clients
clientpatterns = [
path('user', csrf_exempt(clients.user_endpoint)),
path('vhost', csrf_exempt(clients.vhost_endpoint)),
path('resource', csrf_exempt(clients.resource_endpoint)),
path('topic', csrf_exempt(clients.topic_endpoint)),
]
URLPATTERNS = [
url(r'^info', webpage.AuthInfo.as_view()),
url(r'^request', webpage.Auth.as_view(), name='login'),
url(r'^callback', webpage.AuthCallback.as_view(), name='callback'),
url(r'^logout', webpage.LogoutView.as_view()),
path('info', webpage.AuthInfo.as_view()),
path('request', webpage.Auth.as_view(), name='login'),
path('callback', webpage.AuthCallback.as_view(), name='callback'),
path('logout', webpage.LogoutView.as_view()),
url(r'^client/user', csrf_exempt(clients.user_endpoint)),
url(r'^client/vhost', csrf_exempt(clients.vhost_endpoint)),
url(r'^client/resource', csrf_exempt(clients.resource_endpoint)),
url(r'^client/topic', csrf_exempt(clients.topic_endpoint)),
path('client/', include(clientpatterns)),
]
from django.conf.urls import include, url
from django.conf.urls import include, path
from django.contrib import admin
from .views.clients import URLPATTERNS as clientapi_urls
......@@ -6,13 +6,14 @@ from .views.webpage import URLPATTERNS as frontend_urls
from .views.rest import URLPATTERNS as user_rest_urls
from .auth.v1.urls import URLPATTERNS as auth_urls
# used in tests
API_PATH = 'user-api'
URLPATTERNS = [
url(r'^clientapi/', include(clientapi_urls)),
url(r'^api/', include(frontend_urls)),
url(r'^user-api/', include(user_rest_urls)),
url(r'^auth/v1/', include(auth_urls)),
url(r'^admin', admin.site.urls),
path('clientapi/', include(clientapi_urls)),
path('api/', include(frontend_urls)),
path(API_PATH + '/', include(user_rest_urls)),
path('auth/v1/', include(auth_urls)),
path('admin/', admin.site.urls),
]
......@@ -2,7 +2,7 @@
import logging
from django.conf import settings
from django.conf.urls import url
from django.conf.urls import path
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import get_object_or_404
from rest_framework import generics, views, exceptions
......@@ -222,9 +222,9 @@ def response_view_error(err):
URLPATTERNS = [
url(r'^dep-state$', DeploymentStateView.as_view()),
url(r'^dep-states$', DeploymentStateListView.as_view()),
path('dep-state/', DeploymentStateView.as_view()),
path('dep-states/', DeploymentStateListView.as_view()),
url(r'^config', ConfigurationView.as_view()),
url(r'^deregister', DeregisterView.as_view()),
path('config/', ConfigurationView.as_view()),
path('deregister/', DeregisterView.as_view()),
]
import logging
from django.conf.urls import url
from django.conf.urls import path, re_path
from django.contrib.auth import logout
from django.shortcuts import get_object_or_404
from django.http import HttpResponse
......@@ -235,28 +235,23 @@ class DeploymentStateView(generics.RetrieveUpdateAPIView):
URLPATTERNS = [
url(r'^$', HelpView.as_view()),
path('user', UserDeletionView.as_view()),
url(r'^user$', UserDeletionView.as_view()),
path('services', ServiceListView.as_view()),
re_path(r'^service/(?P<id>[0-9]+)$', ServiceView.as_view()),
url(r'^services$', ServiceListView.as_view()),
url(r'^service/(?P<id>[0-9]+)$', ServiceView.as_view()),
url(r'^service(/.+)*$', HelpView.as_view()),
path('vos', VOListView.as_view()),
re_path(r'^vo/(?P<id>[0-9]+)$', VOView.as_view()),
url(r'^vos$', VOListView.as_view()),
url(r'^vo/(?P<id>[0-9]+)$', VOView.as_view()),
url(r'^vo(/.+)*$', HelpView.as_view()),
url(r'^ssh-keys$', SSHPublicKeyListView.as_view()),
url(r'^ssh-key/(?P<id>[0-9]+)$', SSHPublicKeyView.as_view()),
url(r'^ssh-key(/.+)*$', HelpView.as_view()),
path('ssh-keys', SSHPublicKeyListView.as_view()),
re_path(r'^ssh-key/(?P<id>[0-9]+)$', SSHPublicKeyView.as_view()),
# type is either 'vo' or 'service'
url(r'^deployments/?(?P<type>.+)?$', DeploymentListView.as_view()),
url(r'^deployment/(?P<type>.+)/(?P<id>[0-9]+)$', DeploymentView.as_view()),
url(r'^deployment(/.+)*$', HelpView.as_view()),
re_path(r'^deployments/?(?P<type>.+)?$', DeploymentListView.as_view()),
re_path(r'^deployment/(?P<type>.+)/(?P<id>[0-9]+)$', DeploymentView.as_view()),
path('states', DeploymentStateListView.as_view()),
re_path(r'^state/(?P<id>[0-9]+)$', DeploymentStateView.as_view()),
url(r'^states$', DeploymentStateListView.as_view()),
url(r'^state/(?P<id>[0-9]+)$', DeploymentStateView.as_view()),
url(r'^state(/.+)*$', HelpView.as_view()),
re_path(r'.*', HelpView.as_view()),
]
import logging
from django.conf.urls import url
from django.conf.urls import path
from rest_framework import status, generics
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
......@@ -38,5 +38,5 @@ class StateView(generics.RetrieveAPIView):
URLPATTERNS = [
url(r'^state', StateView.as_view()),
path('state/', StateView.as_view()),
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment