mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Don’t do multiple get API calls when revoking
It’s redundant to make two API calls here, one to get all keys and one to get a single key. Since the API calls are sequential we can speed things up by getting the one key from the list of all keys.
This commit is contained in:
@@ -10,11 +10,8 @@ class ApiKeyApiClient(NotifyAdminAPIClient):
|
||||
def __init__(self):
|
||||
super().__init__("a" * 73, "b")
|
||||
|
||||
def get_api_keys(self, service_id, key_id=None):
|
||||
if key_id:
|
||||
return self.get(url='/service/{}/api-keys/{}'.format(service_id, key_id))
|
||||
else:
|
||||
return self.get(url='/service/{}/api-keys'.format(service_id))
|
||||
def get_api_keys(self, service_id):
|
||||
return self.get(url='/service/{}/api-keys'.format(service_id))
|
||||
|
||||
def create_api_key(self, service_id, key_name, key_type):
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user