in ec2stack/controllers/default.py [0:0]
def remove_secret_key():
"""
Remove a user's API key and secret key
@return: Response.
@raise Ec2stackError: API key doesn't exist.
"""
require_parameters({'AWSAccessKeyId', 'AWSSecretKey'})
accesskey = get('AWSAccessKeyId')
secretkey = get('AWSSecretKey')
found_user = USERS.get(accesskey)
if found_user is not None and found_user.secretkey == secretkey:
USERS.delete(found_user)
return {
'template_name_or_list': 'secretkey.xml',
'response_type': 'RemoveSecretKeyResponse',
'AWSAccessKeyId': get('AWSAccessKeyId'),
'AWSSecretKey': get('AWSSecretKey'),
'Message': 'Successfully removed!'
}
else:
raise Ec2stackError(
'400',
'NoSuchUser',
'The no matching AWSAccessKeyId and AWSSecretKey was not found'
)