uktrade / enquiry-mgmt-tool

Enquiry management tool supporting the Ready to Trade campaign
https://uktrade.github.io/enquiry-mgmt-tool/
MIT License
1 stars 2 forks source link

Fix 403 error by using the existing, custom, HawkAuth class #1000

Closed oliverjwroberts closed 3 months ago

oliverjwroberts commented 3 months ago

Description of change

The addition of the payload to the GET request within fetch_metadata() was causing the API to return a 403 error. However, removing the payload caused an exception from the requests_hawk package, requiring a payload when always_hash_content=True. Instead, we were able to resolve the issue by using the custom HawkAuth class, which is also used elsewhere in the EMT application.

Test instructions

You should now be able to successfully submit an enquiry from EMT to DataHub.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.68%. Comparing base (9c5e372) to head (fa394e9). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1000 +/- ## ======================================= Coverage 68.68% 68.68% ======================================= Files 61 61 Lines 2034 2034 ======================================= Hits 1397 1397 Misses 637 637 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.