Skip to content

Commit

Permalink
CognitoIdentity: get_credentials_for_identity() should have Expiratio…
Browse files Browse the repository at this point in the history
…n as number. (getmoto#7059)
  • Loading branch information
nonchan7720 authored Nov 23, 2023
1 parent 3d5929f commit 843c906
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions moto/cognitoidentity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import OrderedDict
from typing import Any, Dict, List, Optional
from moto.core import BaseBackend, BackendDict, BaseModel
from moto.core.utils import iso_8601_datetime_with_milliseconds, utcnow
from moto.core.utils import utcnow
from .exceptions import InvalidNameException, ResourceNotFoundError
from .utils import get_random_identity_id

Expand Down Expand Up @@ -139,12 +139,11 @@ def get_credentials_for_identity(self, identity_id: str) -> str:
duration = 90
now = utcnow()
expiration = now + datetime.timedelta(seconds=duration)
expiration_str = str(iso_8601_datetime_with_milliseconds(expiration))
return json.dumps(
{
"Credentials": {
"AccessKeyId": "TESTACCESSKEY12345",
"Expiration": expiration_str,
"Expiration": expiration.timestamp(),
"SecretKey": "ABCSECRETKEY",
"SessionToken": "ABC12345",
},
Expand Down

0 comments on commit 843c906

Please sign in to comment.