urls.py 2.11 KB
Newer Older
Valentin Samir's avatar
Valentin Samir committed
1
# -*- coding: utf-8 -*-
Valentin Samir's avatar
Valentin Samir committed
2 3 4 5 6 7 8 9 10
# 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.
#
Valentin Samir's avatar
Valentin Samir committed
11
# (c) 2015-2016 Valentin Samir
Valentin Samir's avatar
Valentin Samir committed
12
"""urls for the app"""
Valentin Samir's avatar
Valentin Samir committed
13 14
from django.conf.urls import patterns, url
from django.views.generic import RedirectView
15
from django.views.decorators.debug import sensitive_post_parameters, sensitive_variables
Valentin Samir's avatar
Valentin Samir committed
16

Valentin Samir's avatar
Valentin Samir committed
17
from cas_server import views
Valentin Samir's avatar
Valentin Samir committed
18

Valentin Samir's avatar
Valentin Samir committed
19 20
urlpatterns = patterns(
    '',
21
    url(r'^$', RedirectView.as_view(pattern_name="cas_server:login")),
22 23 24 25 26 27 28
    url(
        '^login$',
        sensitive_post_parameters('password')(
            views.LoginView.as_view()
        ),
        name='login'
    ),
29
    url('^logout$', views.LogoutView.as_view(), name='logout'),
30
    url('^validate$', views.Validate.as_view(), name='validate'),
Valentin Samir's avatar
PEP8  
Valentin Samir committed
31 32 33 34 35 36 37 38 39 40
    url(
        '^serviceValidate$',
        views.ValidateService.as_view(allow_proxy_ticket=False),
        name='serviceValidate'
    ),
    url(
        '^proxyValidate$',
        views.ValidateService.as_view(allow_proxy_ticket=True),
        name='proxyValidate'
    ),
41
    url('^proxy$', views.Proxy.as_view(), name='proxy'),
Valentin Samir's avatar
PEP8  
Valentin Samir committed
42 43 44 45 46 47 48 49 50 51
    url(
        '^p3/serviceValidate$',
        views.ValidateService.as_view(allow_proxy_ticket=False),
        name='p3_serviceValidate'
    ),
    url(
        '^p3/proxyValidate$',
        views.ValidateService.as_view(allow_proxy_ticket=True),
        name='p3_proxyValidate'
    ),
52
    url('^samlValidate$', views.SamlValidate.as_view(), name='samlValidate'),
53 54 55 56 57 58 59 60 61
    url(
        '^auth$',
        sensitive_variables('password')(
            sensitive_post_parameters('password')(
                views.Auth.as_view()
            )
        ),
        name='auth'
    ),
Valentin Samir's avatar
Valentin Samir committed
62
    url("^federate(?:/(?P<provider>([^/]+)))?$", views.FederateAuth.as_view(), name='federateAuth'),
Valentin Samir's avatar
Valentin Samir committed
63
)