Bug 21998

Summary: Add pattern parameter in Koha::Token
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: josef.moravec, lucas, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
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
Bug Depends on:    
Bug Blocks: 21336    
Attachments: Bug 21998: Add pattern parameter in Koha::Token
Bug 21998: Add pattern parameter in Koha::Token
Bug 21998: Throw exception on bad pattern
Bug 21998: Throw exception on bad pattern
Bug 21998: Silent tests
Bug 21998: Add pattern parameter in Koha::Token
Bug 21998: Throw exception on bad pattern
Bug 21998: Silent tests

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