Add serviceValidate ProxyTicket tests
This commit is contained in:
parent
5f5f3595c8
commit
9bae371199
@ -1112,7 +1112,9 @@ class ValidateServiceTestCase(TestCase, XmlContent):
|
|||||||
name="localhost",
|
name="localhost",
|
||||||
pattern="^https?://127\.0\.0\.1(:[0-9]+)?(/.*)?$",
|
pattern="^https?://127\.0\.0\.1(:[0-9]+)?(/.*)?$",
|
||||||
# allow to request PGT by the service
|
# allow to request PGT by the service
|
||||||
proxy_callback=True
|
proxy_callback=True,
|
||||||
|
# allow to request PT for the service
|
||||||
|
proxy=True
|
||||||
)
|
)
|
||||||
# tell the service pattern to transmit all the user attributes (* is a joker)
|
# tell the service pattern to transmit all the user attributes (* is a joker)
|
||||||
models.ReplaceAttributName.objects.create(name="*", service_pattern=self.service_pattern)
|
models.ReplaceAttributName.objects.create(name="*", service_pattern=self.service_pattern)
|
||||||
@ -1190,6 +1192,25 @@ class ValidateServiceTestCase(TestCase, XmlContent):
|
|||||||
# the attributes settings.CAS_TEST_ATTRIBUTES
|
# the attributes settings.CAS_TEST_ATTRIBUTES
|
||||||
self.assert_success(response, settings.CAS_TEST_USER, settings.CAS_TEST_ATTRIBUTES)
|
self.assert_success(response, settings.CAS_TEST_USER, settings.CAS_TEST_ATTRIBUTES)
|
||||||
|
|
||||||
|
def test_validate_proxy(self):
|
||||||
|
ticket = get_proxy_ticket(self.service)
|
||||||
|
client = Client()
|
||||||
|
# requesting validation with a good (ticket, service)
|
||||||
|
response = client.get('/proxyValidate', {'ticket': ticket.value, 'service': self.service})
|
||||||
|
# and it should succeed
|
||||||
|
self.assert_success(response, settings.CAS_TEST_USER, settings.CAS_TEST_ATTRIBUTES)
|
||||||
|
|
||||||
|
ticket = get_proxy_ticket(self.service)
|
||||||
|
client = Client()
|
||||||
|
# requesting validation with a good (ticket, service)
|
||||||
|
response = client.get('/serviceValidate', {'ticket': ticket.value, 'service': self.service})
|
||||||
|
# and it should succeed
|
||||||
|
self.assert_error(
|
||||||
|
response,
|
||||||
|
"INVALID_TICKET",
|
||||||
|
ticket.value
|
||||||
|
)
|
||||||
|
|
||||||
def test_validate_service_renew(self):
|
def test_validate_service_renew(self):
|
||||||
"""test with a valid (ticket, service) asking for auth renewal"""
|
"""test with a valid (ticket, service) asking for auth renewal"""
|
||||||
# case 1 client is renewing and service ask for renew
|
# case 1 client is renewing and service ask for renew
|
||||||
|
Loading…
Reference in New Issue
Block a user