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

emacs-lastpass and magit doesn't play well together #9

Closed
mattiasb opened this issue Apr 3, 2018 · 6 comments
Closed

emacs-lastpass and magit doesn't play well together #9

mattiasb opened this issue Apr 3, 2018 · 6 comments

Comments

@mattiasb
Copy link

mattiasb commented Apr 3, 2018

Hi!

I was trying to use the emacs-lastpass integration with auth-source to be able to store the github OAuth token that is created when setting up a github account with magit.

I get a Symbol's function definition is void: nil which I've tracked down to this line in ghub.el.

I'm not sure if this is a bug in emacs-lastpass or in ghub so I'm putting the issue here and pinging in @tarsius .

@tarsius
Copy link

tarsius commented Apr 4, 2018

I believe having users calling that function and backends returning that function is what auth-source expects. It's a bit weird. See "Help for developers" in the manual.

@mattiasb
Copy link
Author

mattiasb commented Apr 4, 2018

I have no more experience with auth-source than from what I read
yesterday trying to debug this, but this part from the
auth-source-search-documentation suggests otherwise:

The token can hold a :save-function key. If you call that, the
user will be prompted to save the data to the backend. You can’t
request that this should happen right after creation, because
‘auth-source-search’ has no way of knowing if the token is
actually useful. So the caller must arrange to call this function.

(Emphasis mine)

My take, from reading that, is that the :save-function key is optional.
Maybe because the auth-source author wanted to support read-only
backends? I really have no clue here.

Regardless it seems to me that emacs-lastpass should learn how to
save stuff if this is indeed missing.

@storvik
Copy link
Owner

storvik commented Apr 8, 2018

Thanks for providing some pointers. As soon as I get back to my Linux computer I'll check it out!

@tarsius
Copy link

tarsius commented Apr 9, 2018

I have interpreted "can" as "if the backend supports storing passwords persistently, then it must return a function so that the caller can call that if and only if it wants to do that. Otherwise it cannot, and therefore does not have to, return such a function."

With that interpretation ghub's behavior is correct in that using a backend that does not allow storing the token persistently is of no use to it.

But there are at least two third-party backends that just save the secret instead of a saver function, so I'll probably handle that case in ghub.

@mattiasb
Copy link
Author

I got all this working with the new forge package. My guess is that ghub changed somewhat or that I did something weird back then but it all works fine now.

@tarsius
Copy link

tarsius commented Jan 10, 2019

Yes, I changed something in ghub a while back, probably April. But I forgot to mention it here.

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

3 participants