APIGateway - Generate API key value when no value provided (#1713)
This commit is contained in:
parent
c3b690114c
commit
c20e8568e0
2 changed files with 2 additions and 6 deletions
|
|
@ -300,11 +300,7 @@ class ApiKey(BaseModel, dict):
|
|||
generateDistinctId=False, value=None, stageKeys=None, customerId=None):
|
||||
super(ApiKey, self).__init__()
|
||||
self['id'] = create_id()
|
||||
if generateDistinctId:
|
||||
# Best guess of what AWS does internally
|
||||
self['value'] = ''.join(random.sample(string.ascii_letters + string.digits, 40))
|
||||
else:
|
||||
self['value'] = value
|
||||
self['value'] = value if value else ''.join(random.sample(string.ascii_letters + string.digits, 40))
|
||||
self['name'] = name
|
||||
self['customerId'] = customerId
|
||||
self['description'] = description
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue