Use issued_at in fernet token provider
The rest of the token provider API uses issued_at for the creation time of a token. The fernet token provider referenced this value as created_at. This change makes the fernet provider use the same convention as the rest of the token provider API. Change-Id: I347e40252824a01e887a17ab591bd092e007aa2d
This commit is contained in:
parent
d1a761293a
commit
6e18511ef2
@ -787,7 +787,7 @@ class BaseProvider(provider.Provider):
|
||||
def validate_non_persistent_token(self, token_id):
|
||||
try:
|
||||
(user_id, methods, audit_ids, domain_id, project_id, trust_id,
|
||||
federated_info, access_token_id, created_at, expires_at) = (
|
||||
federated_info, access_token_id, issued_at, expires_at) = (
|
||||
self.token_formatter.validate_token(token_id))
|
||||
except exception.ValidationError as e:
|
||||
raise exception.TokenNotFound(e)
|
||||
@ -819,7 +819,7 @@ class BaseProvider(provider.Provider):
|
||||
method_names=methods,
|
||||
domain_id=domain_id,
|
||||
project_id=project_id,
|
||||
issued_at=created_at,
|
||||
issued_at=issued_at,
|
||||
expires=expires_at,
|
||||
trust=trust_ref,
|
||||
token=token_dict,
|
||||
|
@ -144,9 +144,9 @@ class TokenFormatter(object):
|
||||
timestamp_int = struct.unpack(">Q", timestamp_bytes)[0]
|
||||
|
||||
# and with an integer, it's trivial to produce a datetime object
|
||||
created_at = datetime.datetime.utcfromtimestamp(timestamp_int)
|
||||
issued_at = datetime.datetime.utcfromtimestamp(timestamp_int)
|
||||
|
||||
return created_at
|
||||
return issued_at
|
||||
|
||||
def create_token(self, user_id, expires_at, audit_ids, methods=None,
|
||||
domain_id=None, project_id=None, trust_id=None,
|
||||
@ -206,13 +206,13 @@ class TokenFormatter(object):
|
||||
|
||||
# rather than appearing in the payload, the creation time is encoded
|
||||
# into the token format itself
|
||||
created_at = TokenFormatter.creation_time(token)
|
||||
created_at = ks_utils.isotime(at=created_at, subsecond=True)
|
||||
issued_at = TokenFormatter.creation_time(token)
|
||||
issued_at = ks_utils.isotime(at=issued_at, subsecond=True)
|
||||
expires_at = timeutils.parse_isotime(expires_at)
|
||||
expires_at = ks_utils.isotime(at=expires_at, subsecond=True)
|
||||
|
||||
return (user_id, methods, audit_ids, domain_id, project_id, trust_id,
|
||||
federated_info, access_token_id, created_at, expires_at)
|
||||
federated_info, access_token_id, issued_at, expires_at)
|
||||
|
||||
|
||||
class BasePayload(object):
|
||||
|
Loading…
Reference in New Issue
Block a user