-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add recipe for auth-source-keytar #7468
Conversation
That's a very heavy dependency (for |
I am not familiar with |
Alright, then node of course isn't an unnecessary dependency and it is okay to depend on it for other things as well. That being said...
So many (most?) users won't even need it. So I still think it would be a good idea to make this an optional dependency.
Yes, though that might be more complicated than on Linux and I have no experience with it. It supports multiple plug-able backends and |
Yeah, you are right. Yet I don't like asking people to install another package if they want a feature working unless it is heavy dependency. And I think premium version is a major feature and should not be optional. I don't know how many users would need it or not, but since many people were asking this grammarly/#1, grammarly/#3, lsp-grammarly/#3, I think it would be great to have it.
I don't know if I want another layer to do this, but good to know. Thanks! :) |
My reading of those issues is that people wanted a way to login with their own credentials -- fair. But nobody is saying "why doesn't this support logging in with keytar?" So you're requiring (paid and unpaid) users to use/install keytar whether they prefer to use another password manager or not. In fact -- and this is back to referencing this PR rather than lsp-grammarly -- if my understanding is correct, this package is requiring users to install your fork (!) of the keytar-cli while pointing them to https://www.npmjs.com/package/keytar in your commentary. This is extremely sketchy. Your users will end up with |
My first thought is "why not?", but I guess this would not be an acceptable answer. Below are my reasons.
I don't have preference on a password manager, I am just providing a solution. If people doesn't like it, they can fork or open a PR for it.
I am pointing to that repository because it attempt to serve API from that specific npm package. |
emacs-grammarly/keytar-cli is a fork of mattrenaud/keytar-cli aka the upstream. If users end up using the former while expecting to be using the latter, then that is sketchy. It would probably be best if you could get your changes merged upstream before we proceed here.
What repository are you referring to? |
I still don't think you should force this solution on users. |
Totally agree. You can then trivially provide an |
I'd confused keytar-cli (the original) for an official package, so apologies if I seemed quick to judge. I still think forking the existing command-line app and having users access it with the same command ( It also sounds like |
The upstream seems to be unmaintained? hmm...
https://github.com/mattrenaud/keytar-cli
Okay, I can see the point making it with auth-soruce-*.
I think it would be easier for me to maintain it myself since I don't think @mattrenaud is very active on GitHub and the upstream isn't official repository (basically anyone can have their own fork). In addition, I have wrapped the npm package with scope of @emacs-grammarly so it should be clear to see IMO.
Of course, if there is an official keytar cli repository, I would switch to that npm package instead of my own fork.
I can work on this. Would it still be different packages or all in one package?
Do I need to open another PR? Thanks! |
IMO neither a separate repository nor a new pull-request are needed. I would even distribute both libraries as one package ( |
On the other hand distributing |
Okay, I have managed to have it in the current repository by having the file |
I think what we're aiming for is a separate package called |
Sorry, I'm just reading what @tarsius wrote. Let me think some more. |
Yeah, regarding discoverability I think it would be best to name this |
Done. |
Thanks very much for accommodating -- ideally to align with the prefix rules you could just move all of the keytar.el code into auth-source-keytar.el. I still have misgivings about potential conflicts with the "original" keytar-cli; maybe you could rename your fork's shell command to emacs-keytar or something just to be safe? Otherwise the code is shaping up well. |
I think it is better to keep it separately since it serves directly to node-keytar (module by module). Do you think I should split into another package for this goal? 😕
I attempt to serve the official keytar so I would like to keep as is it. And if Atom's developer willing to create their own official cli then I might switch it over and delete my own fork. Furthermore, I think by having scope wrapped is enough, |
No, I think they belong together. I'm afraid I don't understand your rationale that it serves directly to node-keytar (couldn't the same be said about auth-source-keytar?) as a reason for not including the code under the same namespace.
After scrolling around in the code I see now that the installation step is specifying |
I was thinking to keep the module separate just to keep the namespace to |
On further reading it seems like there is some precedent for what you want to do here. For example, there's Your code looks great now re: the checklist, but I'm having some trouble when I test it out. For example: (auth-source-pick-first-password :host "[email protected]")
=> "great-passw0rd"
(auth-source-keytar-enable)
(auth-source-pick-first-password :host "[email protected]")
=> Wrong type argument: (or eieio-object class), (auth-source-backend "keytar" :source "." :type 'keytar :search-function #'auth-source-keytar-search), obj Are you able to see something similar on your end? |
Friendly ping. :) |
Yes, and I agree with you. :)
I have now fixed this issue. Please try the latest source and check to see if the issue resolves. You might want to use (auth-source-keytar-enable)
(auth-source-pick-first-password :service "hello") |
Forgot to mention, I have split (revert) the package into two. I reckon keeping the namespace on it's own would be easier for me to maintain. Like the example Chris brought up, https://github.com/emacs-grammarly/keytar |
I'm not an auth-source expert and am getting caught up as I review this PR, but if you read the help for
so probably you want to support those. I'm curious, where did you read that In the meantime, one small byte-compile warning which may point to an issue: byte-compile (using Emacs 27.1):
|
Fixed! Thanks! |
Hello, I had another look at the code and it looks like auth-source-keytar.el cannot be loaded (even after successful byte-compilation) because |
Sorry for the issue here. I am also having the same issue when declaring it using I was using auth-source-pass and auth-source-xoauth2 as references but they all use keyword |
I will assume this is rhetorical. :) Thanks for this -- I'll merge. |
Brief summary of what the package does
Emacs-Lisp interface for node-keytar
Direct link to the package repository
Your association with the package
The maintainer.
Relevant communications with the upstream package maintainer
None needed.
Checklist
Please confirm with
x
:M-x checkdoc
is happy with my docstrings