Hey everyone!
I am quite new to Elasticsearch and I have some beginners questions, please forgive me. I hope you can shortly take the time to validate my questions regarding the elastic users API.
I am currently building a web app (front end: react) that should search different pdf documents. The documents are uploaded to Elasticsearch via fscrawler.
- Then I build a react web app to process the data (so non-programmers can easily edit the data via post requests). I call this first web application Ingest GUI. The web app is only accessible by internal employees.
- Once the editing is finished, the docs are sent to the final index. This final index will be searchable by the mainstream final and second react web application, which will be distributed to external users.
I want to equip my web application with a login form, so users could register and then log in. I understand that Elasticsearch has a user API. These are my questions:
1/ Is the user API meant to be an API where users of my web application can register and then use this information to login? I have the impression that creating users is more directed towards 'managers of the db' e.g. using kibana
2/ If the above answer is yes: from what I understand: each user needs to have a role. Is there a predefined role that matches the tasks that the users need to carry out:
- (Internal) users from the Ingest GUI: query specified indexes, post docs to the specified index, delete docs in a certain index.
- (External) users form the final web application: query specified 'final index', post information to docs, and delete the information within the docs itself.
3/ If the answer to the first question is yes: currently I use an API key to perform the queries, using axios (see example below). If the users are logged in, does the API key (authorization in fat in the code below) needs to be changed for some authorization connected to the specific user?
axios.post( `${path}/finalsearchindex/_doc/` ,
input,
{headers: {'Authorization': **Authorization**}},
)
Thank you in advance for your time and patience!