Modernize API Security python library

Problem

The design of the python library for API Security (a wrapper around rest api calls), has several downsides:

  1. Instead of raising exceptions the library forcefully exists the running program with sys.exit(-1).
  2. The library was implemented as a series of methods not associated with a class. This leads to the use of global variables to manage state.
  3. Library cannot be used with dependency injection due to design

Proposal

  1. Refactor library to use a class with class methods.
  2. Move state management into the class itself.
  3. Use defined exception classes instead of forcefully exiting the process.
  4. Instead of directly configuring logging, instead just register a new logger and rely on the caller to initialize the logging library.
  5. Review log messages and look for places they can be improved or left to the caller. For example, on error raise an exception instead of logging detailed information.
  6. Update unit tests
  7. Update consumers of python library to use new design
  8. Release new container