[Bug 42035] New: Add diff support to APIKEYS CREATE and DELETE action logs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 Bug ID: 42035 Summary: Add diff support to APIKEYS CREATE and DELETE action logs Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Transaction logs Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Blocks: 37940 The action logging for the APIKEYS module (Koha/ApiKey.pm) already has diff support for MODIFY, REVOKE, and ACTIVATE actions. However, CREATE and DELETE actions do not pass the $original parameter. Affected calls in Koha/ApiKey.pm: - APIKEYS/CREATE (~line 84): logaction( 'APIKEYS', 'CREATE', $self->patron_id, $self, undef ); (passes $self as $infos but no $original; for CREATE, $self represents the new state) - APIKEYS/DELETE (~line 142): logaction( 'APIKEYS', 'DELETE', $patron_id ) (no info or original passed at all) For CREATE, passing $self as both $infos and $original (or with undef original) would allow the viewer to show what was created. For DELETE, the API key object should be fetched before deletion and passed as both $infos and $original so the log shows what was deleted. This is important for security audit trails. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37940 [Bug 37940] [OMNIBUS] All modification logged via action logs should include original to create JSON diff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olivia.reynolds@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |Open Fifth list of Sponsors| | Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 202544 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202544&action=edit Bug 42035: Add diffs to apikey CREATE/DELETE logs This patch passes in the created/deleted API keys to logaction, allowing it to generate a diff for display in the log viewer. Test plan: 1. Apply patch. 2. Enable the system preferences ApiKeyLog and RESTOAuth2ClientCredentials. 3. Navigate to a patron, and select "Manage API keys" under the "More" dropdown. 4. Create a new key pair (with any description) then delete it. 5. Navigate to Tools > Log Viewer, and click "Submit", ensuring "API keys" is enabled under "Modules". 6. Enable the "Diff" column for the table. 7. Verify there is a "Create" and "Delete" action corresponding to the API key created earlier, with a meaningful diff displayed in the relevant column. 8. Prove t/db_dependent/Koha/ApiKey.t Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #202544|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42035 --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 202944 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202944&action=edit Bug 42035: Add diffs to apikey CREATE/DELETE logs This patch passes in the created/deleted API keys to logaction, allowing it to generate a diff for display in the log viewer. Test plan: 1. Apply patch. 2. Enable the system preferences ApiKeyLog and RESTOAuth2ClientCredentials. 3. Navigate to a patron, and select "Manage API keys" under the "More" dropdown. 4. Create a new key pair (with any description) then delete it. 5. Navigate to Tools > Log Viewer, and click "Submit", ensuring "API keys" is enabled under "Modules". 6. Enable the "Diff" column for the table. 7. Verify there is a "Create" and "Delete" action corresponding to the API key created earlier, with a meaningful diff displayed in the relevant column. 8. Prove t/db_dependent/Koha/ApiKey.t Sponsored-by: Open Fifth Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org