当前位置: 首页>>代码示例>>Python>>正文


Python views.ProxyValidateView类代码示例

本文整理汇总了Python中mama_cas.views.ProxyValidateView的典型用法代码示例。如果您正苦于以下问题:Python ProxyValidateView类的具体用法?Python ProxyValidateView怎么用?Python ProxyValidateView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ProxyValidateView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_proxy_validate_view_invalid_service_url

 def test_proxy_validate_view_invalid_service_url(self):
     """
     When ``MAMA_CAS_VALID_SERVICES`` is defined, a validation
     failure should be returned if the service URL does not match.
     """
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': self.pt.ticket})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'INVALID_SERVICE')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:8,代码来源:test_views.py

示例2: test_proxy_validate_view_invalid_service

 def test_proxy_validate_view_invalid_service(self):
     """
     When called with an invalid service identifier, a validation
     failure should be returned.
     """
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url2, 'ticket': self.pt.ticket})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'INVALID_SERVICE')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:8,代码来源:test_views.py

示例3: test_proxy_validate_view

 def test_proxy_validate_view(self):
     """
     When called with no parameters, a validation failure should
     be returned.
     """
     request = self.rf.get(reverse('cas_proxy_validate'))
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'INVALID_REQUEST')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:8,代码来源:test_views.py

示例4: test_proxy_validate_view_user_attributes

 def test_proxy_validate_view_user_attributes(self):
     """
     When ``MAMA_CAS_USER_ATTRIBUTES`` is defined, the validation
     success should include the custom attribute block.
     """
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': self.pt.ticket})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'attributes')
开发者ID:kajigga,项目名称:django-mama-cas,代码行数:8,代码来源:test_views.py

示例5: test_proxy_validate_view_pgturl_http

 def test_proxy_validate_view_pgturl_http(self):
     """
     When called with valid parameters and an invalid ``pgtUrl``,
     the validation success should have no ``ProxyGrantingTicket``.
     """
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': self.pt.ticket, 'pgtUrl': self.url})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'authenticationSuccess')
     self.assertNotContains(response, 'proxyGrantingTicket')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:9,代码来源:test_views.py

示例6: test_proxy_validate_view_invalid_ticket

 def test_proxy_validate_view_invalid_ticket(self):
     """
     When the provided ticket cannot be found, a validation
     failure should be returned.
     """
     pt_str = ProxyTicket.objects.create_ticket_str()
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': pt_str})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'INVALID_TICKET')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:9,代码来源:test_views.py

示例7: test_proxy_validate_view_pgturl

 def test_proxy_validate_view_pgturl(self):
     """
     When called with valid parameters and a ``pgtUrl``, a
     validation success should include a ``ProxyGrantingTicket``.
     """
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': self.pt.ticket, 'pgtUrl': self.url2})
     with patch('requests.get') as mock:
         mock.return_value.status_code = 200
         response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'authenticationSuccess')
     self.assertContains(response, 'proxyGrantingTicket')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:11,代码来源:test_views.py

示例8: test_proxy_validate_view_pt_success

    def test_proxy_validate_view_pt_success(self):
        """
        When called with a valid ``ProxyTicket``, a validation success
        should be returned. The provided ticket should be consumed.
        """
        request = self.rf.get(reverse('cas_proxy_validate'), {'service': self.url, 'ticket': self.pt.ticket})
        response = ProxyValidateView.as_view()(request)
        self.assertContains(response, 'authenticationSuccess')
        self.assertEqual(response.get('Content-Type'), 'text/xml')

        pt = ProxyTicket.objects.get(ticket=self.pt.ticket)
        self.assertTrue(pt.is_consumed())
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:12,代码来源:test_views.py

示例9: test_proxy_validate_view_proxies

 def test_proxy_validate_view_proxies(self):
     """
     A validation success should include a ``proxies`` block
     containing all the proxies involved.
     """
     pgt2 = ProxyGrantingTicketFactory(granted_by_pt=self.pt,
                                       granted_by_st=None)
     pt2 = ProxyTicketFactory(service='http://ww2.example.com',
                              granted_by_pgt=pgt2)
     request = self.rf.get(reverse('cas_proxy_validate'), {'service': pt2.service, 'ticket': pt2.ticket})
     response = ProxyValidateView.as_view()(request)
     self.assertContains(response, 'authenticationSuccess')
     self.assertContains(response, 'http://ww2.example.com')
     self.assertContains(response, 'http://www.example.com')
开发者ID:alvinyao,项目名称:django-mama-cas,代码行数:14,代码来源:test_views.py

示例10: patterns

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(),
        name='cas_p3_proxy_validate'),
    url(r'^warn/?$',
        WarnView.as_view(),
        name='cas_warn'),
    url(r'^samlValidate/?$',
        SamlValidateView.as_view(),
开发者ID:davinirjr,项目名称:django-mama-cas,代码行数:30,代码来源:urls.py

示例11: url

"""
(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'),
]
开发者ID:adiletmaratov,项目名称:django-mama-cas,代码行数:28,代码来源:urls.py

示例12: patterns

"""
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"),
)
开发者ID:bryankaplan,项目名称:django-mama-cas,代码行数:26,代码来源:urls.py


注:本文中的mama_cas.views.ProxyValidateView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。