Ted Zlatanov <[email protected]> writes: Hi Ted,
> ;;; 'create-if-missing should be supplemented by a global > ;;; auth-source-create-if-missing which could be 'never, 'always, or nil > (auth-source-user-or-password "password" server port user 'create-if-missing) > > and it would (theoretically) work for any editable backend. At least > for the two backends we've discussed (Secrets API and flat netrc files) > this would work. That would give us a stateless way to ensure that a > password exists, prompting the user if necessary without interrupting > the code flow, and allowing the user to specify their preference as well > if they want to always or never create entries. I've tried to implement it last days. What I've obeserved is that we also need a `delete-existing' argument. The reason behind is, that people might add wrong passwords, which will be detected by the client only. The client must be able to overwrite this password. So I have changed the function too (defun auth-source-user-or-password (mode host protocol &optional username create-missing delete-existing) Maybe `create-missing' and `delete-existing' could be put into one argument; but this would be more complex then. I found your implementation with two passes inconvenient for the two new arguments. Therefore, I have rewritten `auth-source-user-or-password' and `auth-source-pick'. The latter one just identifies applicable entries from `auth-sources according' to the spec compiled from `auth-source-user-or-password' arguments. There are also the new functions `auth-get-source', `auth-source-retrieve', `auth-source-create' and `auth-source-delete'. These functions are introduced in order to make `auth-source-user-or-password' readable. The new code is appended; please comment. > Ted Best regards, Michael.
auth-source.el
Description: application/emacs-lisp
_______________________________________________ Tramp-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/tramp-devel
