[Bug 44143] New: Check-ins performed in the staff interface log interface "REST API"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44143 Bug ID: 44143 Summary: Check-ins performed in the staff interface log interface "REST API" Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Depends on: 42383 Target Milestone: --- The VUE checkin page uses the new checkin API. Because of this, those checkins show in the action logs with interface "REST API." They should log as "staff interface" instead. In the action logs, an interface value of "REST API" should denote an external API request, not use of the API within Koha. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 [Bug 42383] Migrate check-in page to Vue -- 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=44143 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, | |nick@bywatersolutions.com, | |pedro.amorim@openfifth.co.u | |k, tomascohen@gmail.com --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Claude suggests a broader change to how API actions define their context. This change and its ramifications all sound correct to me a Claude describes them, but Claude is an overclocked predictive text tool so I'd love some knowledgeable human feedback on the question. The LLM says: Why it happens. The Vue page logs in to the API with the staff CGISESSID cookie. That session stores interface = 'intranet' (C4/Auth.pm:1343), and check_cookie_auth sets it on C4::Context (C4/Auth.pm:1929). But at the end of authenticate_api_request, Koha/REST/V1/Auth.pm:250 always overwrites it with C4::Context->interface('api'). logaction then reads C4::Context->interface (C4/Log.pm:83) and records “api”. Likely fix. Keep the session’s interface when the request was authenticated by cookie ($cookie_auth), and use 'api' only for Basic or OAuth requests, which is what your description says “REST API” should mean. The catch. That line runs for every API request, not just check-in. The change would also affect: every other staff Vue page (ERM, acquisitions, preservation, and so on); OPAC JavaScript that calls the API with a session cookie, which would start logging as opac; any code that checks C4::Context->interface eq 'api' or 'opac'. That includes the interface stored on account lines and statistics, not just the action logs. So the question is whether to make the general fix (more correct, but wider testing and QA) or a fix limited to the check-in endpoint (smaller, but leaves the same problem everywhere else). -- 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=44143 --- Comment #2 from Lisette Scheer <lisette@bywatersolutions.com> --- Question from the dev meeting: Is there any reason to log Staff Interface actions via the API separately from Staff Interface actions that don't use the API, same if Koha opac is using API? My thought is: it's cleaner to just do Staff Interface - Anything done via the staff interface, either natively(?) or via API Opac - Anything done via the public interface, either natively(?) or via API API - Anything done using the API outside of that SIP - Anything done via SIP Command-line - Things done via CLI Cron job - Things done via Cron jobs (does this include crons run manually via the cli?) -- 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=44143 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Check-ins performed in the |Actions performed in staff |staff interface log |interface and OPAC using |interface "REST API" |the API are logged as API -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org