Merge pull request #1862 from dcosson/cognito_identity_fixes
Fixes for cognito identity library
This commit is contained in:
commit
fb5654a5dc
3 changed files with 19 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
from moto.core.responses import BaseResponse
|
||||
|
||||
from .models import cognitoidentity_backends
|
||||
from .utils import get_random_identity_id
|
||||
|
||||
|
||||
class CognitoIdentityResponse(BaseResponse):
|
||||
|
|
@ -31,4 +32,6 @@ class CognitoIdentityResponse(BaseResponse):
|
|||
return cognitoidentity_backends[self.region].get_credentials_for_identity(self._get_param('IdentityId'))
|
||||
|
||||
def get_open_id_token_for_developer_identity(self):
|
||||
return cognitoidentity_backends[self.region].get_open_id_token_for_developer_identity(self._get_param('IdentityId'))
|
||||
return cognitoidentity_backends[self.region].get_open_id_token_for_developer_identity(
|
||||
self._get_param('IdentityId') or get_random_identity_id(self.region)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from moto.core.utils import get_random_hex
|
|||
|
||||
|
||||
def get_random_identity_id(region):
|
||||
return "{0}:{0}".format(region, get_random_hex(length=19))
|
||||
return "{0}:{1}".format(region, get_random_hex(length=19))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue