Bugzilla – Attachment 138700 Details for
Bug 28787
Send a notice with the TOTP token
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28787: Rename the REST API route to /auth/otp/token_delivery
Bug-28787-Rename-the-REST-API-route-to-authotptoke.patch (text/plain), 4.48 KB, created by
Kyle M Hall (khall)
on 2022-08-05 14:24:50 UTC
(
hide
)
Description:
Bug 28787: Rename the REST API route to /auth/otp/token_delivery
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-08-05 14:24:50 UTC
Size:
4.48 KB
patch
obsolete
>From 1718cc86c8930ded49092aac04cdc42b916310ec Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 7 Jul 2022 09:34:08 +0200 >Subject: [PATCH] Bug 28787: Rename the REST API route to > /auth/otp/token_delivery > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Sponsored-by: Rijksmuseum, Netherlands > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/REST/V1/Auth.pm | 2 +- > api/v1/swagger/paths/auth.yaml | 2 +- > api/v1/swagger/swagger.yaml | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +- > t/db_dependent/api/v1/two_factor_auth.t | 6 +++--- > 5 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm >index 43906be1778..ae2488f2127 100644 >--- a/Koha/REST/V1/Auth.pm >+++ b/Koha/REST/V1/Auth.pm >@@ -231,7 +231,7 @@ sub authenticate_api_request { > $cookie_auth = 1; > } > elsif ($status eq "additional-auth-needed") { >- if ( $c->req->url->to_abs->path eq '/api/v1/auth/send_otp_token' ) { >+ if ( $c->req->url->to_abs->path eq '/api/v1/auth/otp/token_delivery' ) { > $user = Koha::Patrons->find( $session->param('number') ); > $cookie_auth = 1; > } else { >diff --git a/api/v1/swagger/paths/auth.yaml b/api/v1/swagger/paths/auth.yaml >index 43b0decbb51..c147d0549de 100644 >--- a/api/v1/swagger/paths/auth.yaml >+++ b/api/v1/swagger/paths/auth.yaml >@@ -1,5 +1,5 @@ > --- >-/auth/send_otp_token: >+/auth/otp/token_delivery: > post: > x-mojo-to: TwoFactorAuth#send_otp_token > operationId: send_otp_token >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index a14d2f2c5cb..416847c77c3 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -101,8 +101,8 @@ paths: > $ref: "./paths/advancededitormacros.yaml#/~1advanced_editor~1macros~1{advancededitormacro_id}" > "/article_requests/{article_request_id}": > $ref: "./paths/article_requests.yaml#/~1article_requests~1{article_request_id}" >- /auth/send_otp_token: >- $ref: paths/auth.yaml#/~1auth~1send_otp_token >+ /auth/otp/token_delivery: >+ $ref: paths/auth.yaml#/~1auth~1otp~1token_delivery > "/biblios/{biblio_id}": > $ref: "./paths/biblios.yaml#/~1biblios~1{biblio_id}" > "/biblios/{biblio_id}/checkouts": >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index e188d5f268b..41995bf423a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -198,7 +198,7 @@ > $("#email_success").hide(); > $("#email_error").hide(); > $.ajax({ >- url: '/api/v1/auth/send_otp_token', >+ url: '/api/v1/auth/otp/token_delivery', > type: 'POST', > success: function(data){ > let message = _("The code has been sent by email, please check your inbox.") >diff --git a/t/db_dependent/api/v1/two_factor_auth.t b/t/db_dependent/api/v1/two_factor_auth.t >index 8a55e61e0a1..ddda4fd0a0a 100755 >--- a/t/db_dependent/api/v1/two_factor_auth.t >+++ b/t/db_dependent/api/v1/two_factor_auth.t >@@ -58,7 +58,7 @@ subtest 'send_otp_token' => sub { > $session->param( 'lasttime', time() ); > $session->flush; > >- my $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); >+ my $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); > $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); > $tx->req->env( { REMOTE_ADDR => $remote_address } ); > >@@ -85,7 +85,7 @@ subtest 'send_otp_token' => sub { > $patron->email(undef); > $patron->store; > >- $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); >+ $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); > $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); > $tx->req->env( { REMOTE_ADDR => $remote_address } ); > >@@ -93,7 +93,7 @@ subtest 'send_otp_token' => sub { > $t->request_ok($tx)->status_is(400)->json_is({ error => 'email_not_sent' }); > > $patron->email('to@example.org')->store; >- $tx = $t->ua->build_tx( POST => "/api/v1/auth/send_otp_token" ); >+ $tx = $t->ua->build_tx( POST => "/api/v1/auth/otp/token_delivery" ); > $tx->req->cookies( { name => 'CGISESSID', value => $session->id } ); > $tx->req->env( { REMOTE_ADDR => $remote_address } ); > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28787
:
135287
|
136571
|
136572
|
136573
|
137251
|
137330
|
137331
|
137369
|
137370
|
137371
|
137379
|
137380
|
137381
|
137391
|
137392
|
137393
|
137394
|
137395
|
137396
|
137397
|
137398
|
137399
|
137400
|
138146
|
138149
|
138150
|
138151
|
138152
|
138153
|
138154
|
138155
|
138156
|
138157
|
138158
|
138159
|
138689
|
138696
|
138697
|
138698
|
138699
| 138700 |
138701
|
138702
|
138703
|
138704
|
138705
|
138706
|
138707
|
138931
|
138932