[Bug 43850] New: Convert two-factor registration verification endpoint to a JSON body
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43850 Bug ID: 43850 Summary: Convert two-factor registration verification endpoint to a JSON body Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: tomascohen@gmail.com CC: tomascohen@gmail.com Target Milestone: --- Follow-up to bug 43310. POST /api/v1/auth/two-factor/registration/verification declares secret32 and pin_code as in: formData parameters in api/v1/swagger/paths/auth.yaml. The shared JSON client (api-client.js) therefore cannot call it without hand-building a form-encoded body and overriding Content-Type, as members/two_factor_auth.tt now does. Proposed: - Change the endpoint to take a JSON body (in: body with a small schema) and read it with $c->req->json in Koha::REST::V1::TwoFactorAuth::verification. - Update both callers: members/two_factor_auth.tt and modules/auth.tt (which still uses jQuery.ajax for both 2FA endpoints and could move to api-client.js too). - Update t/db_dependent/api/v1/two_factor_auth.t, which currently posts form data. - Make the invalid-PIN case machine readable (status code or error code) so the UI does not compare against the English string "Invalid pin". Also: - The 204 No Content handling added to http-client.js in bug 43310 affects every caller of the shared client. Audit callers of post/put/patch that expect a response body. - Add a page-level Cypress spec for the staff 2FA registration flow (enable, wrong PIN, correct PIN). This needs a way to set the TwoFactorAuthentication syspref and compute a TOTP code from the displayed secret. -- 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=43850 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43310 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310 [Bug 43310] Migrate members/two_factor_auth.tt to use api-client.js -- 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=43850 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | QA Contact|tomascohen@gmail.com |martin.renvoize@openfifth.c | |o.uk -- 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=43850 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- @ashimema: I talked to @joubu about the design decisions made in the past (I wasn't aware if it was some standard to use fromData for this). He agreed on switching to JSON as well. So I'm moving forward sooner than later. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org