595
595
headers={'X-Subject-Token': token},
596
596
expected_status=204)
598
def test_disabling_project_revokes_token(self):
601
body=self.build_authentication_request(
602
user_id=self.user3['id'],
603
password=self.user3['password'],
604
project_id=self.projectA['id']))
605
token = resp.getheader('X-Subject-Token')
607
# confirm token is valid
608
self.head('/auth/tokens',
609
headers={'X-Subject-Token': token},
612
# disable the project, which should invalidate the token
614
'/projects/%(project_id)s' % {'project_id': self.projectA['id']},
615
body={'project': {'enabled': False}})
617
# user should no longer have access to the project
618
self.head('/auth/tokens',
619
headers={'X-Subject-Token': token},
623
body=self.build_authentication_request(
624
user_id=self.user3['id'],
625
password=self.user3['password'],
626
project_id=self.projectA['id']),
629
def test_deleting_project_revokes_token(self):
632
body=self.build_authentication_request(
633
user_id=self.user3['id'],
634
password=self.user3['password'],
635
project_id=self.projectA['id']))
636
token = resp.getheader('X-Subject-Token')
638
# confirm token is valid
639
self.head('/auth/tokens',
640
headers={'X-Subject-Token': token},
643
# delete the project, which should invalidate the token
645
'/projects/%(project_id)s' % {'project_id': self.projectA['id']})
647
# user should no longer have access to the project
648
self.head('/auth/tokens',
649
headers={'X-Subject-Token': token},
653
body=self.build_authentication_request(
654
user_id=self.user3['id'],
655
password=self.user3['password'],
656
project_id=self.projectA['id']),
598
659
def test_deleting_group_grant_revokes_tokens(self):
599
660
"""Test deleting a group grant revokes tokens.