ambitus / pyracf

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

Bug Report: Resource Profile Extract Auditing Issues #40

Closed ElijahSwiftIBM closed 8 months ago

ElijahSwiftIBM commented 10 months ago

Describe the bug When Resource Profiles are extracted, the Auditing trait is not correctly parsed, leading to invalid data in the dictionary.

To Reproduce Add or alter a resource such that it has multiple Auditing values such as: "SUCCESS(READ),FAILURES(UPDATE)" in the example, the result dictionary showed:

                "auditing": {
                  "success": "update"
                }

Expected behavior Result dictionary should show:

                "auditing": {
                  "success": "read",
                  "failures":"update"
                }

Console Output

                             [pyRACF:Debug]                                
                           Result Dictionary                               
                        ResourceAdmin.extract()                            

{ "securityResult": { "resource": { "name": "TSTRES2", "class": "ELIJTEST", "operation": "listdata", "requestId": "ResourceRequest", "commands": [ { "safReturnCode": 0, "returnCode": 0, "reasonCode": 0, "image": "RLIST ELIJTEST (TSTRES2) ", "messages": [ "CLASS NAME", "----- ----", "ELIJTEST TSTRES2", " ", "LEVEL OWNER UNIVERSAL ACCESS YOUR ACCESS WARNING", "----- -------- ---------------- ----------- -------", " 00 ESWIFT NONE NONE NO", " ", "INSTALLATION DATA", "-----------------", "NONE", " ", "APPLICATION DATA", "----------------", "NONE", " ", "AUDITING", "--------", "SUCCESS(READ),FAILURES(UPDATE)", " ", "NOTIFY", "------", "NO USER TO BE NOTIFIED" ] } ] }, "returnCode": 0, "reasonCode": 0 } }

                             [pyRACF:Debug]                                
                 Result Dictionary (Formatted Profile)                     
                        ResourceAdmin.extract()                            

{ "securityResult": { "resource": { "name": "TSTRES2", "class": "ELIJTEST", "operation": "listdata", "requestId": "ResourceRequest", "commands": [ { "safReturnCode": 0, "returnCode": 0, "reasonCode": 0, "image": "RLIST ELIJTEST (TSTRES2) ", "profiles": [ { "base": { "class": "elijtest", "name": "tstres2", "level": 0, "owner": "eswift", "universalAccess": null, "yourAccess": null, "warning": null, "installationData": null, "applicationData": null, "auditing": { "success": "update" }, "notify": null, "generic": false } } ] } ] }, "returnCode": 0, "reasonCode": 0 } }

ElijahSwiftIBM commented 8 months ago

Merged. into 1.0b4 as a part of #51