diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-11 14:13:28 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-11 14:13:28 +0000 |
commit | caab11d405c6f71aac4e8227c3298a9b15fc2748 (patch) | |
tree | 06bda10107cc167b46127c3beb432655c05f4b89 /tests/test_v3_auth.py | |
parent | 1ef4749963012c31a21169c808b2d71b71a4c0d3 (diff) | |
parent | 806a2caa5ba825f5e2c1e91eb5a18029b3b5f76d (diff) | |
download | keystone-caab11d405c6f71aac4e8227c3298a9b15fc2748.tar.gz keystone-caab11d405c6f71aac4e8227c3298a9b15fc2748.tar.xz keystone-caab11d405c6f71aac4e8227c3298a9b15fc2748.zip |
Merge "bug 1133526"
Diffstat (limited to 'tests/test_v3_auth.py')
-rw-r--r-- | tests/test_v3_auth.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_v3_auth.py b/tests/test_v3_auth.py index f2909753..e8c5e9be 100644 --- a/tests/test_v3_auth.py +++ b/tests/test_v3_auth.py @@ -12,10 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. +import json +import nose.exc import uuid -import nose.exc +from keystone.common import cms from keystone import auth from keystone import config from keystone import exception @@ -161,6 +163,20 @@ class TestTokenAPIs(test_v3.RestfulTestCase): def test_default_fixture_scope_token(self): self.assertIsNotNone(self.get_scoped_token()) + def test_v3_pki_token_id(self): + self.opt_in_group('signing', token_format='PKI') + auth_data = _build_authentication_request( + user_id=self.user['id'], + password=self.user['password']) + resp = self.post('/auth/tokens', body=auth_data) + token_data = resp.body + token_id = resp.getheader('X-Subject-Token') + self.assertIn('expires_at', token_data['token']) + token_signed = cms.cms_sign_token(json.dumps(token_data), + CONF.signing.certfile, + CONF.signing.keyfile) + self.assertEqual(token_signed, token_id) + def test_v3_v2_uuid_token_intermix(self): # FIXME(gyee): PKI tokens are not interchangeable because token # data is baked into the token itself. |