Example #1
0
 def test_no_hash(self):
     """Test the error code 400 is sent if the sig field is not provided"""
     with app.test_request_context('/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
                                   'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&',
                                   method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #2
0
 def test_no_hash(self):
     """Test the error code 400 is sent if the sig field is not provided"""
     with app.test_request_context(
             '/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
             'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&',
             method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #3
0
 def test_no_payload(self):
     """Test the error code 400 is sent if the sso field is not provided"""
     with app.test_request_context('/sso/login?sig=2828aa29899722b35a2f191'
                                   'd34ef9b3ce695e0e6eeec47deb46d588d70c7c'
                                   'b56',
                                   method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #4
0
 def test_no_payload(self):
     """Test the error code 400 is sent if the sso field is not provided"""
     with app.test_request_context(
             '/sso/login?sig=2828aa29899722b35a2f191'
             'd34ef9b3ce695e0e6eeec47deb46d588d70c7c'
             'b56',
             method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #5
0
 def test_bad_payload_sig(self):
     """Test the error code 400 is sent if the signature do not match
     the payload
     """
     with app.test_request_context('/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
                                   'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&'
                                   'sig=2828aa29899722b35a2f191d34ef9b3ce'
                                   '695e0e6eeec47deb46d588d70c7cb58',
                                   method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #6
0
 def test_bad_payload_sig(self):
     """Test the error code 400 is sent if the signature do not match
     the payload
     """
     with app.test_request_context(
             '/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
             'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&'
             'sig=2828aa29899722b35a2f191d34ef9b3ce'
             '695e0e6eeec47deb46d588d70c7cb58',
             method='GET'):
         with pytest.raises(BadRequest):
             sso.payload_check()
Example #7
0
 def test_payload_check(self):
     """Test the payload is properly managed and the user is sent to the
     authentication page
     """
     with app.test_request_context('/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
                                   'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&'
                                   'sig=2828aa29899722b35a2f191d34ef9b3ce'
                                   '695e0e6eeec47deb46d588d70c7cb56',
                                   method='GET'):
         res = sso.payload_check()
         assert res.status_code == 302
         assert urlparse(res.location).path == url_for('user_authz')
Example #8
0
 def test_payload_check(self):
     """Test the payload is properly managed and the user is sent to the
     authentication page
     """
     with app.test_request_context(
             '/sso/login?sso=bm9uY2U9Y2I2ODI1MWVlZm'
             'I1MjExZTU4YzAwZmYxMzk1ZjBjMGI%3D%0A&'
             'sig=2828aa29899722b35a2f191d34ef9b3ce'
             '695e0e6eeec47deb46d588d70c7cb56',
             method='GET'):
         res = sso.payload_check()
         assert res.status_code == 302
         assert urlparse(res.location).path == url_for('user_authz')