Skip to content

Commit

Permalink
rest put firmware: unknown plugin fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Oct 19, 2023
1 parent 6cb9354 commit 754b58f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/web_interface/rest/rest_firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ def put(self):
except MarshallingError as error:
logging.error(f'REST|firmware|PUT: Error in payload data: {error}')
return error_message(str(error), self.URL)

available_plugins = set(self.intercom.get_available_analysis_plugins()) - {'unpacker'}
unavailable_plugins = set(data['requested_analysis_systems']) - available_plugins
if unavailable_plugins:
return error_message(
f'The requested analysis plugins are not available: {", ".join(unavailable_plugins)}',
self.URL,
request_data={k: v for k, v in data.items() if k != 'binary'}, # don't send the firmware binary back
)

result = self._process_data(data)
if 'error_message' in result:
logging.warning('Submission not according to API guidelines! (data could not be parsed)')
Expand Down

0 comments on commit 754b58f

Please sign in to comment.