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 #1001

Closed oliverjwroberts closed 1 month ago

oliverjwroberts commented 1 month 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 1 month ago

Codecov Report

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

Project coverage is 68.68%. Comparing base (b4757ef) to head (95d407b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1001 +/- ## ======================================= 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.