ambitus / pyracf

Python interface to the RACF Command interface.
https://ambitus.github.io/pyracf/
Apache License 2.0
10 stars 4 forks source link

Robust error handling #26

Closed ElijahSwiftIBM closed 8 months ago

ElijahSwiftIBM commented 8 months ago

:bulb: Issue Reference

Issue: #12

:computer: What does this address?

Some of the functions of pyracf have a lot of functional overlap that can lead to issues, and there was very little input validation. Admin.Add functions could "alter" resource profiles that already existed and Admin.Alter functions could "add" new ones. This can lead to typos making changes to existing profiles or creating new ones that were unintentional.

:pager: Implementation Details

New error objects were created:

Additionally, I took this opportunity to pluralize Setropts Getters/Setters that were already capable of taking multiple classes as arguments and adjusting the type hints accordingly, as well as some other small name changes and bug fixes prior to beta release.

:clipboard: Is there a test case?

Testing suite was also updated. Testing of debug logging and secrets redaction were moved to ALTER functions rather than ADD as ADD lacks the consistent structure to test successes and failures with the new input validation and error cases. Each new error case is also tested. Additional testing was added to confirm pluralized Setropts functions work as now documented and referenced.