Remove the _is_v2 and _is_v3 helpers
We've finally got to the point where tokens are abstracted to the point where we don't actually need to test by content what version of token it is. Rejoice and remove the helpers. Change-Id: Ia968ea68a9731c2a8f6a120acf697b30a2fcef8b
This commit is contained in:
parent
29709a4aaf
commit
23711a5d05
|
@ -285,14 +285,6 @@ class _BIND_MODE(object):
|
|||
KERBEROS = 'kerberos'
|
||||
|
||||
|
||||
def _token_is_v2(token_info):
|
||||
return ('access' in token_info)
|
||||
|
||||
|
||||
def _token_is_v3(token_info):
|
||||
return ('token' in token_info)
|
||||
|
||||
|
||||
def _uncompress_pkiz(token):
|
||||
# TypeError If the signed_text is not zlib compressed binascii.Error if
|
||||
# signed_text has incorrect base64 padding (py34)
|
||||
|
|
|
@ -442,26 +442,6 @@ class GeneralAuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
|
|||
|
||||
resources = [('examples', client_fixtures.EXAMPLES_RESOURCE)]
|
||||
|
||||
def test_token_is_v2_accepts_v2(self):
|
||||
token = self.examples.UUID_TOKEN_DEFAULT
|
||||
token_response = self.examples.TOKEN_RESPONSES[token]
|
||||
self.assertTrue(auth_token._token_is_v2(token_response))
|
||||
|
||||
def test_token_is_v2_rejects_v3(self):
|
||||
token = self.examples.v3_UUID_TOKEN_DEFAULT
|
||||
token_response = self.examples.TOKEN_RESPONSES[token]
|
||||
self.assertFalse(auth_token._token_is_v2(token_response))
|
||||
|
||||
def test_token_is_v3_rejects_v2(self):
|
||||
token = self.examples.UUID_TOKEN_DEFAULT
|
||||
token_response = self.examples.TOKEN_RESPONSES[token]
|
||||
self.assertFalse(auth_token._token_is_v3(token_response))
|
||||
|
||||
def test_token_is_v3_accepts_v3(self):
|
||||
token = self.examples.v3_UUID_TOKEN_DEFAULT
|
||||
token_response = self.examples.TOKEN_RESPONSES[token]
|
||||
self.assertTrue(auth_token._token_is_v3(token_response))
|
||||
|
||||
def test_fixed_cache_key_length(self):
|
||||
self.set_middleware()
|
||||
short_string = uuid.uuid4().hex
|
||||
|
|
Loading…
Reference in New Issue