def test_proxy_view_success(self): """ When called with valid parameters, a validation success should be returned. """ request = self.rf.get(reverse('cas_proxy'), {'targetService': self.url, 'pgt': self.pgt.ticket}) response = ProxyView.as_view()(request) self.assertContains(response, 'proxyTicket')
def test_proxy_view_invalid_service_url(self): """ When called with an invalid service identifier, a proxy authentication failure should be returned. """ request = self.rf.get(reverse('cas_proxy'), {'targetService': self.url2, 'pgt': self.pgt.ticket}) response = ProxyView.as_view()(request) self.assertContains(response, 'INVALID_SERVICE')
def test_proxy_view_no_service(self): """ When called with no service identifier, a validation failure should be returned. """ request = self.rf.get(reverse('cas_proxy'), {'pgt': self.pgt.ticket}) response = ProxyView.as_view()(request) self.assertContains(response, 'INVALID_REQUEST')
def test_proxy_view(self): """ When called with no parameters, a validation failure should be returned. """ request = self.rf.get(reverse('cas_proxy')) response = ProxyView.as_view()(request) self.assertContains(response, 'INVALID_REQUEST')
def test_proxy_view_invalid_ticket(self): """ When the provided ticket cannot be found, a validation failure should be returned. """ pgt_str = ProxyTicket.objects.create_ticket_str() request = self.rf.get(reverse('cas_proxy'), {'targetService': self.url, 'pgt': pgt_str}) response = ProxyView.as_view()(request) self.assertContains(response, 'BAD_PGT')
def test_proxy_view_invalid_ticket(self): """ When the provided ticket cannot be found, a validation failure should be returned. """ pgt_str = ProxyTicket.objects.create_ticket_str() request = self.rf.get(reverse('cas_proxy'), { 'targetService': self.url, 'pgt': pgt_str }) response = ProxyView.as_view()(request) self.assertContains(response, 'BAD_PGT')
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'), ]
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'), )
""" (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'), ]
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(), name='cas_saml_validate'), )
""" 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"), )