Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authenticated endpoint for removing a word : /remove #21

Open
subins2000 opened this issue Sep 24, 2020 · 2 comments
Open

Authenticated endpoint for removing a word : /remove #21

subins2000 opened this issue Sep 24, 2020 · 2 comments

Comments

@subins2000
Copy link
Member

There's a varnam_remove_word function, but is not available to use in both CLI and Go handlers. It'll be great if there is this endpoint.

But, this would be problematic for a public instance of varnamd. Which brings me to the authenticated endpoints feature mentioned in #17 : #17 (comment)

A simple "Authentication" header with a token would be fine. The password can be optionally passed to varnamd as a flag (hashed, plaintext would be a disaster of course).

By adding an auth, the endpoints that would probably require it would be :

  • /train
  • /remove

OR simply avoid the auth, and implement it under enableInternalApis.

Usecase :
In the offline desktop, I'm adding an option to remove the word, but there's no endpoint to send to.
image

@athul @joicemjoseph interested to implement this ?

@joicemjoseph
Copy link

joicemjoseph commented Sep 25, 2020

lets do that.
https://github.com/varnamproject/varnamd/pull/17/files#diff-34c6b408d72845d076d47126c29948d1R80
I have already added authentication here.

@subins2000
Copy link
Member Author

Awesome, password can be configured directly from the config file. Didn't notice that before, oops.

Then this issue is only about the '/remove' endpoint to call varnam_remove_word in libvarnam

@subins2000 subins2000 changed the title Endpoint for removing a word, Optional Authentication Flag Authenticated endpoint for removing a word : /remove Sep 25, 2020
subins2000 added a commit to subins2000/varnamd that referenced this issue Sep 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants