Bug 21998 - Add pattern parameter in Koha::Token
Summary: Add pattern parameter in Koha::Token
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 21336
  Show dependency treegraph
 
Reported: 2018-12-14 08:10 UTC by Marcel de Rooy
Modified: 2020-01-06 20:15 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Preparatory patch for GDPR enhancements that may be forthcoming.
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 21998: Add pattern parameter in Koha::Token (2.17 KB, patch)
2018-12-14 08:13 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21998: Add pattern parameter in Koha::Token (2.20 KB, patch)
2018-12-18 11:54 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21998: Throw exception on bad pattern (4.39 KB, patch)
2018-12-18 11:54 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21998: Throw exception on bad pattern (4.49 KB, patch)
2019-01-25 10:38 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 21998: Silent tests (960 bytes, patch)
2019-02-27 17:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21998: Add pattern parameter in Koha::Token (2.26 KB, patch)
2019-03-15 10:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21998: Throw exception on bad pattern (4.50 KB, patch)
2019-03-15 10:53 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21998: Silent tests (1.00 KB, patch)
2019-03-15 10:53 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2018-12-14 08:10:09 UTC
Split from bug 21336
Comment 1 Marcel de Rooy 2018-12-14 08:13:00 UTC
Created attachment 83196 [details] [review]
Bug 21998: Add pattern parameter in Koha::Token

Allow a pattern too in Koha::Token->generate. Only supported length.
Does not affect CSRF calls. So tiny change without further impact.

Test plan:
Run  t/Token.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Josef Moravec 2018-12-14 15:57:07 UTC
I am going to add mine bit of work here, stay tuned ;)
Comment 3 Josef Moravec 2018-12-18 11:54:25 UTC
Created attachment 83347 [details] [review]
Bug 21998: Add pattern parameter in Koha::Token

Allow a pattern too in Koha::Token->generate. Only supported length.
Does not affect CSRF calls. So tiny change without further impact.

Test plan:
Run  t/Token.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Josef Moravec 2018-12-18 11:54:28 UTC
Created attachment 83348 [details] [review]
Bug 21998: Throw exception on bad pattern

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Marcel de Rooy 2019-01-25 10:38:31 UTC
Created attachment 84401 [details] [review]
Bug 21998: Throw exception on bad pattern

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2019-01-25 10:38:52 UTC
Cross sign-offs ;)
Comment 7 Marcel de Rooy 2019-01-25 10:39:54 UTC
    ok 4 - Only uppercase letters
Use of uninitialized value $ch in string ne at /usr/share/perl5/String/Random.pm line 141.
    ok 5 - Exception should be thrown when wrong pattern is used

This warning from String::Random is annoying, but no problem..
Comment 8 Jonathan Druart 2019-02-27 17:49:54 UTC
Created attachment 85791 [details] [review]
Bug 21998: Silent tests
Comment 9 Josef Moravec 2019-02-28 06:15:30 UTC
(In reply to Jonathan Druart from comment #8)
> Created attachment 85791 [details] [review] [review]
> Bug 21998: Silent tests

Thanks Jonathan
Comment 10 Martin Renvoize 2019-03-15 10:53:11 UTC
Created attachment 86665 [details] [review]
Bug 21998: Add pattern parameter in Koha::Token

Allow a pattern too in Koha::Token->generate. Only supported length.
Does not affect CSRF calls. So tiny change without further impact.

Test plan:
Run  t/Token.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2019-03-15 10:53:14 UTC
Created attachment 86666 [details] [review]
Bug 21998: Throw exception on bad pattern

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2019-03-15 10:53:17 UTC
Created attachment 86667 [details] [review]
Bug 21998: Silent tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2019-03-15 11:00:24 UTC
Small enhancement with no noticeable effects and no regressions.

False positive in the QA scripts about POD missing.

Passing QA
Comment 14 Nick Clemens 2019-03-22 20:37:34 UTC
Awesome work all!

Pushed to master for 19.05
Comment 15 Martin Renvoize 2019-04-01 10:38:32 UTC
As a preparatory enhancement for GDPR work I've chosen to backport this one.

Pushed to 18.11.x for 18.11.05
Comment 16 Lucas Gass 2019-04-01 15:59:56 UTC
not backporting enhancement to 18.05.x