AssumeRole returns randomly generated credentials.
This commit is contained in:
parent
48f0c6f194
commit
ab0d23a0ba
4 changed files with 37 additions and 8 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import unicode_literals
|
|||
import datetime
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
from moto.core.utils import iso_8601_datetime_with_milliseconds
|
||||
from moto.sts.utils import random_access_key_id, random_secret_access_key, random_session_token
|
||||
|
||||
|
||||
class Token(BaseModel):
|
||||
|
|
@ -26,6 +27,9 @@ class AssumedRole(BaseModel):
|
|||
now = datetime.datetime.utcnow()
|
||||
self.expiration = now + datetime.timedelta(seconds=duration)
|
||||
self.external_id = external_id
|
||||
self.access_key_id = "ASIA" + random_access_key_id()
|
||||
self.secret_access_key = random_secret_access_key()
|
||||
self.session_token = random_session_token()
|
||||
|
||||
@property
|
||||
def expiration_ISO8601(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue