django-cas-server/cas_server/urls.py
Yohann D'ANELLO d62def6d6b
django.conf.urls is deprecated and will be removed in Django 4.0, use django.urls.re_path instead
Signed-off-by: Yohann D'ANELLO <ynerant@¢rans.org>
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
2020-12-22 23:07:33 +01:00

79 lines
2.4 KiB
Python

# -*- coding: utf-8 -*-
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License version 3 for
# more details.
#
# You should have received a copy of the GNU General Public License version 3
# along with this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# (c) 2015-2016 Valentin Samir
"""urls for the app"""
import django
if django.VERSION < (2,):
from django.conf.urls import url
re_path = url
else:
from django.urls import re_path
from django.conf.urls import url
from django.views.generic import RedirectView
from django.views.decorators.debug import sensitive_post_parameters, sensitive_variables
from cas_server import views
app_name = "cas_server"
urlpatterns = [
re_path(
r'^$',
RedirectView.as_view(pattern_name="cas_server:login", permanent=False, query_string=True)
),
re_path(
'^login$',
sensitive_post_parameters('password')(
views.LoginView.as_view()
),
name='login'
),
re_path('^logout$', views.LogoutView.as_view(), name='logout'),
re_path('^validate$', views.Validate.as_view(), name='validate'),
re_path(
'^serviceValidate$',
views.ValidateService.as_view(allow_proxy_ticket=False),
name='serviceValidate'
),
re_path(
'^proxyValidate$',
views.ValidateService.as_view(allow_proxy_ticket=True),
name='proxyValidate'
),
re_path('^proxy$', views.Proxy.as_view(), name='proxy'),
re_path(
'^p3/serviceValidate$',
views.ValidateService.as_view(allow_proxy_ticket=False),
name='p3_serviceValidate'
),
re_path(
'^p3/proxyValidate$',
views.ValidateService.as_view(allow_proxy_ticket=True),
name='p3_proxyValidate'
),
re_path('^samlValidate$', views.SamlValidate.as_view(), name='samlValidate'),
re_path(
'^auth$',
sensitive_variables('password', 'secret')(
sensitive_post_parameters('password', 'secret')(
views.Auth.as_view()
)
),
name='auth'
),
re_path("^federate(?:/(?P<provider>([^/]+)))?$",
views.FederateAuth.as_view(), name='federateAuth'),
]