Bug 18950

Summary: Elasticsearch - Add password access for admin functions
Product: Koha Reporter: Nick Clemens <nick>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P5 - low CC: david.bourgault, jonathan.druart, kyle, severine.queune, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18948    
Bug Blocks:    
Attachments: Bug 18950 - Elasticsearch - Add password access for admin functions
Bug 18950 - Elasticsearch - Add password access for admin functions

Description Nick Clemens 2017-07-18 12:07:47 UTC
This patchset adds a parameter to the koha-conf.xml file:
<elasticsearch_admin_password>

When defined additional actions will be enabled on the Search engine configuration page

Password must be entered and action chosen, if password matches the action will be performed
Comment 1 Nick Clemens 2017-07-18 12:11:32 UTC
Created attachment 65088 [details] [review]
Bug 18950 - Elasticsearch - Add password access for admin functions

To test:
1 - Load 'Search engine configuration' from admin page
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
2 - Verify this works as before the patch
3 - Add <elasticsearch_admin_password> to koha-conf.xml
4 - Reload search config page, note additional option to reset mappings
5 - Attempt reset with bad password
6 - Attempt reset with correct password

Note: the action is a drop down as reindexing will be added, however,
    code needs some refactoring before this option can be implemented
Comment 2 Nick Clemens 2017-07-20 20:25:06 UTC
Created attachment 65160 [details] [review]
Bug 18950 - Elasticsearch - Add password access for admin functions

To test:
1 - Load 'Search engine configuration' from admin page
http://localhost:8081/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl
2 - Verify this works as before the patch
3 - Add <elasticsearch_admin_password> to koha-conf.xml
4 - Reload search config page, note additional option to reset mappings
5 - Attempt reset with bad password
6 - Attempt reset with correct password
7 - Attempt a reindex with bad password
8 - Attempt a reindex with correct password
Comment 3 David Bourgault 2017-11-03 20:29:44 UTC
Patch applies, and basic functionality is there, however:

- "Reindex" checked for password correctly but failed since 18948 does not apply for me (not an issue, just a note)

- The password input field is of type=text but should be of type=password
- The error message when you enter a wrong password should probably more obvious (like being red, or using the standard koha warning boxes)
- I'd suggest moving the <elasticsearch_admin_password> XML node inside the <elasticsearch> group, seems cleaner to me.
Comment 4 Nick Clemens 2019-03-26 15:23:57 UTC
Not working on this one