emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refactor elpa/oauth2.el to use plist over cl-defstruct


From: Adam Porter
Subject: Re: Refactor elpa/oauth2.el to use plist over cl-defstruct
Date: Sat, 25 Jan 2025 22:11:47 -0600
User-agent: Mozilla Thunderbird

Hello,

I have some more free time so I was looking into my oauth2.el again. I want to ask if it would be desirable to refactor the library to use plists in place of `cl-defstruct`? This would make more sense as the storage backend used is plstore, which uses plists as its native format.

Instead of refactoring the library to use plists, have you considered using a different storage backend, such as persist.el or multisession.el? It needn't be limited by plstore's design, and swapping the storage backend would probably require fewer changes.

I have also read that the use of cl-lib is discouraged for various reasons.

Be careful with the use of the passive voice. It's very easy for misleading rumors to be spread that way. ;) The questions are of who discourages such use and why. And as others have said, it isn't the case.

My overall goal is to make oauth2.el integrate with auth-sources, and properly hook into functions like `auth-info-password` to refresh (if needed) and supply the token, in hopes to better integrate with nnimap in gnus.el.

Do you mean `auth-sources` or `auth-source`?  I can only find `auth-source`.

And with regard to using `auth-source` for storing and retrieving tokens, I'd point out the problems I encountered when trying to use it that way in the past:

https://old.reddit.com/r/emacs/comments/8lvda6/is_authsource_from_the_dark_side/

AFAIK those issues have not been resolved, and until they are, ISTM that it's not suited to the task. As I've mentioned elsewhere, Emacs could benefit from a "new" (i.e. not that it necessarily needs to be implemented from scratch) secrets library.

My two cents.

--Adam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]