Merge "Do not require the token_id for converting v3 to v2 tokens"
This commit is contained in:
commit
5839ffa238
|
@ -37,13 +37,12 @@ CONF = cfg.CONF
|
|||
class V2TokenDataHelper(object):
|
||||
"""Creates V2 token data."""
|
||||
|
||||
def v3_to_v2_token(self, token_id, v3_token_data):
|
||||
def v3_to_v2_token(self, v3_token_data):
|
||||
token_data = {}
|
||||
# Build v2 token
|
||||
v3_token = v3_token_data['token']
|
||||
|
||||
token = {}
|
||||
token['id'] = token_id
|
||||
token['expires'] = v3_token.get('expires_at')
|
||||
token['issued_at'] = v3_token.get('issued_at')
|
||||
token['audit_ids'] = v3_token.get('audit_ids')
|
||||
|
|
|
@ -94,8 +94,8 @@ class Provider(common.BaseProvider):
|
|||
project_id=project_id)
|
||||
self._build_issued_at_info(token_id, v3_token_data)
|
||||
# Convert v3 to v2 token data and build v2 catalog
|
||||
token_data = self.v2_token_data_helper.v3_to_v2_token(token_id,
|
||||
v3_token_data)
|
||||
token_data = self.v2_token_data_helper.v3_to_v2_token(v3_token_data)
|
||||
token_data['access']['token']['id'] = token_id
|
||||
|
||||
return token_id, token_data
|
||||
|
||||
|
@ -196,8 +196,9 @@ class Provider(common.BaseProvider):
|
|||
token=token_ref,
|
||||
include_catalog=False,
|
||||
audit_info=audit_ids)
|
||||
return self.v2_token_data_helper.v3_to_v2_token(token_ref,
|
||||
v3_token_data)
|
||||
token_data = self.v2_token_data_helper.v3_to_v2_token(v3_token_data)
|
||||
token_data['access']['token']['id'] = token_ref
|
||||
return token_data
|
||||
|
||||
def validate_v3_token(self, token):
|
||||
"""Validate a V3 formatted token.
|
||||
|
|
Loading…
Reference in New Issue