ONSdigital / dp-python-tools

Simple reusable python resources for digital publishing.
MIT License
1 stars 0 forks source link

887 restructure http #45

Closed Moasib-Arif closed 3 months ago

Moasib-Arif commented 3 months ago

What

Restructured the flat file for http client and upload service client.

  1. Create a Base Upload Client: I Moved common functionality for handling file uploads to a new base class (BaseUploadClient). This class will be the parent class for the upload service client.
  2. Token Authentication: I created a new file for managing token authentication logic, including obtaining and refreshing tokens.
  3. Utility Functions: Create a new file for utility functions such as handling file chunking and parameter generation.
  4. Upload Service Client: Modify the upload service cliento inherit from the BaseUploadClient and token authentication

This restructuring will make it easier to add new upload endpoints in the future and improve the maintainability of the code.

How to review

Run all Tests: Type Make test in the terminal. Sanity check - Check all the logic is correct and if this is the right approach Any Suggestions for further improvement

Who can review

Anyone