Fix ApiGateway key identification

API Gateway keys are identified by their ids and not their values

- https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-api-key.html#examples
- http://boto3.readthedocs.io/en/latest/reference/services/apigateway.html#APIGateway.Client.get_api_key
This commit is contained in:
Mohamed El Mouctar HAIDARA 2018-03-30 15:09:02 +02:00
commit dcd290c3c3
2 changed files with 9 additions and 9 deletions

View file

@ -563,17 +563,17 @@ class APIGatewayBackend(BaseBackend):
def create_apikey(self, payload):
key = ApiKey(**payload)
self.keys[key['value']] = key
self.keys[key['id']] = key
return key
def get_apikeys(self):
return list(self.keys.values())
def get_apikey(self, value):
return self.keys[value]
def get_apikey(self, api_key_id):
return self.keys[api_key_id]
def delete_apikey(self, value):
self.keys.pop(value)
def delete_apikey(self, api_key_id):
self.keys.pop(api_key_id)
return {}