parkpow / deep-license-plate-recognition

Automatic License Plate Recognition (ALPR) or Automatic Number Plate Recognition (ANPR) software that works with any camera.
https://platerecognizer.com/
MIT License
523 stars 122 forks source link

Fix/middleware #215

Closed AashishDhakal closed 5 days ago

github-actions[bot] commented 1 week ago

Risk Level 2 - /home/runner/work/deep-license-plate-recognition/deep-license-plate-recognition/webhooks/middleware/protocols/openeye.py

The code is not handling the case where the 'plate' key might not exist in the nested dictionary, which could lead to a KeyError. Use .get() with a default value to avoid this issue.


Risk Level 2 - /home/runner/work/deep-license-plate-recognition/deep-license-plate-recognition/webhooks/middleware/protocols/soap.py

The code is not handling the case where the 'plate' key might not exist in the nested dictionary, which could lead to a KeyError. Use .get() with a default value to avoid this issue. Additionally, the presence of service_key in the code suggests that a sensitive key might be exposed. Ensure that no sensitive keys are hardcoded or logged.


Risk Level 3 - /home/runner/work/deep-license-plate-recognition/deep-license-plate-recognition/webhooks/middleware/protocols/nx.py

The process_request function is directly accessing nested keys which may not exist and could raise a KeyError. It's recommended to use .get() method with a default value for safer access. Additionally, the plate extraction logic is duplicated across multiple files; consider creating a utility function for reuse.


🔑🐍🔁


Powered by Code Review GPT

AashishDhakal commented 1 week ago

@ttayson Are you sure about the fields?

I see a different structure here:

Screenshot 2024-10-09 at 08 20 51

ttayson commented 6 days ago

@AashishDhakal Visually it seems correct, but if you add the code to a JSON formatting tool, you can verify it. We may also need to update the guide with better formatting.

image

marcbelmont commented 5 days ago

@dibonjohnseron Please merge if you're also good with this.

dibonjohnseron commented 5 days ago

All good to me as well.