Beispiel #1
0
 def test_validate_view(self):
     """
     When called with no parameters, a validation failure should
     be returned.
     """
     request = self.rf.get(reverse('cas_validate'))
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
Beispiel #2
0
 def test_validate_view(self):
     """
     When called with no parameters, a validation failure should
     be returned.
     """
     request = self.rf.get(reverse('cas_validate'))
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
Beispiel #3
0
 def test_validate_view_invalid_service(self):
     """
     When called with an invalid service identifier, a validation
     failure should be returned.
     """
     request = self.rf.get(reverse('cas_validate'), {'service': self.url2, 'ticket': self.st.ticket})
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
 def test_validate_view_invalid_service(self):
     """
     When called with an invalid service identifier, a validation
     failure should be returned.
     """
     request = self.rf.get(reverse('cas_validate'), {'service': 'http://example.org', 'ticket': self.st.ticket})
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
Beispiel #5
0
 def test_validate_view_invalid_ticket(self):
     """
     When the provided ticket cannot be found, a validation failure
     should be returned.
     """
     st_str = ServiceTicket.objects.create_ticket_str()
     request = self.rf.get(reverse('cas_validate'), {'service': self.url, 'ticket': st_str})
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
 def test_validate_view_invalid_ticket(self):
     """
     When the provided ticket cannot be found, a validation failure
     should be returned.
     """
     st_str = ServiceTicket.objects.create_ticket_str()
     request = self.rf.get(reverse('cas_validate'), {'service': self.url, 'ticket': st_str})
     response = ValidateView.as_view()(request)
     self.assertContains(response, "no\n\n")
     self.assertEqual(response.get('Content-Type'), 'text/plain')
Beispiel #7
0
    def test_validate_view_success(self):
        """
        When called with valid parameters, a validation success should
        be returned. The provided ticket should then be consumed.
        """
        request = self.rf.get(reverse('cas_validate'), {'service': self.url, 'ticket': self.st.ticket})
        response = ValidateView.as_view()(request)
        self.assertContains(response, "yes\nellen\n")
        self.assertEqual(response.get('Content-Type'), 'text/plain')

        st = ServiceTicket.objects.get(ticket=self.st.ticket)
        self.assertTrue(st.is_consumed())
    def test_validate_view_success(self):
        """
        When called with valid parameters, a validation success should
        be returned. The provided ticket should then be consumed.
        """
        request = self.rf.get(reverse('cas_validate'), {'service': self.url, 'ticket': self.st.ticket})
        response = ValidateView.as_view()(request)
        self.assertContains(response, "yes\nellen\n")
        self.assertEqual(response.get('Content-Type'), 'text/plain')

        st = ServiceTicket.objects.get(ticket=self.st.ticket)
        self.assertTrue(st.is_consumed())
Beispiel #9
0
from django.conf.urls import url

from mama_cas.views import LoginView
from mama_cas.views import LogoutView
from mama_cas.views import ValidateView
from mama_cas.views import ServiceValidateView
from mama_cas.views import ProxyValidateView
from mama_cas.views import ProxyView
from mama_cas.views import WarnView
from mama_cas.views import SamlValidateView

urlpatterns = [
    url(r'^login/?$', LoginView.as_view(), name='cas_login'),
    url(r'^logout/?$', LogoutView.as_view(), name='cas_logout'),
    url(r'^validate/?$', ValidateView.as_view(), name='cas_validate'),
    url(r'^serviceValidate/?$',
        ServiceValidateView.as_view(),
        name='cas_service_validate'),
    url(r'^proxyValidate/?$',
        ProxyValidateView.as_view(),
        name='cas_proxy_validate'),
    url(r'^proxy/?$', ProxyView.as_view(), name='cas_proxy'),
    url(r'^p3/serviceValidate/?$',
        ServiceValidateView.as_view(),
        name='cas_p3_service_validate'),
    url(r'^p3/proxyValidate/?$',
        ProxyValidateView.as_view(),
        name='cas_p3_proxy_validate'),
    url(r'^warn/?$', WarnView.as_view(), name='cas_warn'),
    url(r'^samlValidate/?$',
Beispiel #10
0
from mama_cas.views import ServiceValidateView
from mama_cas.views import ProxyValidateView
from mama_cas.views import ProxyView
from mama_cas.views import WarnView
from mama_cas.views import SamlValidateView


urlpatterns = patterns('',
    url(r'^login/?$',
        LoginView.as_view(),
        name='cas_login'),
    url(r'^logout/?$',
        LogoutView.as_view(),
        name='cas_logout'),
    url(r'^validate/?$',
        ValidateView.as_view(),
        name='cas_validate'),
    url(r'^serviceValidate/?$',
        ServiceValidateView.as_view(),
        name='cas_service_validate'),
    url(r'^proxyValidate/?$',
        ProxyValidateView.as_view(),
        name='cas_proxy_validate'),
    url(r'^proxy/?$',
        ProxyView.as_view(),
        name='cas_proxy'),
    url(r'^p3/serviceValidate/?$',
        ServiceValidateView.as_view(),
        name='cas_p3_service_validate'),
    url(r'^p3/proxyValidate/?$',
        ProxyValidateView.as_view(),
Beispiel #11
0
"""
(2) CAS server URIs as described in the CAS protocol.
"""

from django.conf.urls import url

from mama_cas.views import LoginView
from mama_cas.views import LogoutView
from mama_cas.views import ValidateView
from mama_cas.views import ServiceValidateView
from mama_cas.views import ProxyValidateView
from mama_cas.views import ProxyView
from mama_cas.views import WarnView
from mama_cas.views import SamlValidateView


urlpatterns = [
    url(r'^login/?$', LoginView.as_view(), name='cas_login'),
    url(r'^logout/?$', LogoutView.as_view(), name='cas_logout'),
    url(r'^validate/?$', ValidateView.as_view(), name='cas_validate'),
    url(r'^serviceValidate/?$', ServiceValidateView.as_view(), name='cas_service_validate'),
    url(r'^proxyValidate/?$', ProxyValidateView.as_view(), name='cas_proxy_validate'),
    url(r'^proxy/?$', ProxyView.as_view(), name='cas_proxy'),
    url(r'^p3/serviceValidate/?$', ServiceValidateView.as_view(), name='cas_p3_service_validate'),
    url(r'^p3/proxyValidate/?$', ProxyValidateView.as_view(), name='cas_p3_proxy_validate'),
    url(r'^warn/?$', WarnView.as_view(), name='cas_warn'),
    url(r'^samlValidate/?$', SamlValidateView.as_view(), name='cas_saml_validate'),
]
Beispiel #12
0
from mama_cas.views import ServiceValidateView
from mama_cas.views import ProxyValidateView
from mama_cas.views import ProxyView
from mama_cas.views import WarnView
from mama_cas.views import SamlValidateView


urlpatterns = patterns('',
    url(r'^login/?$',
        LoginView.as_view(),
        name='cas_login'),
    url(r'^logout/?$',
        LogoutView.as_view(),
        name='cas_logout'),
    url(r'^validate/?$',
        ValidateView.as_view(),
        name='cas_validate'),
    url(r'^serviceValidate/?$',
        ServiceValidateView.as_view(),
        name='cas_service_validate'),
    url(r'^proxyValidate/?$',
        ProxyValidateView.as_view(),
        name='cas_proxy_validate'),
    url(r'^proxy/?$',
        ProxyView.as_view(),
        name='cas_proxy'),
    url(r'^warn/?$',
        WarnView.as_view(),
        name='cas_warn'),
    url(r'^samlValidate/?$',
        SamlValidateView.as_view(),
Beispiel #13
0
"""
URLconf for CAS server URIs as described in the CAS protocol.
"""

from django.conf.urls import patterns
from django.conf.urls import url

from mama_cas.views import LoginView
from mama_cas.views import LogoutView
from mama_cas.views import ValidateView
from mama_cas.views import ServiceValidateView
from mama_cas.views import ProxyValidateView
from mama_cas.views import ProxyView
from mama_cas.views import WarnView


urlpatterns = patterns(
    "",
    url(r"^login/?$", LoginView.as_view(), name="cas_login"),
    url(r"^logout/?$", LogoutView.as_view(), name="cas_logout"),
    url(r"^validate/?$", ValidateView.as_view(), name="cas_validate"),
    url(r"^serviceValidate/?$", ServiceValidateView.as_view(), name="cas_service_validate"),
    url(r"^proxyValidate/?$", ProxyValidateView.as_view(), name="cas_proxy_validate"),
    url(r"^proxy/?$", ProxyView.as_view(), name="cas_proxy"),
    url(r"^warn/?$", WarnView.as_view(), name="cas_warn"),
)