fix cognito-idp UserPool ClientId (#3165)
* fix cognito-idp UserPool ClientId * add test * replace uuid4 to create_id
This commit is contained in:
parent
bf8eb11dc3
commit
448ff45174
3 changed files with 18 additions and 6 deletions
|
|
@ -23,6 +23,7 @@ from .exceptions import (
|
|||
UsernameExistsException,
|
||||
InvalidParameterException,
|
||||
)
|
||||
from .utils import create_id
|
||||
|
||||
UserStatus = {
|
||||
"FORCE_CHANGE_PASSWORD": "FORCE_CHANGE_PASSWORD",
|
||||
|
|
@ -214,7 +215,7 @@ class CognitoIdpUserPoolDomain(BaseModel):
|
|||
class CognitoIdpUserPoolClient(BaseModel):
|
||||
def __init__(self, user_pool_id, generate_secret, extended_config):
|
||||
self.user_pool_id = user_pool_id
|
||||
self.id = str(uuid.uuid4())
|
||||
self.id = create_id()
|
||||
self.secret = str(uuid.uuid4())
|
||||
self.generate_secret = generate_secret or False
|
||||
self.extended_config = extended_config or {}
|
||||
|
|
|
|||
10
moto/cognitoidp/utils.py
Normal file
10
moto/cognitoidp/utils.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
import six
|
||||
import random
|
||||
import string
|
||||
|
||||
|
||||
def create_id():
|
||||
size = 26
|
||||
chars = list(range(10)) + list(string.ascii_lowercase)
|
||||
return "".join(six.text_type(random.choice(chars)) for x in range(size))
|
||||
Loading…
Add table
Add a link
Reference in a new issue