emacs/lisp/auth-source.el

2624 lines
111 KiB
EmacsLisp
Raw Normal View History

;;; auth-source.el --- authentication sources for Gnus and Emacs -*- lexical-binding: t -*-
2024-01-02 01:47:10 +00:00
;; Copyright (C) 2008-2024 Free Software Foundation, Inc.
;; Author: Ted Zlatanov <tzz@lifelogs.com>
;; Keywords: news
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; This is the auth-source.el package. It lets users tell Gnus how to
;; authenticate in a single place. Simplicity is the goal. Instead
;; of providing 5000 options, we'll stick to simple, easy to
;; understand options.
;; See the auth.info Info documentation for details.
;; TODO:
;; - never decode the backend file unless it's necessary
;; - a more generic way to match backends and search backend contents
;; - absorb netrc.el and simplify it
;; - protect passwords better
;; - allow creating and changing netrc lines (not files) e.g. change a password
;;; Code:
(require 'json)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(require 'password-cache)
(require 'icons)
(require 'cl-lib)
2016-11-02 20:23:48 +00:00
(require 'eieio)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(declare-function gnutls-symmetric-decrypt "gnutls.c")
(declare-function gnutls-ciphers "gnutls.c")
(autoload 'secrets-create-item "secrets")
(autoload 'secrets-delete-item "secrets")
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
(autoload 'secrets-get-alias "secrets")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(autoload 'secrets-get-attributes "secrets")
(autoload 'secrets-get-secret "secrets")
(autoload 'secrets-list-collections "secrets")
(autoload 'secrets-search-items "secrets")
(autoload 'rfc2104-hash "rfc2104")
(autoload 'plstore-open "plstore")
(autoload 'plstore-find "plstore")
(autoload 'plstore-put "plstore")
(autoload 'plstore-delete "plstore")
(autoload 'plstore-save "plstore")
2011-06-30 08:20:33 +00:00
(autoload 'plstore-get-file "plstore")
(eval-when-compile (require 'epg)) ;; setf-method for `epg-context-armor'
(autoload 'epg-make-context "epg")
(autoload 'epg-context-set-passphrase-callback "epg")
(autoload 'epg-decrypt-string "epg")
(autoload 'epg-encrypt-string "epg")
2011-08-30 23:01:50 +00:00
(autoload 'help-mode "help-mode" nil t)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defvar secrets-enabled)
(defgroup auth-source nil
"Authentication sources."
:version "23.1" ;; No Gnus
:group 'gnus)
;;;###autoload
(defcustom auth-source-cache-expiry 7200
"How many seconds passwords are cached, or nil to disable expiring.
Overrides `password-cache-expiry' through a let-binding."
Add missing :version tags to new defgroups and defcustoms * window.el (window-sides-slots): * tool-bar.el (tool-bar-position): * term/xterm.el (xterm-extra-capabilities): * ses.el (ses-self-reference-early-detection): * progmodes/verilog-mode.el (verilog-auto-declare-nettype) (verilog-auto-wire-type) (verilog-auto-delete-trailing-whitespace) (verilog-auto-reset-blocking-in-non, verilog-auto-inst-sort) (verilog-auto-tieoff-declaration): * progmodes/sql.el (sql-login-hook, sql-ansi-statement-starters) (sql-oracle-statement-starters, sql-oracle-scan-on): * progmodes/prolog.el (prolog-align-comments-flag) (prolog-indent-mline-comments-flag, prolog-object-end-to-0-flag) (prolog-left-indent-regexp, prolog-paren-indent-p) (prolog-paren-indent, prolog-parse-mode, prolog-keywords) (prolog-types, prolog-mode-specificators) (prolog-determinism-specificators, prolog-directives) (prolog-electric-newline-flag, prolog-hungry-delete-key-flag) (prolog-electric-dot-flag) (prolog-electric-dot-full-predicate-template) (prolog-electric-underscore-flag, prolog-electric-tab-flag) (prolog-electric-if-then-else-flag, prolog-electric-colon-flag) (prolog-electric-dash-flag, prolog-old-sicstus-keys-flag) (prolog-program-switches, prolog-prompt-regexp) (prolog-debug-on-string, prolog-debug-off-string) (prolog-trace-on-string, prolog-trace-off-string) (prolog-zip-on-string, prolog-zip-off-string) (prolog-use-standard-consult-compile-method-flag) (prolog-use-prolog-tokenizer-flag, prolog-imenu-flag) (prolog-imenu-max-lines, prolog-info-predicate-index) (prolog-underscore-wordchar-flag, prolog-use-sicstus-sd) (prolog-char-quote-workaround): * progmodes/cc-vars.el (c-defun-tactic): * net/tramp.el (tramp-encoding-command-interactive) (tramp-local-end-of-line): * net/soap-client.el (soap-client): * net/netrc.el (netrc-file): * net/gnutls.el (gnutls): * minibuffer.el (completion-category-overrides) (completion-cycle-threshold) (completion-pcm-complete-word-inserts-delimiters): * man.el (Man-name-local-regexp): * mail/feedmail.el (feedmail-display-full-frame): * international/characters.el (glyphless-char-display-control): * eshell/em-ls.el (eshell-ls-date-format): * emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment) (lisp-lambda-list-keyword-parameter-indentation) (lisp-lambda-list-keyword-parameter-alignment): * doc-view.el (doc-view-image-width, doc-view-unoconv-program): * dired-x.el (dired-omit-verbose): * cus-theme.el (custom-theme-allow-multiple-selections): * calc/calc.el (calc-highlight-selections-with-faces) (calc-lu-field-reference, calc-lu-power-reference) (calc-note-threshold): * battery.el (battery-mode-line-limit): * arc-mode.el (archive-7z-extract, archive-7z-expunge) (archive-7z-update): * allout.el (allout-prefixed-keybindings) (allout-unprefixed-keybindings) (allout-inhibit-auto-fill-on-headline) (allout-flattened-numbering-abbreviation): * allout-widgets.el (allout-widgets-auto-activation) (allout-widgets-icons-dark-subdir) (allout-widgets-icons-light-subdir, allout-widgets-icon-types) (allout-widgets-theme-dark-background) (allout-widgets-theme-light-background) (allout-widgets-item-image-properties-emacs) (allout-widgets-item-image-properties-xemacs) (allout-widgets-run-unit-tests-on-load) (allout-widgets-time-decoration-activity) (allout-widgets-hook-error-post-time) (allout-widgets-track-decoration): * gnus/sieve-manage.el (sieve-manage-default-stream): * gnus/shr.el (shr): * gnus/nnir.el (nnir-ignored-newsgroups, nnir-summary-line-format) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-notmuch-program) (nnir-notmuch-additional-switches, nnir-notmuch-remove-prefix) (nnir-method-default-engines): * gnus/message.el (message-cite-reply-position): * gnus/gssapi.el (gssapi-program): * gnus/gravatar.el (gravatar): * gnus/gnus-sum.el (gnus-refer-thread-use-nnir): * gnus/gnus-registry.el (gnus-registry-unfollowed-addresses) (gnus-registry-max-pruned-entries): * gnus/gnus-picon.el (gnus-picon-inhibit-top-level-domains): * gnus/gnus-int.el (gnus-after-set-mark-hook) (gnus-before-update-mark-hook): * gnus/gnus-async.el (gnus-async-post-fetch-function): * gnus/auth-source.el (auth-source-cache-expiry): Add missing :version tags to new defcustoms and defgroups.
2012-02-11 22:13:29 +00:00
:version "24.1"
:type '(choice (const :tag "Never" nil)
(const :tag "All Day" 86400)
(const :tag "2 Hours" 7200)
(const :tag "30 Minutes" 1800)
(integer :tag "Seconds")))
;; The slots below correspond with the `auth-source-search' spec,
;; so a backend with :host set, for instance, would match only
;; searches for that host. Normally they are nil.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defclass auth-source-backend ()
((type :initarg :type
:initform 'netrc
:type symbol
:custom symbol
:documentation "The backend type.")
(source :initarg :source
:type string
:custom string
:documentation "The backend source.")
(host :initarg :host
:initform t
:type t
:custom string
:documentation "The backend host.")
(user :initarg :user
:initform t
:type t
:custom string
:documentation "The backend user.")
(port :initarg :port
:initform t
:type t
:custom string
:documentation "The backend protocol.")
(data :initarg :data
:initform nil
:documentation "Internal backend data.")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(create-function :initarg :create-function
EIEIO: Promote the CLOS behavior over the EIEIO-specific behavior Change docs to advertize `slot-value` rather than `oref`. Change the implementation of `:initform` to better match the CLOS semantics, while preserving the EIEIO semantics, but warn when encountering cases where the two diverge. Demote the mostly unused special semantics of `oref-default` on non-class allocated slots. * doc/misc/eieio.texi (Quick Start): Use `slot-value`. (Accessing Slots): Move `slot-value` before `oref`. Fix paren-typo in example (reported by pillule <pillule@riseup.net>). (Introspection): Remove mention of `class-slot-initarg`. * lisp/transient.el (transient--parse-group, transient--parse-suffix): Don't use `oref-default` to get the default value. (transient-lisp-variable): Init forms are evaluated. * lisp/emacs-lisp/eieio.el (defclass): Warn about inapplicable `:initarg` and about uses of init forms that are ambiguous. (oref): Don't advertize the deprecated use of initargs as slot names. (oref-default): Don't advertize the deprecated case where it returns the initform's value. (initialize-instance): Use `macroexp-const-p`. * lisp/emacs-lisp/eieio-core.el (eieio--unbound): Rename from `eieio-unbound`. (eieio--unbound-form): New var. (eieio--slot-override): Use it. (eieio-defclass-internal): Use it. Change `init` so it should always be evaluated. (eieio--known-class-slot-names): New var. (eieio--eval-default-p): Rename from `eieio-eval-default-p`. (eieio--perform-slot-validation-for-default): Use `macroexp-const-p` to decide whether to skip the test. (eieio--add-new-slot): Register slot in `eieio--known-class-slot-names` when applicable. (eieio-oref-default, eieio-oset-default): Add warning for unknown slots and slots not known to be allocated to the class. (eieio-default-eval-maybe): Delete function. Use just `eval` instead. (eieio-declare-slots): Allow slots to specify their allocation class. * lisp/cedet/srecode/insert.el (point): Declare the slot instead of moving the class definition before the slot's first use. (srecode-template-inserter-point, srecode-insert-fcn): Use nil instead of unbound for the `point` slot. * lisp/cedet/srecode/compile.el (srecode-template-inserter): Declare the `key` slot that all children should have. * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar) (eieio-speedbar-directory-button, eieio-speedbar-file-button): * lisp/emacs-lisp/eieio-custom.el (eieio-widget-test-class): * lisp/emacs-lisp/chart.el (chart-bar): * lisp/cedet/semantic/ede-grammar.el (semantic-ede-proj-target-grammar): * lisp/cedet/semantic/db.el (semanticdb-project-database): * lisp/cedet/semantic/db-javascript.el (semanticdb-table-javascript) (semanticdb-project-database-javascript): * lisp/cedet/semantic/db-el.el (semanticdb-table-emacs-lisp) (semanticdb-project-database-emacs-lisp): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-table-ebrowse) (semanticdb-project-database-ebrowse): * lisp/cedet/ede/proj.el (ede-proj-project): * lisp/cedet/ede/proj-obj.el (ede-proj-target-makefile-objectcode): * lisp/cedet/ede/generic.el (ede-generic-project): * lisp/cedet/ede/config.el (ede-project-with-config): * lisp/cedet/ede/base.el (ede-target, ede-project): * lisp/auth-source.el (auth-source-backend): Init forms are evaluated, so quote them accordingly.
2021-06-12 20:22:03 +00:00
:initform #'ignore
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:type function
:custom function
:documentation "The create function.")
(search-function :initarg :search-function
EIEIO: Promote the CLOS behavior over the EIEIO-specific behavior Change docs to advertize `slot-value` rather than `oref`. Change the implementation of `:initform` to better match the CLOS semantics, while preserving the EIEIO semantics, but warn when encountering cases where the two diverge. Demote the mostly unused special semantics of `oref-default` on non-class allocated slots. * doc/misc/eieio.texi (Quick Start): Use `slot-value`. (Accessing Slots): Move `slot-value` before `oref`. Fix paren-typo in example (reported by pillule <pillule@riseup.net>). (Introspection): Remove mention of `class-slot-initarg`. * lisp/transient.el (transient--parse-group, transient--parse-suffix): Don't use `oref-default` to get the default value. (transient-lisp-variable): Init forms are evaluated. * lisp/emacs-lisp/eieio.el (defclass): Warn about inapplicable `:initarg` and about uses of init forms that are ambiguous. (oref): Don't advertize the deprecated use of initargs as slot names. (oref-default): Don't advertize the deprecated case where it returns the initform's value. (initialize-instance): Use `macroexp-const-p`. * lisp/emacs-lisp/eieio-core.el (eieio--unbound): Rename from `eieio-unbound`. (eieio--unbound-form): New var. (eieio--slot-override): Use it. (eieio-defclass-internal): Use it. Change `init` so it should always be evaluated. (eieio--known-class-slot-names): New var. (eieio--eval-default-p): Rename from `eieio-eval-default-p`. (eieio--perform-slot-validation-for-default): Use `macroexp-const-p` to decide whether to skip the test. (eieio--add-new-slot): Register slot in `eieio--known-class-slot-names` when applicable. (eieio-oref-default, eieio-oset-default): Add warning for unknown slots and slots not known to be allocated to the class. (eieio-default-eval-maybe): Delete function. Use just `eval` instead. (eieio-declare-slots): Allow slots to specify their allocation class. * lisp/cedet/srecode/insert.el (point): Declare the slot instead of moving the class definition before the slot's first use. (srecode-template-inserter-point, srecode-insert-fcn): Use nil instead of unbound for the `point` slot. * lisp/cedet/srecode/compile.el (srecode-template-inserter): Declare the `key` slot that all children should have. * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar) (eieio-speedbar-directory-button, eieio-speedbar-file-button): * lisp/emacs-lisp/eieio-custom.el (eieio-widget-test-class): * lisp/emacs-lisp/chart.el (chart-bar): * lisp/cedet/semantic/ede-grammar.el (semantic-ede-proj-target-grammar): * lisp/cedet/semantic/db.el (semanticdb-project-database): * lisp/cedet/semantic/db-javascript.el (semanticdb-table-javascript) (semanticdb-project-database-javascript): * lisp/cedet/semantic/db-el.el (semanticdb-table-emacs-lisp) (semanticdb-project-database-emacs-lisp): * lisp/cedet/semantic/db-ebrowse.el (semanticdb-table-ebrowse) (semanticdb-project-database-ebrowse): * lisp/cedet/ede/proj.el (ede-proj-project): * lisp/cedet/ede/proj-obj.el (ede-proj-target-makefile-objectcode): * lisp/cedet/ede/generic.el (ede-generic-project): * lisp/cedet/ede/config.el (ede-project-with-config): * lisp/cedet/ede/base.el (ede-target, ede-project): * lisp/auth-source.el (auth-source-backend): Init forms are evaluated, so quote them accordingly.
2021-06-12 20:22:03 +00:00
:initform #'ignore
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:type function
:custom function
:documentation "The search function.")))
(defcustom auth-source-protocols '((imap "imap" "imaps" "143" "993")
(pop3 "pop3" "pop" "pop3s" "110" "995")
(ssh "ssh" "22")
(sftp "sftp" "115")
(smtp "smtp" "25"))
lisp/*.el: Fix typos and other trivial doc fixes * lisp/allout-widgets.el (allout-widgets-auto-activation) (allout-current-decorated-p): * lisp/auth-source.el (auth-source-protocols): * lisp/autorevert.el (auto-revert-set-timer): * lisp/battery.el (battery-mode-line-limit): * lisp/calc/calcalg3.el (math-map-binop): * lisp/calendar/cal-dst.el (calendar-dst-find-startend): * lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute): * lisp/calendar/calendar.el (calendar-date-echo-text) (calendar-generate-month, calendar-string-spread) (calendar-cursor-to-date, calendar-read, calendar-read-date) (calendar-mark-visible-date, calendar-dayname-on-or-before): * lisp/calendar/diary-lib.el (diary-ordinal-suffix): * lisp/cedet/ede/autoconf-edit.el (autoconf-new-program) (autoconf-find-last-macro, autoconf-parameter-strip): * lisp/cedet/ede/config.el (ede-target-with-config-build): * lisp/cedet/ede/linux.el (ede-linux--detect-architecture) (ede-linux--get-architecture): * lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache) (semantic-displayer-abstract, semantic-displayer-point-position): * lisp/cedet/semantic/format.el (semantic-format-face-alist) (semantic-format-tag-short-doc): * lisp/cedet/semantic/fw.el (semantic-find-file-noselect): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time) (semantic-idle-breadcrumbs-display-function) (semantic-idle-breadcrumbs-format-tag-list-function): * lisp/cedet/semantic/lex.el (semantic-lex-map-types) (define-lex, define-lex-block-type-analyzer): * lisp/cedet/semantic/senator.el (senator-search-default-tag-filter): * lisp/cedet/semantic/symref.el (semantic-symref-result) (semantic-symref-hit-to-tag-via-db): * lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass): * lisp/cedet/semantic/tag.el (semantic-tag-new-variable) (semantic-tag-new-include, semantic-tag-new-package) (semantic-tag-set-faux, semantic-create-tag-proxy) (semantic-tag-function-parent) (semantic-tag-components-with-overlays): * lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces) (srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict): * lisp/cedet/srecode/dictionary.el (srecode-create-dictionary) (srecode-dictionary-add-entries, srecode-dictionary-lookup-name) (srecode-create-dictionaries-from-tags): * lisp/cmuscheme.el (scheme-compile-region): * lisp/color.el (color-lab-to-lch): * lisp/doc-view.el (doc-view-image-width) (doc-view-set-up-single-converter): * lisp/dynamic-setting.el (font-setting-change-default-font) (dynamic-setting-handle-config-changed-event): * lisp/elec-pair.el (electric-pair-text-pairs) (electric-pair-skip-whitespace-function) (electric-pair-string-bound-function): * lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance) (avl-tree-member, avl-tree-mapcar, avl-tree-iter): * lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree): * lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag) (checkdoc-spellcheck-documentation-flag, checkdoc-ispell) (checkdoc-ispell-current-buffer, checkdoc-ispell-interactive) (checkdoc-ispell-message-interactive) (checkdoc-ispell-message-text, checkdoc-ispell-start) (checkdoc-ispell-continue, checkdoc-ispell-comments) (checkdoc-ispell-defun): * lisp/emacs-lisp/cl-generic.el (cl--generic-search-method): * lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group): * lisp/emacs-lisp/lisp.el (forward-sexp, up-list): * lisp/emacs-lisp/package-x.el (package--archive-contents-from-file): * lisp/emacs-lisp/package.el (package-desc) (package--make-autoloads-and-stuff, package-hidden-regexps): * lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup): * lisp/emacs-lisp/testcover.el (testcover-nohits) (testcover-1value): * lisp/epg.el (epg-receive-keys, epg-start-edit-key): * lisp/erc/erc-backend.el (erc-server-processing-p) (erc-split-line-length, erc-server-coding-system) (erc-server-send, erc-message): * lisp/erc/erc-button.el (erc-button-face, erc-button-alist) (erc-browse-emacswiki): * lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login): * lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation): * lisp/erc/erc-log.el (erc-current-logfile): * lisp/erc/erc-match.el (erc-log-match-format) (erc-text-matched-hook): * lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug): * lisp/erc/erc-networks.el (erc-server-alist) (erc-networks-alist, erc-current-network): * lisp/erc/erc-ring.el (erc-input-ring-index): * lisp/erc/erc-speedbar.el (erc-speedbar) (erc-speedbar-update-channel): * lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag): * lisp/erc/erc-track.el (erc-track-position-in-mode-line) (erc-track-remove-from-mode-line, erc-modified-channels-update) (erc-track-last-non-erc-buffer, erc-track-sort-by-importance) (erc-track-get-active-buffer): * lisp/erc/erc.el (erc-get-channel-user-list) (erc-echo-notice-hook, erc-echo-notice-always-hook) (erc-wash-quit-reason, erc-format-@nick): * lisp/ffap.el (ffap-latex-mode): * lisp/files.el (abort-if-file-too-large) (dir-locals--get-sort-score, buffer-stale--default-function): * lisp/filesets.el (filesets-tree-max-level, filesets-data) (filesets-update-pre010505): * lisp/gnus/gnus-agent.el (gnus-agent-flush-cache): * lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol) (gnus-button-prefer-mid-or-mail): * lisp/gnus/gnus-cus.el (gnus-group-parameters): * lisp/gnus/gnus-demon.el (gnus-demon-handlers) (gnus-demon-run-callback): * lisp/gnus/gnus-dired.el (gnus-dired-print): * lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer): * lisp/gnus/gnus-range.el (gnus-range-normalize): * lisp/gnus/gnus-spec.el (gnus-pad-form): * lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud) (gnus-server-opened, gnus-server-closed, gnus-server-denied) (gnus-server-offline): * lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir) (gnus-refer-thread-limit-to-thread) (gnus-summary-limit-include-thread, gnus-summary-refer-thread) (gnus-summary-find-matching): * lisp/gnus/gnus-util.el (gnus-rescale-image): * lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server): * lisp/gnus/mail-source.el (mail-source-incoming-file-prefix): * lisp/gnus/message.el (message-cite-reply-position) (message-cite-style-outlook, message-cite-style-thunderbird) (message-cite-style-gmail, message--send-mail-maybe-partially): * lisp/gnus/mm-extern.el (mm-inline-external-body): * lisp/gnus/mm-partial.el (mm-inline-partial): * lisp/gnus/mml-sec.el (mml-secure-message-sign) (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): * lisp/gnus/mml2015.el (mml2015-epg-key-image) (mml2015-epg-key-image-to-string): * lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail): * lisp/gnus/nnheader.el (nnheader-directory-files-is-safe): * lisp/gnus/nnir.el (nnir-search-history) (nnir-imap-search-other, nnir-artlist-length) (nnir-artlist-article, nnir-artitem-group, nnir-artitem-number) (nnir-artitem-rsv, nnir-article-group, nnir-article-number) (nnir-article-rsv, nnir-article-ids, nnir-categorize) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-hyrex-additional-switches) (gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms) (nnir-read-parm, nnir-read-server-parm, nnir-search-thread): * lisp/gnus/nnmairix.el (nnmairix-default-group) (nnmairix-propagate-marks): * lisp/gnus/smime.el (smime-keys, smime-crl-check) (smime-verify-buffer, smime-noverify-buffer): * lisp/gnus/spam-report.el (spam-report-url-ping-mm-url): * lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header) (spam-spamassassin-spam-status-header, spam-sa-learn-rebuild) (spam-classifications, spam-check-stat, spam-spamassassin-score): * lisp/help.el (describe-minor-mode-from-symbol): * lisp/hippie-exp.el (hippie-expand-ignore-buffers): * lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face) (hfy-begin-span): * lisp/ibuf-ext.el (ibuffer-update-saved-filters-format) (ibuffer-saved-filters, ibuffer-old-saved-filters-warning) (ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters) (eval, ibuffer-unary-operand, file-extension, directory): * lisp/image-dired.el (image-dired-cmd-pngcrush-options): * lisp/image-mode.el (image-toggle-display): * lisp/international/ccl.el (ccl-compile-read-multibyte-character) (ccl-compile-write-multibyte-character): * lisp/international/kkc.el (kkc-save-init-file): * lisp/international/latin1-disp.el (latin1-display): * lisp/international/ogonek.el (ogonek-name-encoding-alist) (ogonek-information, ogonek-lookup-encoding) (ogonek-deprefixify-region): * lisp/isearch.el (isearch-filter-predicate) (isearch--momentary-message): * lisp/jsonrpc.el (jsonrpc-connection-send) (jsonrpc-process-connection, jsonrpc-shutdown) (jsonrpc--async-request-1): * lisp/language/tibet-util.el (tibetan-char-p): * lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date) (feedmail-last-chance-hook, feedmail-before-fcc-hook) (feedmail-send-it-immediately-wrapper, feedmail-find-eoh): * lisp/mail/hashcash.el (hashcash-generate-payment) (hashcash-generate-payment-async, hashcash-insert-payment) (hashcash-verify-payment): * lisp/mail/rmail.el (rmail-movemail-variant-in-use) (rmail-get-attr-value): * lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime): * lisp/mail/rmailsum.el (rmail-summary-show-message): * lisp/mail/supercite.el (sc-raw-mode-toggle): * lisp/man.el (Man-start-calling): * lisp/mh-e/mh-acros.el (mh-do-at-event-location) (mh-iterate-on-messages-in-region, mh-iterate-on-range): * lisp/mh-e/mh-alias.el (mh-alias-system-aliases) (mh-alias-reload, mh-alias-ali) (mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file) (mh-alias-add-alias): * lisp/mouse.el (mouse-save-then-kill): * lisp/net/browse-url.el (browse-url-default-macosx-browser): * lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value) (eudc-variable-server-value, eudc-update-variable) (eudc-expand-inline): * lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result): * lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list): * lisp/net/pop3.el (pop3-list): * lisp/net/soap-client.el (soap-namespace-put) (soap-xs-parse-sequence, soap-parse-envelope): * lisp/net/soap-inspect.el (soap-inspect-xs-complex-type): * lisp/nxml/rng-xsd.el (rng-xsd-date-to-days): * lisp/org/ob-C.el (org-babel-prep-session:C) (org-babel-load-session:C): * lisp/org/ob-J.el (org-babel-execute:J): * lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote): * lisp/org/ob-awk.el (org-babel-execute:awk): * lisp/org/ob-core.el (org-babel-process-file-name): * lisp/org/ob-ebnf.el (org-babel-execute:ebnf): * lisp/org/ob-forth.el (org-babel-execute:forth): * lisp/org/ob-fortran.el (org-babel-execute:fortran) (org-babel-prep-session:fortran, org-babel-load-session:fortran): * lisp/org/ob-groovy.el (org-babel-execute:groovy): * lisp/org/ob-io.el (org-babel-execute:io): * lisp/org/ob-js.el (org-babel-execute:js): * lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond) (org-babel-lilypond-compile-post-tangle) (org-babel-lilypond-display-pdf-post-tangle) (org-babel-lilypond-tangle) (org-babel-lilypond-execute-tangled-ly) (org-babel-lilypond-compile-lilyfile) (org-babel-lilypond-check-for-compile-error) (org-babel-lilypond-process-compile-error) (org-babel-lilypond-mark-error-line) (org-babel-lilypond-parse-error-line) (org-babel-lilypond-attempt-to-open-pdf) (org-babel-lilypond-attempt-to-play-midi) (org-babel-lilypond-switch-extension) (org-babel-lilypond-set-header-args): * lisp/org/ob-lua.el (org-babel-prep-session:lua): * lisp/org/ob-picolisp.el (org-babel-execute:picolisp): * lisp/org/ob-processing.el (org-babel-prep-session:processing): * lisp/org/ob-python.el (org-babel-prep-session:python): * lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message) (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): * lisp/org/ob-shen.el (org-babel-execute:shen): * lisp/org/org-agenda.el (org-agenda-entry-types) (org-agenda-move-date-from-past-immediately-to-today) (org-agenda-time-grid, org-agenda-sorting-strategy) (org-agenda-filter-by-category, org-agenda-forward-block): * lisp/org/org-colview.el (org-columns--overlay-text): * lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces): * lisp/org/org-indent.el (org-indent-set-line-properties): * lisp/org/org-macs.el (org-get-limited-outline-regexp): * lisp/org/org-mobile.el (org-mobile-files): * lisp/org/org.el (org-use-fast-todo-selection) (org-extend-today-until, org-use-property-inheritance) (org-refresh-effort-properties, org-open-at-point-global) (org-track-ordered-property-with-tag, org-shiftright): * lisp/org/ox-html.el (org-html-checkbox-type): * lisp/org/ox-man.el (org-man-source-highlight) (org-man-verse-block): * lisp/org/ox-publish.el (org-publish-sitemap-default): * lisp/outline.el (outline-head-from-level): * lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1) (dcl-calc-command-indent, dcl-indent-to): * lisp/progmodes/flymake.el (flymake-make-diagnostic) (flymake--overlays, flymake-diagnostic-functions) (flymake-diagnostic-types-alist, flymake--backend-state) (flymake-is-running, flymake--collect, flymake-mode): * lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop) (gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer): * lisp/progmodes/grep.el (grep-error-screen-columns): * lisp/progmodes/gud.el (gud-prev-expr): * lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column) (ps-run-goto-error): * lisp/progmodes/python.el (python-eldoc-get-doc) (python-eldoc-function-timeout-permanent, python-eldoc-function): * lisp/shadowfile.el (shadow-make-group): * lisp/speedbar.el (speedbar-obj-do-check): * lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook): * lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib): * lisp/textmodes/reftex-index.el (reftex-index-goto-entry) (reftex-index-kill, reftex-index-undo): * lisp/textmodes/reftex-parse.el (reftex-context-substring): * lisp/textmodes/reftex.el (reftex-TeX-master-file): * lisp/textmodes/rst.el (rst-next-hdr, rst-toc) (rst-uncomment-region, rst-font-lock-extend-region-internal): * lisp/thumbs.el (thumbs-mode): * lisp/vc/ediff-util.el (ediff-restore-diff): * lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag): * lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p): * lisp/wid-edit.el (widget-field-value-set, string): * lisp/x-dnd.el (x-dnd-version-from-flags) (x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-20 22:27:53 +00:00
"List of authentication protocols and their names."
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
:version "23.2" ;; No Gnus
:type '(repeat :tag "Authentication Protocols"
(cons :tag "Protocol Entry"
(symbol :tag "Protocol")
(repeat :tag "Names"
(string :tag "Name")))))
;; Generate all the protocols in a format Customize can use.
;; TODO: generate on the fly from auth-source-protocols
(defconst auth-source-protocols-customize
(mapcar (lambda (a)
(let ((p (car-safe a)))
(list 'const
:tag (upcase (symbol-name p))
p)))
auth-source-protocols))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defvar auth-source-creation-defaults nil
;; FIXME: AFAICT this is not set (or let-bound) anywhere!
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Defaults for creating token values. Usually let-bound.")
(defvar auth-source-creation-prompts nil
"Default prompts for token values. Usually let-bound.")
(defcustom auth-source-save-behavior 'ask
"If set, auth-source will respect it for save behavior."
:version "23.2" ;; No Gnus
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 00:22:15 +00:00
:type '(choice
:tag "auth-source new token save behavior"
(const :tag "Always save" t)
(const :tag "Never save" nil)
(const :tag "Ask" ask)))
;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car epa-file-auto-mode-alist-entry) "\\.gpg\\'") never) (t gpg)))
;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never)
(defcustom auth-source-netrc-use-gpg-tokens 'never
"Set this to tell `auth-source' when to create GPG password
tokens in netrc files. It's either an alist or `never'.
Note that if EPA/EPG is not available, this should NOT be used."
:version "23.2" ;; No Gnus
:type `(choice
(const :tag "Always use GPG password tokens" (t gpg))
(const :tag "Never use GPG password tokens" never)
(repeat :tag "Use a lookup list"
(list
(choice :tag "Matcher"
(const :tag "Match anything" t)
(const :tag "The EPA encrypted file extensions"
,(if (boundp 'epa-file-auto-mode-alist-entry)
(car epa-file-auto-mode-alist-entry)
"\\.gpg\\'"))
(regexp :tag "Regular expression"))
(choice :tag "What to do"
(const :tag "Save GPG-encrypted password tokens" gpg)
(const :tag "Don't encrypt tokens" never))))))
(defcustom auth-source-do-cache t
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Whether auth-source should cache information with `password-cache'."
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
:version "23.2" ;; No Gnus
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 00:22:15 +00:00
:type 'boolean)
(defcustom auth-source-debug nil
"Whether auth-source should log debug messages.
If the value is nil, debug messages are not logged.
If the value is t, debug messages are logged with `message'. In
that case, your authentication data will be in the clear (except
for passwords).
If the value is a function, debug messages are logged by calling
that function using the same arguments as `message'."
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
:version "23.2" ;; No Gnus
Replace insignificant backquotes Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
2018-11-05 00:22:15 +00:00
:type '(choice
:tag "auth-source debugging mode"
(const :tag "Log using `message' to the *Messages* buffer" t)
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(const :tag "Log all trivia with `message' to the *Messages* buffer"
trivia)
(function :tag "Function that takes arguments like `message'")
(const :tag "Don't log anything" nil)))
(defcustom auth-sources '("~/.authinfo" "~/.authinfo.gpg" "~/.netrc")
"List of authentication sources.
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
Each entry is the authentication type with optional properties.
Entries are tried in the order in which they appear.
See Info node `(auth)Help for users' for details.
Synch with Gnus trunk ===================== 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (canlock-verify): Autoload it for Emacs 21. * message.el (ecomplete-setup): Autoload it for Emacs <23. * mml-sec.el (mml-secure-cache-passphrase): Default to t that is password-cache's default if it is not bound. (mml-secure-passphrase-cache-expiry): Default to 16 that is password-cache-expiry's default if it is not bound. * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not available in Emacs 21. 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el (auth-sources): Fix up definition so extra parameters are always inline. 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity wasn't updated after mismatch. Clear cached mailbox info correctly when uidvalidity changes. (nnimap-group-prefixed-name): New function to avoid some code duplication. (nnimap-verify-uidvalidity, nnimap-group-overview-filename) (nnimap-request-group): Use it. (nnimap-retrieve-groups, nnimap-verify-uidvalidity) (nnimap-update-unseen): Significantly improved speed of Gnus startup with many imap folders. This is done by caching the group status from the imap server persistently in a group parameter `imap-status'. (This was cached before too if `nnimap-retrieve-groups-asynchronous' was set, but not persistently, so every Gnus startup was still very slow.) 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * auth-source.el: Set up autoloads. Bump to 23.2 because of the secrets.el dependency. (auth-sources): Add optional user name. Add secrets.el configuration choice (unused right now). 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> * gnus-sum.el (gnus-summary-make-menu-bar): Let `gnus-registry-install-shortcuts' fill in the functions. * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid warnings. (gnus-registry-misc-menus): Variable to hold registry mark menus. (gnus-registry-install-shortcuts): Populate and use it in a `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): In-place substitutions for the group name encoding/decoding. (nnimap-find-minmax-uid, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) (nnimap-retrieve-headers-progress, nnimap-request-article-part) (nnimap-update-unseen, nnimap-request-list) (nnimap-retrieve-groups, nnimap-request-update-info-internal) (nnimap-request-set-mark, nnimap-split-to-groups) (nnimap-split-articles, nnimap-request-newgroups) (nnimap-request-create-group, nnimap-request-accept-article) (nnimap-request-delete-group, nnimap-request-rename-group) (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with `encoded-mbx' for consistency. (nnimap-close-group): Call `imap-current-mailbox' instead of using the variable `imap-current-mailbox'. * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> * pop3.el (pop3-display-message-size-flag): Display message size byte counts during POP3 download. (pop3-movemail): Use it. (pop3-list): Implement listing of available messages. 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) * nnir.el (nnir-get-article-nov-override-function): New function to override the normal NOV retrieval. (nnir-retrieve-headers): Use it.
2010-03-23 07:37:09 +00:00
If an entry names a file with the \".gpg\" extension and you have
EPA/EPG set up, the file will be encrypted and decrypted
automatically. See Info node `(epa)Encrypting/decrypting gpg files'
for details.
doc: Delete extraneous quotes around keys * lisp/allout.el (allout-outlinify-sticky): * lisp/auth-source.el (auth-sources): * lisp/buff-menu.el (Buffer-menu-delete) (Buffer-menu-delete-backwards, Buffer-menu-save) (Buffer-menu-execute, Buffer-menu-select): * lisp/calendar/todo-mode.el (todo-show) (todo-show-categories-table, todo-top-priorities-overrides): * lisp/desktop.el (desktop-save-mode): * lisp/dired-aux.el (dired-do-kill-lines, dired-do-copy): * lisp/edmacro.el (edit-kbd-macro): * lisp/emulation/viper-cmd.el (viper-ask-level): * lisp/emulation/viper-init.el (viper-expert-level): * lisp/filesets.el (filesets-add-buffer): * lisp/follow.el (follow-mode): * lisp/gnus/gnus-group.el (gnus-group-mode): * lisp/gnus/gnus-sum.el (gnus-summary-mode): * lisp/ibuffer.el (ibuffer-mode): * lisp/international/ogonek.el (ogonek-informacja) (ogonek-information): * lisp/isearch.el (search-default-mode): * lisp/macros.el (apply-macro-to-region-lines): * lisp/mail/supercite.el (sc-mail-field-query) (sc-insert-reference, sc-insert-citation): * lisp/play/decipher.el (decipher-make-checkpoint): (decipher-restore-checkpoint): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-store-inquired-class): * lisp/progmodes/prolog.el (prolog-mode, prolog-inferior-mode): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist) (vhdl-modify-date-prefix-string) (vhdl-modify-date-on-saving, vhdl-mode): * lisp/server.el (server-start): * lisp/subr.el (locate-library): * lisp/tempo.el (tempo-marks, tempo-use-tag-list): * lisp/time.el (world-clock): * lisp/vc/vc-hooks.el (vc-mode): * lisp/whitespace.el (whitespace-report-region): * lisp/windmove.el (windmove-delete-in-direction): Doc fix: Delete extraneous quotes around keys.
2024-01-21 13:09:21 +00:00
It's best to customize this with \\[customize-variable] because
the choices can get pretty complex."
:version "26.1" ; neither new nor changed default
:type `(repeat :tag "Authentication Sources"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(choice
(string :tag "Just a file")
(const :tag "Default Secrets API Collection" default)
(const :tag "Login Secrets API Collection" "secrets:Login")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(const :tag "Temp Secrets API Collection" "secrets:session")
(const :tag "Default internet Mac OS Keychain"
macos-keychain-internet)
(const :tag "Default generic Mac OS Keychain"
macos-keychain-generic)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(list :tag "Source definition"
(const :format "" :value :source)
(choice :tag "Authentication backend choice"
(string :tag "Authentication Source (file)")
(list
:tag "Secret Service API/KWallet/GNOME Keyring/KeyPassXC"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(const :format "" :value :secrets)
(choice :tag "Collection to use"
(string :tag "Collection name")
(const :tag "Default" default)
(const :tag "Login" "Login")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(const
:tag "Temporary" "session")))
(list
:tag "Mac OS internet Keychain"
(const :format ""
:value :macos-keychain-internet)
(choice :tag "Collection to use"
(string :tag "internet Keychain path")
(const :tag "default" default)))
(list
:tag "Mac OS generic Keychain"
(const :format ""
:value :macos-keychain-generic)
(choice :tag "Collection to use"
(string :tag "generic Keychain path")
(const :tag "default" default))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(repeat :tag "Extra Parameters" :inline t
(choice :tag "Extra parameter"
:value (:host t)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(list
:tag "Host" :inline t
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(const :format "" :value :host)
(choice :tag "Host (machine) choice"
(const :tag "Any" t)
(regexp
:tag "Regular expression")))
(list
:tag "Protocol" :inline t
(const :format "" :value :port)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(choice
:tag "Protocol"
(const :tag "Any" t)
,@auth-source-protocols-customize))
(list :tag "User" :inline t
(const :format "" :value :user)
(choice
:tag "Personality/Username"
(const :tag "Any" t)
(string
:tag "Name"))))))
(sexp :tag "A data structure (external provider)"))))
(defcustom auth-source-gpg-encrypt-to t
"List of recipient keys that `authinfo.gpg' encrypted to.
If the value is not a list, symmetric encryption will be used."
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:version "24.1" ;; No Gnus
:type '(choice (const :tag "Symmetric encryption" t)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(repeat :tag "Recipient public keys"
(string :tag "Recipient public key"))))
(defun auth-source-do-debug (&rest msg)
(when auth-source-debug
(apply #'auth-source-do-warn msg)))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(defun auth-source-do-trivia (&rest msg)
(when (or (eq auth-source-debug 'trivia)
(functionp auth-source-debug))
(apply #'auth-source-do-warn msg)))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(defun auth-source-do-warn (&rest msg)
(apply
;; set logger to either the function in auth-source-debug or 'message
;; note that it will be 'message if auth-source-debug is nil
(if (functionp auth-source-debug)
auth-source-debug
'message)
msg))
(defun auth-source-read-char-choice (prompt choices)
"Read one of CHOICES by `read-char-choice', or `read-char'.
Only one of CHOICES will be returned. The PROMPT is augmented
Fix several backslash typos in Elisp strings * lisp/calendar/todo-mode.el (todo-files, todo-rename-file) (todo-find-filtered-items-file, todo-reset-nondiary-marker) (todo-reset-done-string, todo-reset-comment-string) (todo-reset-highlight-item): * lisp/erc/erc-networks.el (erc-networks-alist): * lisp/gnus/gnus-art.el (gnus-button-handle-library): * lisp/gnus/gnus-group.el (gnus-read-ephemeral-gmane-group-url): * lisp/gnus/nntp.el (nntp-via-shell-prompt) (nntp-telnet-shell-prompt): * lisp/gnus/spam-report.el (spam-report-gmane-regex): * lisp/image-dired.el (image-dired-rotate-original): (image-dired-get-exif-file-name): * lisp/international/latin1-disp.el (latin1-display-ucs-per-lynx): * lisp/mail/undigest.el (rmail-digest-parse-rfc1153strict): * lisp/mh-e/mh-letter.el (mh-file-is-vcard-p): * lisp/mh-e/mh-mime.el (mh-file-mime-type-substitutions): * lisp/net/shr-color.el (shr-color->hexadecimal): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-docview.el (org-docview-export): * lisp/org/org-entities.el (org-entities): * lisp/org/ox-icalendar.el (org-icalendar-cleanup-string): * lisp/progmodes/cperl-mode.el (cperl-indent-exp): * lisp/progmodes/ebnf2ps.el (ebnf-file-suffix-regexp) (ebnf-style-database): * lisp/progmodes/idlw-help.el (idlwave-do-context-help1): * lisp/progmodes/ruby-mode.el (ruby-imenu-create-index-in-block): * lisp/progmodes/sql.el (sql-product-alist): * lisp/progmodes/verilog-mode.el (verilog-error-regexp-emacs-alist) (verilog-error-font-lock-keywords) (verilog-assignment-operator-re): * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): * lisp/textmodes/reftex-parse.el (reftex-parse-from-file): * lisp/vc/add-log.el (change-log-version-number-regexp-list): Fix typo by replacing ‘\’ with ‘\\’ in a string literal. For example, to get the regular expression ‘\.’ use the string literal "\\.", not "\." (which is equivalent to "."). * lisp/emulation/viper-util.el (viper-glob-unix-files): Remove stray ‘\j’ from string. * lisp/gnus/nntp.el (nntp-via-shell-prompt) (nntp-telnet-shell-prompt): Treat > like $ when matching a shell prompt. * lisp/progmodes/make-mode.el (makefile-browse): Properly quote a diagnostic.
2015-09-17 19:28:45 +00:00
with \"[a/b/c] \" if CHOICES is \(?a ?b ?c)."
(when choices
(let* ((prompt-choices
(apply #'concat
(cl-loop for c in choices collect (format "%c/" c))))
(prompt-choices (concat "[" (substring prompt-choices 0 -1) "] "))
(full-prompt (concat prompt prompt-choices))
k)
(while (not (memq k choices))
(setq k (read-char-choice full-prompt choices)))
k)))
(defvar auth-source-backend-parser-functions nil
"List of auth-source parser functions.
Each function takes an entry from `auth-sources' as parameter and
returns a backend or nil if the entry is not supported. Add a
parser function to this list with `add-hook'. Searching for a
backend starts with the first element on the list and stops as
soon as a function returns non-nil.")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-backend-parse (entry)
"Create an `auth-source-backend' from an ENTRY in `auth-sources'."
(let ((backend
(run-hook-with-args-until-success 'auth-source-backend-parser-functions
entry)))
(unless backend
;; none of the parsers worked
(auth-source-do-warn
"auth-source-backend-parse: invalid backend spec: %S" entry)
(setq backend (make-instance 'auth-source-backend
:source ""
:type 'ignore)))
(auth-source-backend-parse-parameters entry backend)))
(defun auth-source-backends-parser-file (entry)
;; take just a file name use it as a netrc/plist file
;; matching any user, host, and protocol
(when (stringp entry)
(setq entry (list :source entry)))
(let* ((source (plist-get entry :source))
(source-without-gpg
(if (and (stringp source)
(equal (file-name-extension source) "gpg"))
(file-name-sans-extension source)
(or source "")))
(extension (or (and (stringp source-without-gpg)
(file-name-extension source-without-gpg))
"")))
(when (stringp source)
(cond
((equal extension "plist")
(auth-source-backend
:source source
:type 'plstore
:search-function #'auth-source-plstore-search
:create-function #'auth-source-plstore-create
:data (plstore-open source)))
((member-ignore-case extension '("json"))
(auth-source-backend
:source source
:type 'json
:search-function #'auth-source-json-search))
(t
(auth-source-backend
:source source
:type 'netrc
:search-function #'auth-source-netrc-search
:create-function #'auth-source-netrc-create))))))
;; Note this function should be last in the parser functions, so we add it first
(add-hook 'auth-source-backend-parser-functions #'auth-source-backends-parser-file)
(defun auth-source-backends-parser-macos-keychain (entry)
;; take macos-keychain-{internet,generic}:XYZ and use it as macOS
;; Keychain "XYZ" matching any user, host, and protocol
(when (and (stringp entry) (string-match "^macos-keychain-internet:\\(.+\\)"
entry))
(setq entry `(:source (:macos-keychain-internet
,(match-string 1 entry)))))
(when (and (stringp entry) (string-match "^macos-keychain-generic:\\(.+\\)"
entry))
(setq entry `(:source (:macos-keychain-generic
,(match-string 1 entry)))))
;; take 'macos-keychain-internet or generic and use it as a Mac OS
;; Keychain collection matching any user, host, and protocol
(when (eq entry 'macos-keychain-internet)
(setq entry '(:source (:macos-keychain-internet default))))
(when (eq entry 'macos-keychain-generic)
(setq entry '(:source (:macos-keychain-generic default))))
(cond
;; the macOS Keychain
((and
(not (null (plist-get entry :source))) ; the source must not be nil
(listp (plist-get entry :source)) ; and it must be a list
(or
(plist-get (plist-get entry :source) :macos-keychain-generic)
(plist-get (plist-get entry :source) :macos-keychain-internet)))
(let* ((source-spec (plist-get entry :source))
(keychain-generic (plist-get source-spec :macos-keychain-generic))
(keychain-type (if keychain-generic
'macos-keychain-generic
'macos-keychain-internet))
(source (plist-get source-spec (if keychain-generic
:macos-keychain-generic
:macos-keychain-internet))))
(when (symbolp source)
(setq source (symbol-name source)))
(auth-source-backend
:source source
:type keychain-type
:search-function #'auth-source-macos-keychain-search
:create-function #'auth-source-macos-keychain-create)))))
(add-hook 'auth-source-backend-parser-functions #'auth-source-backends-parser-macos-keychain)
(defun auth-source-backends-parser-secrets (entry)
;; take secrets:XYZ and use it as Secrets API collection "XYZ"
;; matching any user, host, and protocol
(when (and (stringp entry) (string-match "^secrets:\\(.+\\)" entry))
(setq entry `(:source (:secrets ,(match-string 1 entry)))))
;; take 'default and use it as a Secrets API default collection
;; matching any user, host, and protocol
(when (eq entry 'default)
(setq entry '(:source (:secrets default))))
(cond
;; the Secrets API. We require the package, in order to have a
;; defined value for `secrets-enabled'.
((and
(not (null (plist-get entry :source))) ; the source must not be nil
(listp (plist-get entry :source)) ; and it must be a list
(not (null (plist-get
(plist-get entry :source)
:secrets))) ; the source must have :secrets
(require 'secrets nil t) ; and we must load the Secrets API
secrets-enabled) ; and that API must be enabled
;; the source is either the :secrets key in ENTRY or
;; if that's missing or nil, it's "session"
(let ((source (plist-get (plist-get entry :source) :secrets)))
;; if the source is a symbol, we look for the alias named so,
;; and if that alias is missing, we use "Login"
(when (symbolp source)
(setq source (or (secrets-get-alias (symbol-name source))
"Login")))
(if (featurep 'secrets)
(auth-source-backend
:source source
:type 'secrets
:search-function #'auth-source-secrets-search
:create-function #'auth-source-secrets-create)
(auth-source-do-warn
"auth-source-backend-parse: no Secrets API, ignoring spec: %S" entry)
(auth-source-backend
:source ""
:type 'ignore))))))
(add-hook 'auth-source-backend-parser-functions #'auth-source-backends-parser-secrets)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-backend-parse-parameters (entry backend)
"Fill in the extra `auth-source-backend' parameters of ENTRY.
Using the plist ENTRY, get the :host, :port, and :user search
parameters."
(let ((entry (if (stringp entry)
nil
entry))
val)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when (setq val (plist-get entry :host))
(oset backend host val))
(when (setq val (plist-get entry :user))
(oset backend user val))
(when (setq val (plist-get entry :port))
(oset backend port val)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
backend)
;; (mapcar #'auth-source-backend-parse auth-sources)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-file-name-p (file)
"Say whether FILE is used by `auth-sources'."
(let* ((backends (mapcar #'auth-source-backend-parse auth-sources))
(files
(mapcar (lambda (x)
(when (member (slot-value x 'type) '(json netrc plstore))
(slot-value x 'source)))
backends)))
(member (expand-file-name file)
(mapcar #'expand-file-name (remq nil files)))))
(with-eval-after-load 'bookmark
(add-hook 'bookmark-inhibit-context-functions
#'auth-source-file-name-p))
(cl-defun auth-source-search (&rest spec
&key max require create delete
&allow-other-keys)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Search or modify authentication backends according to SPEC.
This function parses `auth-sources' for matches of the SPEC
plist. It can optionally create or update an authentication
token if requested. A token is just a standard Emacs property
list with a :secret property that can be a function; all the
other properties will always hold scalar values.
Typically the :secret property, if present, contains a password.
Common search keys are :max, :host, :port, and :user. In
addition, :create specifies if and how tokens will be created.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Finally, :type can specify which backend types you want to check.
A string value is always matched literally. A symbol is matched
as its string value, literally. All the SPEC values can be
single values (symbol or string) or lists thereof (in which case
any of the search terms matches).
:create t means to create a token if possible.
A new token will be created if no matching tokens were found.
The new token will have only the keys the backend requires. For
the netrc backend, for instance, that's the user, host, and
port keys.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Here's an example:
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
\(let ((auth-source-creation-defaults \\='((user . \"defaultUser\")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(A . \"default A\"))))
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
(auth-source-search :host \"mine\" :type \\='netrc :max 1
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:P \"pppp\" :Q \"qqqq\"
:create t))
which says:
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
\"Search for any entry matching host `mine' in backends of type
`netrc', maximum one result.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Create a new entry if you found none. The netrc backend will
automatically require host, user, and port. The host will be
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
`mine'. We prompt for the user with default `defaultUser' and
for the port without a default. We will not prompt for A, Q,
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
or P. The resulting token will only have keys user, host, and
port.\"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:create \\='(A B C) or
:create \\='(:unencrypted A B :encrypted C)
also means to create a token if possible.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
The behavior is like :create t but if the list contains any
parameter, that parameter will be required in the resulting
token (the second form is used only with the plstore backend and
specifies if any of the extra parameters should be stored in
encrypted format.) The value for that parameter will be obtained
from the search parameters or from user input. If any queries
are needed, the alist `auth-source-creation-defaults' will be
checked for the default value. If the user, host, or port are
missing, the alist `auth-source-creation-prompts' will be used to
look up the prompts IN THAT ORDER (so the `user' prompt will be
queried first, then `host', then `port', and finally `secret').
Each prompt string can use %u, %h, and %p to show the user, host,
and port. The prompt is formatted with `format-prompt', a
trailing \": \" is removed.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Here's an example:
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
\(let ((auth-source-creation-defaults \\='((user . \"defaultUser\")
(A . \"default A\")))
(auth-source-creation-prompts
\\='((secret . \"Enter IMAP password for %h:%p\"))))
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
(auth-source-search :host \\='(\"nonesuch\" \"twosuch\") :type \\='netrc :max 1
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:P \"pppp\" :Q \"qqqq\"
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
:create \\='(A B Q)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
which says:
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
\"Search for any entry matching host `nonesuch'
or `twosuch' in backends of type `netrc', maximum one result.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Create a new entry if you found none. The netrc backend will
automatically require host, user, and port. The host will be
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
`nonesuch' and Q will be `qqqq'. We prompt for the password
with the shown prompt. We will not prompt for Q. The resulting
token will have keys user, host, port, A, B, and Q. It will not
have P with any value, even though P is used in the search to
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
find only entries that have P set to `pppp'.\"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
When multiple values are specified in the search parameter, the
user is prompted for which one. So :host (X Y Z) would ask the
user to choose between X, Y, and Z.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
This creation can fail if the search was not specific enough to
create a new token (it's up to the backend to decide that). You
should `catch' the backend-specific error as usual. Some
backends (netrc, at least) will prompt the user rather than throw
an error.
:require (A B C) means that only results that contain those
tokens will be returned. Thus for instance requiring :secret
will ensure that any results will actually have a :secret
property.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:delete t means to delete any found entries. nil by default.
Use `auth-source-delete' in ELisp code instead of calling
`auth-source-search' directly with this parameter.
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
:type (X Y Z) will check only those backend types. `netrc' and
`secrets' are the only ones supported right now.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:max N means to try to return at most N items (defaults to 1).
More than N items may be returned, depending on the search and
the backend.
When :max is 0 the function will return just t or nil to indicate
if any matches were found.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:host (X Y Z) means to match only hosts X, Y, or Z according to
the match rules above. Defaults to t.
:user (X Y Z) means to match only users X, Y, or Z according to
the match rules above. Defaults to t.
:port (P Q R) means to match only protocols P, Q, or R.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Defaults to t.
:K (V1 V2 V3) for any other key K will match values V1, V2, or
V3 (note the match rules above).
The return value is a list with at most :max tokens. Each token
is a plist with keys :backend :host :port :user, plus any other
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
keys provided by the backend (notably :secret). But note the
exception for :max 0, which see above.
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.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
The token's :secret key can hold a function. In that case you
must call it to obtain the actual value."
(let* ((backends (mapcar #'auth-source-backend-parse auth-sources))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(max (or max 1))
(ignored-keys '(:require :create :delete :max))
(keys (cl-loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
(cached (auth-source-remembered-p spec))
;; note that we may have cached results but found is still nil
;; (there were no results from the search)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(found (auth-source-recall spec))
filtered-backends)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(if (and cached auth-source-do-cache)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(auth-source-do-debug
"auth-source-search: found %d CACHED results matching %S"
(length found) spec)
(cl-assert
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(or (eq t create) (listp create)) t
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
"Invalid auth-source :create parameter (must be t or a list): %s %s")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(cl-assert
(listp require) t
"Invalid auth-source :require parameter (must be a list): %s")
(setq filtered-backends (copy-sequence backends))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(dolist (backend backends)
(cl-dolist (key keys)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; ignore invalid slots
(condition-case nil
(unless (auth-source-search-collection
(plist-get spec key)
(slot-value backend key))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(setq filtered-backends (delq backend filtered-backends))
(cl-return))
(invalid-slot-name nil))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(auth-source-do-trivia
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"auth-source-search: found %d backends matching %S"
(length filtered-backends) spec)
;; (debug spec "filtered" filtered-backends)
;; First go through all the backends without :create, so we can
;; query them all.
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(setq found (auth-source-search-backends filtered-backends
spec
;; to exit early
max
;; create is always nil here
nil delete
require))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(auth-source-do-debug
"auth-source-search: found %d results (max %d) matching %S"
(length found) max spec)
;; If we didn't find anything, then we allow the backend(s) to
;; create the entries.
(when (and create
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(not found))
(setq found (auth-source-search-backends filtered-backends
spec
;; to exit early
max
create delete
require))
(auth-source-do-debug
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
"auth-source-search: CREATED %d results (max %d) matching %S"
(length found) max spec))
;; note we remember the lack of result too, if it's applicable
(when auth-source-do-cache
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(auth-source-remember spec found)))
(if (zerop max)
(not (null found))
found)))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(defun auth-source-search-backends (backends spec max create delete require)
(let ((max (if (zerop max) 1 max)) ; stop with 1 match if we're asked for zero
matches)
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(dolist (backend backends)
(when (> max (length matches)) ; if we need more matches...
(let* ((bmatches (apply
(slot-value backend 'search-function)
:backend backend
:type (slot-value backend 'type)
;; note we're overriding whatever the spec
;; has for :max, :require, :create, and :delete
:max max
:require require
:create create
:delete delete
spec)))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(when bmatches
(auth-source-do-trivia
"auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
(length bmatches) max
(slot-value backend 'type)
(slot-value backend 'source)
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
spec)
(setq matches (append matches bmatches))))))
matches))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-delete (&rest spec)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Delete entries from the authentication backends according to SPEC.
Calls `auth-source-search' with the :delete property in SPEC set to t.
The backend may not actually delete the entries.
Returns the deleted entries."
(apply #'auth-source-search (plist-put spec :delete t)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-search-collection (collection value)
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 10:12:27 +00:00
"Return t if VALUE is t or COLLECTION is t or COLLECTION contains VALUE."
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when (and (atom collection) (not (eq t collection)))
(setq collection (list collection)))
;; (debug :collection collection :value value)
(or (eq collection t)
(eq value t)
(equal collection value)
(member value collection)))
(defvar auth-source-netrc-cache nil)
(defun auth-source-forget-all-cached ()
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Forget all cached auth-source data."
(interactive)
(maphash (lambda (key _password)
(when (eq 'auth-source (car-safe key))
;; remove that key
(password-cache-remove key)))
password-data)
(setq auth-source-netrc-cache nil))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-format-cache-entry (spec)
"Format SPEC entry to put it in the password cache."
`(auth-source . ,spec))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-remember (spec found)
"Remember FOUND search results for SPEC."
(let ((password-cache-expiry auth-source-cache-expiry))
(password-cache-add
(auth-source-format-cache-entry spec) found)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-recall (spec)
"Recall FOUND search results for SPEC."
(password-read-from-cache (auth-source-format-cache-entry spec)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-remembered-p (spec)
"Check if SPEC is remembered."
(password-in-cache-p
(auth-source-format-cache-entry spec)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-forget (spec)
"Forget any cached data matching SPEC exactly.
This is the same SPEC you passed to `auth-source-search'.
Returns t or nil for forgotten or not found."
(password-cache-remove (auth-source-format-cache-entry spec)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-forget+ (&rest spec)
"Forget any cached data matching SPEC. Return forgotten count.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
This is not a full `auth-source-search' spec but works similarly.
For instance, \(:host \"myhost\" \"yourhost\") would find all the
cached data that was found with a search for those two hosts,
while \(:host t) would find all host entries."
(let ((count 0))
(maphash
(lambda (key _password)
(when (and (eq 'auth-source (car-safe key))
;; and the spec matches what was stored in the cache
(auth-source-specmatchp spec (cdr key)))
;; remove that key
(password-cache-remove key)
(cl-incf count)))
password-data)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
count))
(defun auth-source-specmatchp (spec stored)
(let ((keys (cl-loop for i below (length spec) by 2
collect (nth i spec))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(not (eq
(cl-dolist (key keys)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(unless (auth-source-search-collection (plist-get stored key)
(plist-get spec key))
(cl-return 'no)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
'no))))
(defun auth-info-password (auth-info)
"Return the :secret password from the AUTH-INFO."
(let ((secret (plist-get auth-info :secret)))
(if (functionp secret)
(funcall secret)
secret)))
(defun auth-source-pick-first-password (&rest spec)
Audit quoting the quote character in doc strings * test/src/regex-emacs-tests.el (regex-tests-compare): (regex-tests-compare): (regex-tests-match): * test/lisp/xml-tests.el (xml-parse-tests--qnames): * test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from): * test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset): * test/lisp/calc/calc-tests.el (calc-tests-equal): * lisp/window.el (get-lru-window): (get-mru-window): (get-largest-window): (quit-restore-window): (display-buffer): * lisp/vc/vc-rcs.el (vc-rcs-consult-headers): * lisp/url/url-auth.el (url-digest-auth-build-response): * lisp/tutorial.el (tutorial--find-changed-keys): * lisp/transient.el (transient-suffix-object): * lisp/textmodes/rst.el (rst-insert-list-new-item): * lisp/textmodes/bibtex.el (bibtex-clean-entry): * lisp/tab-bar.el (tab-bar--key-to-number): (toggle-frame-tab-bar): * lisp/ses.el (ses-recalculate-cell): (ses-define-local-printer): (ses-prin1): * lisp/progmodes/xref.el (xref--find-ignores-arguments): * lisp/progmodes/verilog-mode.el (verilog-single-declaration-end): * lisp/progmodes/tcl.el (tcl-mode-hook): * lisp/progmodes/gdb-mi.el (gdb-get-buffer-create): * lisp/progmodes/elisp-mode.el (elisp--xref-make-xref): * lisp/play/dunnet.el (dun-room-objects): * lisp/outline.el (outline--cycle-state): * lisp/org/ox-publish.el (org-publish-find-property): * lisp/org/ox-html.el (org-html--unlabel-latex-environment): * lisp/org/org-table.el (org-table-collapse-header): * lisp/org/org-plot.el (org--plot/prime-factors): * lisp/org/org-agenda.el (org-agenda--mark-blocked-entry): (org-agenda-set-restriction-lock): * lisp/org/ob-lua.el (org-babel-lua-read-string): * lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process): (org-babel-julia-evaluate-session): * lisp/org/ob-core.el (org-babel-default-header-args): * lisp/obsolete/mouse-sel.el (mouse-select): (mouse-select-secondary): * lisp/net/tramp.el (tramp-methods): * lisp/net/eww.el (eww-accept-content-types): * lisp/net/dictionary-connection.el (dictionary-connection-status): * lisp/minibuffer.el (completion-flex--make-flex-pattern): * lisp/mh-e/mh-mime.el (mh-have-file-command): * lisp/mh-e/mh-limit.el (mh-subject-to-sequence): (mh-subject-to-sequence-threaded): (mh-subject-to-sequence-unthreaded): * lisp/mail/feedmail.el (feedmail-queue-buffer-file-name): (feedmail-vm-mail-mode): * lisp/ls-lisp.el (ls-lisp--sanitize-switches): * lisp/keymap.el (key-valid-p): * lisp/international/ccl.el (ccl-compile-branch-blocks): * lisp/image/image-converter.el (image-convert): * lisp/gnus/spam.el (spam-backend-check): * lisp/gnus/nnselect.el (nnselect-generate-artlist): * lisp/gnus/nnmairix.el (nnmairix-widget-other): * lisp/gnus/message.el (message-mailto): * lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article): * lisp/gnus/gnus-search.el (gnus-search-prepare-query): * lisp/frame.el (frame-size-history): * lisp/eshell/esh-var.el (eshell-parse-variable-ref): * lisp/eshell/em-dirs.el (eshell-expand-multiple-dots): * lisp/erc/erc-backend.el (erc-bounds-of-word-at-point): * lisp/emulation/cua-rect.el (cua--rectangle-operation): * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): * lisp/emacs-lisp/package.el (package-desc-suffix): * lisp/emacs-lisp/faceup.el (faceup-test-explain): * lisp/emacs-lisp/comp.el (comp-curr-allocation-class): (comp-alloc-class-to-container): (comp-add-cstrs): (comp-remove-type-hints-func): (batch-byte+native-compile): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/elec-pair.el (electric-pair--syntax-ppss): * lisp/doc-view.el (doc-view-doc-type): * lisp/cedet/semantic/symref.el (semantic-symref-tool-alist): (semantic-symref-hit-to-tag-via-db): (semantic-symref-hit-to-tag-via-buffer): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay): * lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map): * lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function): * lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions): * lisp/cedet/semantic.el (semantic-working-type): * lisp/cedet/ede/files.el (ede-flush-directory-hash): * lisp/calc/calc.el (calc--header-line): * lisp/auth-source.el (auth-source-pick-first-password): (auth-source--decode-octal-string): * etc/themes/modus-themes.el (modus-themes--paren): (modus-themes--agenda-habit): * admin/cus-test.el (cus-test-vars-with-changed-state): Fix quoting in doc strings. In code examples, the ' character is quoted with \\=, and regularize 'foo to `foo', and quote strings like "foo" instead of 'foo'.
2022-04-22 14:17:22 +00:00
"Pick the first secret found by applying `auth-source-search' to SPEC."
(auth-info-password (car (apply #'auth-source-search (plist-put spec :max 1)))))
(defun auth-source-format-prompt (prompt alist)
"Format PROMPT using %x (for any character x) specifiers in ALIST.
Remove trailing \": \"."
(setq prompt (replace-regexp-in-string ":\\s-*$" "" prompt))
(dolist (cell alist)
(let ((c (nth 0 cell))
(v (nth 1 cell)))
(when (and c v)
(setq prompt (replace-regexp-in-string (format "%%%c" c)
(format "%s" v)
prompt nil t)))))
prompt)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-ensure-strings (values)
(if (eq values t)
values
Use ensure-list in many more places * lisp/align.el (align-region): * lisp/auth-source-pass.el (auth-source-pass--build-result-many): * lisp/auth-source.el (auth-source-ensure-strings): * lisp/calendar/appt.el (appt-disp-window): * lisp/cedet/mode-local.el (mode-local-map-mode-buffers): * lisp/cus-edit.el (custom-prompt-variable) (custom-variable-menu-create): * lisp/dired-x.el (dired-mark-extension, dired-mark-suffix): * lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info): * lisp/emacs-lisp/eieio.el (object-add-to-list): * lisp/emulation/cua-base.el (cua--M/H-key): * lisp/epg.el (epg--list-keys-1): * lisp/faces.el (read-face-name): * lisp/format.el (format-decode): * lisp/gnus/gnus-score.el (gnus-home-score-file) (gnus-all-score-files): * lisp/gnus/gnus-uu.el (gnus-uu-grab-articles): * lisp/gnus/message.el (message-make-forward-subject): * lisp/gnus/nnmairix.el (nnmairix-create-search-group): * lisp/gnus/spam.el (spam-copy-or-move-routine): * lisp/help-fns.el (describe-face): * lisp/ibuf-macs.el (define-ibuffer-filter): * lisp/international/mule-cmds.el (select-safe-coding-system): * lisp/net/imap.el (imap-send-command): * lisp/printing.el (pr-menu-get-item): * lisp/speedbar.el (speedbar-add-supported-extension) (speedbar-add-ignored-directory-regexp): * lisp/textmodes/rst.el (rst-forward-line-looking-at): * lisp/vc/ediff-util.el (ediff-other-buffer): * lisp/vc/diff.el (diff-no-select): * lisp/vc/vc-dir.el (vc-dir-mark-state-files): * lisp/wid-edit.el (widget-prompt-value): * lisp/windmove.el (windmove-default-keybindings) (windmove-display-default-keybindings) (windmove-delete-default-keybindings) (windmove-swap-states-default-keybindings): * lisp/window.el (display-buffer-reuse-mode-window): * lisp/woman.el (woman-expand-directory-path): Prefer ensure-list.
2023-08-27 19:45:30 +00:00
(setq values (ensure-list values))
(mapcar (lambda (value)
(if (numberp value)
(format "%s" value)
value))
values)))
;;; Backend specific parsing: netrc/authinfo backend
(defun auth-source--aput-1 (alist key val)
(let ((seen ())
(rest alist))
(while (and (consp rest) (not (equal key (caar rest))))
(push (pop rest) seen))
(cons (cons key val)
(if (null rest) alist
(nconc (nreverse seen)
(if (equal key (caar rest)) (cdr rest) rest))))))
(defmacro auth-source--aput (var key val)
`(setq ,var (auth-source--aput-1 ,var ,key ,val)))
(defun auth-source--aget (alist key)
(cdr (assoc key alist)))
;;;###autoload
(defun auth-source-netrc-parse-all (file)
"Parse FILE and return all entries."
(auth-source-netrc-parse :file file :allow-null t))
;; (auth-source-netrc-parse :file "~/.authinfo.gpg")
(cl-defun auth-source-netrc-parse (&key file max host user port require
allow-null &allow-other-keys)
"Parse FILE and return a list of matching entries in the file.
If ALLOW-NULL, allow nil values of HOST, USER and PORT to match.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Note that the MAX parameter is used so we can exit the parse early."
(if (listp file)
;; We got already parsed contents; just return it.
file
(when (file-exists-p file)
(setq port (auth-source-ensure-strings port))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(with-temp-buffer
(let* ((max (or max 5000)) ; sanity check: default to stop at 5K
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(modified 0)
(cached (cdr-safe (assoc file auth-source-netrc-cache)))
(cached-mtime (plist-get cached :mtime))
(cached-secrets (plist-get cached :secret))
(check (lambda (alist)
(and alist
(or
(and allow-null (null host))
(auth-source-search-collection
host
(or
(auth-source--aget alist "machine")
(auth-source--aget alist "host")
t)))
(or
(and allow-null (null user))
(auth-source-search-collection
user
(or
(auth-source--aget alist "login")
(auth-source--aget alist "account")
(auth-source--aget alist "user")
t)))
(or
(and allow-null (null port))
(auth-source-search-collection
port
(or
(auth-source--aget alist "port")
(auth-source--aget alist "protocol")
t)))
(or
;; the required list of keys is nil, or
(null require)
;; every element of require is in n (normalized)
(let ((n (nth 0 (auth-source-netrc-normalize
(list alist) file))))
(cl-loop for req in require
always (plist-get n req)))))))
result)
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(if (and (functionp cached-secrets)
(time-equal-p
cached-mtime
file-attributes cleanup Mostly, this replaces magic-number calls like (nth 4 A) with more-informative calls like (file-attribute-access-time A). It also fixes some documentation and minor timestamp coding issues that I noticed while looking into this. * doc/lispref/files.texi (File Attributes): * lisp/files.el (file-attribute-size) (file-attribute-inode-number, file-attribute-device-number): * src/dired.c (Fdirectory_files_and_attributes) (Ffile_attributes): Mention which attributes must be integers, or nonnegative integers, as opposed to merely being numbers. Remove no-longer-correct talk about representing large integers as conses of integers. * doc/lispref/files.texi (Magic File Names): * doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary): * lisp/autorevert.el (auto-revert-find-file-function) (auto-revert-tail-mode, auto-revert-handler): * lisp/auth-source.el (auth-source-netrc-parse): * lisp/cedet/ede/files.el (ede--inode-for-dir): * lisp/cedet/semantic/db-file.el (object-write): * lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook): * lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p) (semanticdb-synchronize): * lisp/cedet/srecode/table.el (srecode-mode-table-new): * lisp/desktop.el (desktop-save, desktop-read): * lisp/dired-aux.el (dired-file-set-difference) (dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive) (dired-create-files): * lisp/dired.el (dired-directory-changed-p, dired-readin): * lisp/dos-w32.el (w32-direct-print-region-helper): * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads) (autoload-find-destination, update-directory-autoloads): * lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent): * lisp/epg.el (epg--start, epg-wait-for-completion): * lisp/eshell/em-ls.el (eshell-ls-filetype-p) (eshell-ls-applicable, eshell-ls-size-string) (eshell-ls-file, eshell-ls-dir, eshell-ls-files) (eshell-ls-entries): * lisp/eshell/em-pred.el (eshell-predicate-alist) (eshell-pred-file-type, eshell-pred-file-links) (eshell-pred-file-size): * lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat) (eshell-du-sum-directory, eshell/du): * lisp/eshell/esh-util.el (eshell-read-passwd) (eshell-read-hosts): * lisp/files.el (remote-file-name-inhibit-cache) (find-file-noselect, insert-file-1, dir-locals-find-file) (dir-locals-read-from-dir, backup-buffer) (file-ownership-preserved-p, copy-directory) (read-file-modes): * lisp/find-lisp.el (find-lisp-format): * lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles) (gnus-agent-read-agentview, gnus-agent-expire-group-1) (gnus-agent-request-article, gnus-agent-regenerate-group) (gnus-agent-update-files-total-fetched-for) (gnus-agent-update-view-total-fetched-for): * lisp/gnus/gnus-cache.el (gnus-cache-read-active) (gnus-cache-update-file-total-fetched-for) (gnus-cache-update-overview-total-fetched-for): * lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p): * lisp/gnus/gnus-score.el (gnus-score-score-files): * lisp/gnus/gnus-start.el (gnus-save-newsrc-file) (gnus-master-read-slave-newsrc): * lisp/gnus/gnus-sum.el (gnus-summary-import-article): * lisp/gnus/gnus-util.el (gnus-file-newer-than) (gnus-cache-file-contents): * lisp/gnus/mail-source.el (mail-source-delete-old-incoming) (mail-source-callback, mail-source-movemail): * lisp/gnus/nneething.el (nneething-create-mapping) (nneething-make-head): * lisp/gnus/nnfolder.el (nnfolder-read-folder): * lisp/gnus/nnheader.el (nnheader-file-size) (nnheader-insert-nov-file): * lisp/gnus/nnmail.el (nnmail-activate): * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum) (nnmaildir--new-number, nnmaildir--update-nov) (nnmaildir--scan, nnmaildir-request-scan) (nnmaildir-request-update-info) (nnmaildir-request-expire-articles): * lisp/gnus/nnmh.el (nnmh-request-list-1) (nnmh-request-expire-articles, nnmh-update-gnus-unreads): * lisp/gnus/nnml.el (nnml-request-expire-articles): * lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load) (spam-stat-process-directory, spam-stat-test-directory): * lisp/ido.el (ido-directory-too-big-p) (ido-file-name-all-completions): * lisp/image-dired.el (image-dired-get-thumbnail-image) (image-dired-create-thumb-1): * lisp/info.el (info-insert-file-contents): * lisp/ls-lisp.el (ls-lisp-insert-directory) (ls-lisp-handle-switches, ls-lisp-classify-file) (ls-lisp-format): * lisp/mail/blessmail.el: * lisp/mail/feedmail.el (feedmail-default-date-generator) (feedmail-default-message-id-generator): * lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases) (mail-abbrevs-setup): * lisp/mail/mspools.el (mspools-size-folder): * lisp/mail/rmail.el (rmail-insert-inbox-text): * lisp/mail/sendmail.el (sendmail-sync-aliases): * lisp/mh-e/mh-alias.el (mh-alias-tstamp): * lisp/net/ange-ftp.el (ange-ftp-parse-netrc) (ange-ftp-write-region, ange-ftp-file-newer-than-file-p) (ange-ftp-cf1): * lisp/net/eudcb-mab.el (eudc-mab-query-internal): * lisp/net/eww.el (eww-read-bookmarks): * lisp/net/netrc.el (netrc-parse): * lisp/net/newst-backend.el (newsticker--image-get): * lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file): * lisp/obsolete/fast-lock.el (fast-lock-save-cache): * lisp/obsolete/vc-arch.el (vc-arch-state) (vc-arch-diff3-rej-p): * lisp/org/ob-eval.el (org-babel--shell-command-on-region): * lisp/org/org-attach.el (org-attach-commit): * lisp/org/org-macro.el (org-macro-initialize-templates): * lisp/org/org.el (org-babel-load-file) (org-file-newer-than-p): * lisp/org/ox-html.el (org-html-format-spec): * lisp/org/ox-publish.el (org-publish-find-date) (org-publish-cache-ctime-of-src): * lisp/pcmpl-gnu.el (pcomplete/tar): * lisp/pcmpl-rpm.el (pcmpl-rpm-packages): * lisp/play/cookie1.el (cookie-snarf): * lisp/progmodes/cmacexp.el (c-macro-expansion): * lisp/ps-bdf.el (bdf-file-mod-time): * lisp/server.el (server-ensure-safe-dir): * lisp/simple.el (shell-command-on-region): * lisp/speedbar.el (speedbar-item-info-file-helper) (speedbar-check-obj-this-line): * lisp/thumbs.el (thumbs-cleanup-thumbsdir): * lisp/time.el (display-time-mail-check-directory) (display-time-file-nonempty-p): * lisp/url/url-cache.el (url-is-cached): * lisp/url/url-file.el (url-file-asynch-callback): * lisp/vc/diff-mode.el (diff-delete-if-empty): * lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries): * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic): * lisp/vc/vc-cvs.el (vc-cvs-checkout-model) (vc-cvs-state-heuristic, vc-cvs-merge-news) (vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry): * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1) (vc-hg--ignore-patterns-valid-p) (vc-hg--cached-dirstate-search, vc-hg-state-fast): * lisp/vc/vc-hooks.el (vc-after-save): * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer): * lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status): * lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file): * lisp/xdg.el (xdg-mime-apps): Prefer (file-attribute-size A) to (nth 7 A), and similarly for other file attributes accessors. * doc/lispref/files.texi (File Attributes): * doc/lispref/intro.texi (Version Info): * doc/lispref/os.texi (Idle Timers): * lisp/erc/erc.el (erc-string-to-emacs-time): * lisp/files.el (file-attribute-access-time) (file-attribute-modification-time) (file-attribute-status-change-time): * lisp/net/tramp-compat.el: (tramp-compat-file-attribute-modification-time) (tramp-compat-file-attribute-size): * src/buffer.c (syms_of_buffer): * src/editfns.c (Fget_internal_run_time): * src/fileio.c (Fvisited_file_modtime) (Fset_visited_file_modtime): * src/keyboard.c (Fcurrent_idle_time): * src/process.c (Fprocess_attributes): Defer implementation details about timestamp format to the section that talks about timestamp format, to make it easier to change the documentation later if timestamp formats are extended. * lisp/gnus/gnus-util.el (gnus-file-newer-than): * lisp/speedbar.el (speedbar-check-obj-this-line): * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer): Prefer time-less-p to doing it by hand. * lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses. * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic): Use eql, not eq, to compare integers that might be bignums. * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src): Prefer float-time to doing time arithmetic by hand.
2018-09-24 01:30:46 +00:00
(file-attribute-modification-time
(file-attributes file))))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(progn
(auth-source-do-trivia
"auth-source-netrc-parse: using CACHED file data for %s"
file)
(insert (funcall cached-secrets)))
(insert-file-contents file)
;; cache all netrc files (used to be just .gpg files)
;; Store the contents of the file obfuscated in memory.
(auth-source--aput
auth-source-netrc-cache file
file-attributes cleanup Mostly, this replaces magic-number calls like (nth 4 A) with more-informative calls like (file-attribute-access-time A). It also fixes some documentation and minor timestamp coding issues that I noticed while looking into this. * doc/lispref/files.texi (File Attributes): * lisp/files.el (file-attribute-size) (file-attribute-inode-number, file-attribute-device-number): * src/dired.c (Fdirectory_files_and_attributes) (Ffile_attributes): Mention which attributes must be integers, or nonnegative integers, as opposed to merely being numbers. Remove no-longer-correct talk about representing large integers as conses of integers. * doc/lispref/files.texi (Magic File Names): * doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary): * lisp/autorevert.el (auto-revert-find-file-function) (auto-revert-tail-mode, auto-revert-handler): * lisp/auth-source.el (auth-source-netrc-parse): * lisp/cedet/ede/files.el (ede--inode-for-dir): * lisp/cedet/semantic/db-file.el (object-write): * lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook): * lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p) (semanticdb-synchronize): * lisp/cedet/srecode/table.el (srecode-mode-table-new): * lisp/desktop.el (desktop-save, desktop-read): * lisp/dired-aux.el (dired-file-set-difference) (dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive) (dired-create-files): * lisp/dired.el (dired-directory-changed-p, dired-readin): * lisp/dos-w32.el (w32-direct-print-region-helper): * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads) (autoload-find-destination, update-directory-autoloads): * lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent): * lisp/epg.el (epg--start, epg-wait-for-completion): * lisp/eshell/em-ls.el (eshell-ls-filetype-p) (eshell-ls-applicable, eshell-ls-size-string) (eshell-ls-file, eshell-ls-dir, eshell-ls-files) (eshell-ls-entries): * lisp/eshell/em-pred.el (eshell-predicate-alist) (eshell-pred-file-type, eshell-pred-file-links) (eshell-pred-file-size): * lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat) (eshell-du-sum-directory, eshell/du): * lisp/eshell/esh-util.el (eshell-read-passwd) (eshell-read-hosts): * lisp/files.el (remote-file-name-inhibit-cache) (find-file-noselect, insert-file-1, dir-locals-find-file) (dir-locals-read-from-dir, backup-buffer) (file-ownership-preserved-p, copy-directory) (read-file-modes): * lisp/find-lisp.el (find-lisp-format): * lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles) (gnus-agent-read-agentview, gnus-agent-expire-group-1) (gnus-agent-request-article, gnus-agent-regenerate-group) (gnus-agent-update-files-total-fetched-for) (gnus-agent-update-view-total-fetched-for): * lisp/gnus/gnus-cache.el (gnus-cache-read-active) (gnus-cache-update-file-total-fetched-for) (gnus-cache-update-overview-total-fetched-for): * lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p): * lisp/gnus/gnus-score.el (gnus-score-score-files): * lisp/gnus/gnus-start.el (gnus-save-newsrc-file) (gnus-master-read-slave-newsrc): * lisp/gnus/gnus-sum.el (gnus-summary-import-article): * lisp/gnus/gnus-util.el (gnus-file-newer-than) (gnus-cache-file-contents): * lisp/gnus/mail-source.el (mail-source-delete-old-incoming) (mail-source-callback, mail-source-movemail): * lisp/gnus/nneething.el (nneething-create-mapping) (nneething-make-head): * lisp/gnus/nnfolder.el (nnfolder-read-folder): * lisp/gnus/nnheader.el (nnheader-file-size) (nnheader-insert-nov-file): * lisp/gnus/nnmail.el (nnmail-activate): * lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum) (nnmaildir--new-number, nnmaildir--update-nov) (nnmaildir--scan, nnmaildir-request-scan) (nnmaildir-request-update-info) (nnmaildir-request-expire-articles): * lisp/gnus/nnmh.el (nnmh-request-list-1) (nnmh-request-expire-articles, nnmh-update-gnus-unreads): * lisp/gnus/nnml.el (nnml-request-expire-articles): * lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load) (spam-stat-process-directory, spam-stat-test-directory): * lisp/ido.el (ido-directory-too-big-p) (ido-file-name-all-completions): * lisp/image-dired.el (image-dired-get-thumbnail-image) (image-dired-create-thumb-1): * lisp/info.el (info-insert-file-contents): * lisp/ls-lisp.el (ls-lisp-insert-directory) (ls-lisp-handle-switches, ls-lisp-classify-file) (ls-lisp-format): * lisp/mail/blessmail.el: * lisp/mail/feedmail.el (feedmail-default-date-generator) (feedmail-default-message-id-generator): * lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases) (mail-abbrevs-setup): * lisp/mail/mspools.el (mspools-size-folder): * lisp/mail/rmail.el (rmail-insert-inbox-text): * lisp/mail/sendmail.el (sendmail-sync-aliases): * lisp/mh-e/mh-alias.el (mh-alias-tstamp): * lisp/net/ange-ftp.el (ange-ftp-parse-netrc) (ange-ftp-write-region, ange-ftp-file-newer-than-file-p) (ange-ftp-cf1): * lisp/net/eudcb-mab.el (eudc-mab-query-internal): * lisp/net/eww.el (eww-read-bookmarks): * lisp/net/netrc.el (netrc-parse): * lisp/net/newst-backend.el (newsticker--image-get): * lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file): * lisp/obsolete/fast-lock.el (fast-lock-save-cache): * lisp/obsolete/vc-arch.el (vc-arch-state) (vc-arch-diff3-rej-p): * lisp/org/ob-eval.el (org-babel--shell-command-on-region): * lisp/org/org-attach.el (org-attach-commit): * lisp/org/org-macro.el (org-macro-initialize-templates): * lisp/org/org.el (org-babel-load-file) (org-file-newer-than-p): * lisp/org/ox-html.el (org-html-format-spec): * lisp/org/ox-publish.el (org-publish-find-date) (org-publish-cache-ctime-of-src): * lisp/pcmpl-gnu.el (pcomplete/tar): * lisp/pcmpl-rpm.el (pcmpl-rpm-packages): * lisp/play/cookie1.el (cookie-snarf): * lisp/progmodes/cmacexp.el (c-macro-expansion): * lisp/ps-bdf.el (bdf-file-mod-time): * lisp/server.el (server-ensure-safe-dir): * lisp/simple.el (shell-command-on-region): * lisp/speedbar.el (speedbar-item-info-file-helper) (speedbar-check-obj-this-line): * lisp/thumbs.el (thumbs-cleanup-thumbsdir): * lisp/time.el (display-time-mail-check-directory) (display-time-file-nonempty-p): * lisp/url/url-cache.el (url-is-cached): * lisp/url/url-file.el (url-file-asynch-callback): * lisp/vc/diff-mode.el (diff-delete-if-empty): * lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries): * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic): * lisp/vc/vc-cvs.el (vc-cvs-checkout-model) (vc-cvs-state-heuristic, vc-cvs-merge-news) (vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry): * lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1) (vc-hg--ignore-patterns-valid-p) (vc-hg--cached-dirstate-search, vc-hg-state-fast): * lisp/vc/vc-hooks.el (vc-after-save): * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer): * lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status): * lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file): * lisp/xdg.el (xdg-mime-apps): Prefer (file-attribute-size A) to (nth 7 A), and similarly for other file attributes accessors. * doc/lispref/files.texi (File Attributes): * doc/lispref/intro.texi (Version Info): * doc/lispref/os.texi (Idle Timers): * lisp/erc/erc.el (erc-string-to-emacs-time): * lisp/files.el (file-attribute-access-time) (file-attribute-modification-time) (file-attribute-status-change-time): * lisp/net/tramp-compat.el: (tramp-compat-file-attribute-modification-time) (tramp-compat-file-attribute-size): * src/buffer.c (syms_of_buffer): * src/editfns.c (Fget_internal_run_time): * src/fileio.c (Fvisited_file_modtime) (Fset_visited_file_modtime): * src/keyboard.c (Fcurrent_idle_time): * src/process.c (Fprocess_attributes): Defer implementation details about timestamp format to the section that talks about timestamp format, to make it easier to change the documentation later if timestamp formats are extended. * lisp/gnus/gnus-util.el (gnus-file-newer-than): * lisp/speedbar.el (speedbar-check-obj-this-line): * lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer): Prefer time-less-p to doing it by hand. * lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses. * lisp/vc/vc-bzr.el (vc-bzr-state-heuristic): Use eql, not eq, to compare integers that might be bignums. * lisp/org/ox-publish.el (org-publish-cache-ctime-of-src): Prefer float-time to doing time arithmetic by hand.
2018-09-24 01:30:46 +00:00
(list :mtime (file-attribute-modification-time
(file-attributes file))
:secret (let ((v (auth-source--obfuscate (buffer-string))))
(lambda () (auth-source--deobfuscate v))))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(goto-char (point-min))
(let ((entries (auth-source-netrc-parse-entries check max))
alist)
(while (setq alist (pop entries))
(push (nreverse alist) result)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when (< 0 modified)
(when auth-source-gpg-encrypt-to
;; (see bug#7487) making `epa-file-encrypt-to' local to
;; this buffer lets epa-file skip the key selection query
;; (see the `local-variable-p' check in
;; `epa-file-write-region').
(unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
(make-local-variable 'epa-file-encrypt-to))
(if (listp auth-source-gpg-encrypt-to)
(setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
;; ask AFTER we've successfully opened the file
(when (y-or-n-p (format "Save file %s? (%d deletions)"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
file modified))
(write-region (point-min) (point-max) file nil 'silent)
(auth-source-do-debug
"auth-source-netrc-parse: modified %d lines in %s"
modified file)))
(nreverse result))))))
(defun auth-source-netrc-parse-next-interesting ()
"Advance to the next interesting position in the current buffer."
(skip-chars-forward "\t ")
;; If we're looking at a comment or are at the end of the line, move forward
(while (or (eq (char-after) ?#)
(and (eolp)
(not (eobp))))
(forward-line 1)
(skip-chars-forward "\t ")))
(defun auth-source-netrc-looking-at-token ()
"Say whether the next think in the buffer is a token (password, etc).
Match data is altered to reflect the token."
(or (looking-at "'\\([^']*\\)'")
(looking-at "\"\\([^\"]*\\)\"")
(looking-at "\\([^ \t\n]+\\)")))
(defun auth-source-netrc-parse-one ()
"Read one thing from the current buffer."
(auth-source-netrc-parse-next-interesting)
(when (auth-source-netrc-looking-at-token)
(forward-char (length (match-string 0)))
(prog1
(match-string-no-properties 1)
(auth-source-netrc-parse-next-interesting))))
;; with thanks to org-mode
(defsubst auth-source-current-line (&optional pos)
(save-excursion
(and pos (goto-char pos))
;; works also in narrowed buffer, because we start at 1, not point-min
(+ (if (bolp) 1 0) (count-lines 1 (point)))))
(defun auth-source-netrc-parse-entries(check max)
"Parse up to MAX netrc entries, passed by CHECK, from the current buffer."
(let ((adder (lambda(check alist all)
(when (and
alist
(> max (length all))
(funcall check alist))
(push alist all))
all))
item item2 all alist default)
(while (setq item (auth-source-netrc-parse-one))
(setq default (equal item "default"))
;; We're starting a new machine. Save the old one.
(when (and alist
(or default
(equal item "machine")))
;; (auth-source-do-trivia
;; "auth-source-netrc-parse-entries: got entry %S" alist)
(setq all (funcall adder check alist all)
alist nil))
;; In default entries, we don't have a next token.
;; We store them as ("machine" . t)
(if default
(push (cons "machine" t) alist)
;; Not a default entry. Grab the next item.
(when (setq item2 (auth-source-netrc-parse-one))
;; Did we get a "machine" value?
(if (equal item2 "machine")
(error
"%s: Unexpected `machine' token at line %d"
"auth-source-netrc-parse-entries"
(auth-source-current-line))
(push (cons item item2) alist)))))
;; Clean up: if there's an entry left over, use it.
(when alist
(setq all (funcall adder check alist all))
;; (auth-source-do-trivia
;; "auth-source-netrc-parse-entries: got2 entry %S" alist)
)
(nreverse all)))
(defvar auth-source-passphrase-alist nil)
(defun auth-source-token-passphrase-callback-function (_context _key-id file)
(let* ((file (file-truename file))
(entry (assoc file auth-source-passphrase-alist))
passphrase)
;; return the saved passphrase, calling a function if needed
(or (copy-sequence (if (functionp (cdr entry))
(funcall (cdr entry))
(cdr entry)))
(progn
(unless entry
(setq entry (list file))
(push entry auth-source-passphrase-alist))
(setq passphrase
(read-passwd
(format "Passphrase for %s tokens: " file)
t))
(setcdr entry (let ((p (copy-sequence passphrase)))
(lambda () p)))
passphrase))))
(defun auth-source-epa-extract-gpg-token (secret file)
"Pass either the decoded SECRET or the gpg:BASE64DATA version.
FILE is the file from which we obtained this token."
(when (string-match "^gpg:\\(.+\\)" secret)
(setq secret (base64-decode-string (match-string 1 secret))))
(let ((context (epg-make-context 'OpenPGP)))
(epg-context-set-passphrase-callback
context
(cons #'auth-source-token-passphrase-callback-function
file))
(epg-decrypt-string context secret)))
(defvar pp-escape-newlines)
(defun auth-source-epa-make-gpg-token (secret file)
(let ((context (epg-make-context 'OpenPGP))
(pp-escape-newlines nil)
cipher)
(setf (epg-context-armor context) t)
(epg-context-set-passphrase-callback
context
(cons #'auth-source-token-passphrase-callback-function
file))
(setq cipher (epg-encrypt-string context secret nil))
(with-temp-buffer
(insert cipher)
(base64-encode-region (point-min) (point-max) t)
(concat "gpg:" (buffer-substring-no-properties
(point-min)
(point-max))))))
(defun auth-source--symbol-keyword (symbol)
(intern (format ":%s" symbol)))
(defun auth-source-netrc-normalize (alist filename)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(mapcar (lambda (entry)
(let (ret item)
(while (setq item (pop entry))
(let ((k (car item))
(v (cdr item)))
;; apply key aliases
(setq k (cond ((member k '("machine")) "host")
((member k '("login" "account")) "user")
((member k '("protocol")) "port")
((member k '("password")) "secret")
(t k)))
;; Send back the secret in a function (lexical
;; binding). We slightly obfuscate the passwords
;; (that's the "(mapcar #+' ..)" stuff) to avoid
;; showing the passwords in clear text in backtraces
;; and the like.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when (equal k "secret")
(setq v (let ((lexv (auth-source--obfuscate v))
(token-decoder nil))
(when (string-match "^gpg:" v)
;; it's a GPG token: create a token decoder
;; which unsets itself once
(setq token-decoder
(lambda (val)
(prog1
(auth-source-epa-extract-gpg-token
val
filename)
(setq token-decoder nil)))))
(lambda ()
(if token-decoder
(funcall token-decoder
(auth-source--deobfuscate lexv))
(auth-source--deobfuscate lexv))))))
(setq ret (plist-put ret
(auth-source--symbol-keyword k)
v))))
ret))
alist))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; Never change this variable.
(defvar auth-source--session-nonce nil)
(defun auth-source--obfuscate (string)
;; We want to keep passwords out of backtraces and bug reports and
;; the like, so if we have GnuTLS available, we encrypt them with a
;; nonce that we just keep in memory. If somebody has access to the
;; current Emacs session, they can be decrypted, but if not, little
;; useful information is leaked. If you reset the nonce, you also
;; have to call `auth-source-forget-all-cached'.
(unless auth-source--session-nonce
(setq auth-source--session-nonce
(apply #'string (cl-loop repeat 16
collect (random 128)))))
(if (and (fboundp 'gnutls-symmetric-encrypt)
(gnutls-available-p))
(let ((cdata (car (last (gnutls-ciphers)))))
(mapconcat
#'base64-encode-string
(gnutls-symmetric-encrypt
(pop cdata)
(auth-source--pad auth-source--session-nonce
(plist-get cdata :cipher-keysize))
(list 'iv-auto (plist-get cdata :cipher-ivsize))
(auth-source--pad (encode-coding-string string 'utf-8)
(plist-get cdata :cipher-blocksize)))
"-"))
(mapcar #'1- string)))
(defun auth-source--pad (string length)
"Pad STRING to a modulo of LENGTH."
(let ((pad (- length (mod (length string) length))))
(concat string (make-string pad pad))))
(defun auth-source--unpad (string)
"Remove PKCS#7 padding from STRING."
(substring string 0 (- (length string)
(aref string (1- (length string))))))
(defun auth-source--deobfuscate (data)
(if (and (fboundp 'gnutls-symmetric-encrypt)
(gnutls-available-p))
(let ((cdata (car (last (gnutls-ciphers))))
(bits (split-string data "-")))
(decode-coding-string
(auth-source--unpad
(car
(gnutls-symmetric-decrypt
(pop cdata)
(auth-source--pad auth-source--session-nonce
(plist-get cdata :cipher-keysize))
(base64-decode-string (cadr bits))
(base64-decode-string (car bits)))))
'utf-8))
(apply #'string (mapcar #'1+ data))))
(cl-defun auth-source-netrc-search (&rest spec
&key backend require create
type max host user port
&allow-other-keys)
"Given a property list SPEC, return search matches from the `:backend'.
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
See `auth-source-search' for details on SPEC."
;; just in case, check that the type is correct (null or same as the backend)
(cl-assert (or (null type) (eq type (oref backend type)))
t "Invalid netrc search: %s %s")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(let ((results (auth-source-netrc-normalize
(auth-source-netrc-parse
:max max
:require require
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
:file (oref backend source)
:host (or host t)
:user (or user t)
:port (or port t))
(oref backend source))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; if we need to create an entry AND none were found to match
(when (and create
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(not results))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; create based on the spec and record the value
(setq results (or
;; if the user did not want to create the entry
;; in the file, it will be returned
(apply (slot-value backend 'create-function) spec)
;; if not, we do the search again without :create
;; to get the updated data.
;; the result will be returned, even if the search fails
(apply #'auth-source-netrc-search
(plist-put spec :create nil)))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
results))
(defun auth-source-netrc-element-or-first (v)
(if (listp v)
(nth 0 v)
v))
;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(cl-defun auth-source-netrc-create (&rest spec
&key backend host port create user
&allow-other-keys)
(let* ((base-required '(host user port secret))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; we know (because of an assertion in auth-source-search) that the
;; :create parameter is either t or a list (which includes nil)
(create-extra (if (eq t create) nil create))
(current-data (car (auth-source-search :max 1
:host host
:user user
:port port)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(required (append base-required create-extra))
(file (oref backend source))
(add "")
;; Whether to set save-function.
save-function
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; `valist' is an alist
valist
;; `artificial' will be returned if no creation is needed
artificial)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; only for base required elements (defined as function parameters):
;; fill in the valist with whatever data we may have from the search
;; we complete the first value if it's a list and use the value otherwise
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(dolist (br base-required)
(let ((val (plist-get spec (auth-source--symbol-keyword br))))
(when val
(let ((br-choice (cond
;; all-accepting choice (predicate is t)
((eq t val) nil)
;; just the value otherwise
(t val))))
(when br-choice
(auth-source--aput valist br br-choice))))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; for extra required elements, see if the spec includes a value for them
(dolist (er create-extra)
(let ((k (auth-source--symbol-keyword er))
(keys (cl-loop for i below (length spec) by 2
collect (nth i spec))))
(when (memq k keys)
(auth-source--aput valist er (plist-get spec k)))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; for each required element
(dolist (r required)
(let* ((data (auth-source--aget valist r))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
;; take the first element if the data is a list
(data (or (auth-source-netrc-element-or-first data)
(plist-get current-data
(auth-source--symbol-keyword r))))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
;; this is the default to be offered
(given-default (auth-source--aget
auth-source-creation-defaults r))
;; the default supplementals are simple:
;; for the user, try `given-default' and then (user-login-name);
;; otherwise take `given-default'
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(default (cond
((and (not given-default) (eq r 'user))
(user-login-name))
(t given-default)))
(printable-defaults (list
(cons 'user
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'user))
(plist-get artificial :user)
"[any user]"))
(cons 'host
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'host))
(plist-get artificial :host)
"[any host]"))
(cons 'port
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'port))
(plist-get artificial :port)
"[any port]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
(?h ,(auth-source--aget printable-defaults 'host))
(?p ,(auth-source--aget printable-defaults 'port))))))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
;; Store the data, prompting for the password if needed.
(setq data (or data
(if (eq r 'secret)
;; Special case prompt for passwords.
;; TODO: make the default (setq auth-source-netrc-use-gpg-tokens `((,(if (boundp 'epa-file-auto-mode-alist-entry) (car epa-file-auto-mode-alist-entry) "\\.gpg\\'") nil) (t gpg)))
;; TODO: or maybe leave as (setq auth-source-netrc-use-gpg-tokens 'never)
(let* ((ep (format "Use GPG password tokens in %s?" file))
(gpg-encrypt
(cond
((eq auth-source-netrc-use-gpg-tokens 'never)
'never)
((listp auth-source-netrc-use-gpg-tokens)
(let ((check (copy-sequence
auth-source-netrc-use-gpg-tokens))
item ret)
(while check
(setq item (pop check))
(when (or (eq (car item) t)
(string-match (car item) file))
(setq ret (cdr item))
(setq check nil)))
ret))
(t 'never)))
(plain
(or (eval default)
(read-passwd (format-prompt prompt nil)))))
;; ask if we don't know what to do (in which case
;; auth-source-netrc-use-gpg-tokens must be a list)
(unless gpg-encrypt
(setq gpg-encrypt (if (y-or-n-p ep) 'gpg 'never))
;; TODO: save the defcustom now? or ask?
(setq auth-source-netrc-use-gpg-tokens
(cons `(,file ,gpg-encrypt)
auth-source-netrc-use-gpg-tokens)))
(if (eq gpg-encrypt 'gpg)
(auth-source-epa-make-gpg-token plain file)
plain))
(if (and (stringp default) auth-source-save-behavior)
(read-string
(format-prompt prompt default) nil nil default)
(eval default)))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when data
(setq artificial (plist-put artificial
(auth-source--symbol-keyword r)
(if (eq r 'secret)
(let ((data data))
(lambda () data))
data))))
;; When r is not an empty string...
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when (and (stringp data)
(< 0 (length data)))
(when (eq r 'secret)
(setq save-function t))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
;; this function is not strictly necessary but I think it
;; makes the code clearer -tzz
(let ((printer (lambda ()
;; append the key (the symbol name of r)
;; and the value in r
(format "%s%s %s"
;; prepend a space
(if (zerop (length add)) "" " ")
;; remap auth-source tokens to netrc
(cl-case r
(user "login")
(host "machine")
(secret "password")
(port "port") ; redundant but clearer
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(t (symbol-name r)))
(if (string-match "[\"# ]" data)
(format "%S" data)
data)))))
Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin.
2011-02-23 13:35:35 +00:00
(setq add (concat add (funcall printer)))))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(when save-function
(plist-put
artificial
:save-function
(let ((file file)
(add add))
(lambda () (auth-source-netrc-saver file add)))))
(list artificial)))
(defun auth-source-netrc-saver (file add)
"Save a line ADD in FILE, prompting along the way.
Respects `auth-source-save-behavior'. Uses
`auth-source-netrc-cache' to avoid prompting more than once."
(let* ((key (format "%s %s" file (rfc2104-hash 'md5 64 16 file add)))
(cached (assoc key auth-source-netrc-cache)))
(if cached
(auth-source-do-trivia
"auth-source-netrc-saver: found previous run for key %s, returning"
key)
(with-temp-buffer
(when (file-exists-p file)
(insert-file-contents file))
(when auth-source-gpg-encrypt-to
;; (see bug#7487) making `epa-file-encrypt-to' local to
;; this buffer lets epa-file skip the key selection query
;; (see the `local-variable-p' check in
;; `epa-file-write-region').
(unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
(make-local-variable 'epa-file-encrypt-to))
(if (listp auth-source-gpg-encrypt-to)
(setq epa-file-encrypt-to auth-source-gpg-encrypt-to)))
;; we want the new data to be found first, so insert at beginning
(goto-char (point-min))
;; Ask AFTER we've successfully opened the file.
(let ((prompt (format "Save auth info to file %s? " file))
(done (not (eq auth-source-save-behavior 'ask)))
(bufname "*auth-source Help*")
k)
(while (not done)
(setq k (auth-source-read-char-choice prompt '(?y ?n ?N ?e ??)))
(cl-case k
(?y (setq done t))
(?? (save-excursion
(with-output-to-temp-buffer bufname
(princ
(concat "(y)es, save\n"
"(n)o but use the info\n"
"(N)o and don't ask to save again\n"
"(e)dit the line\n"
"(?) for help as you can see.\n"))
;; Why? Doesn't with-output-to-temp-buffer already do
;; the exact same thing anyway? --Stef
(set-buffer standard-output)
(help-mode))))
(?n (setq add ""
done t))
(?N
(setq add ""
done t)
(customize-save-variable 'auth-source-save-behavior nil))
(?e (setq add (read-string "Line to add: " add)))
(t nil)))
(when (get-buffer-window bufname)
(delete-window (get-buffer-window bufname)))
;; Make sure the info is not saved.
(when (null auth-source-save-behavior)
(setq add ""))
(when (< 0 (length add))
(progn
(unless (bolp)
(insert "\n"))
(insert add "\n")
(write-region (point-min) (point-max) file nil 'silent)
;; Make the .authinfo file non-world-readable.
(set-file-modes file #o600)
(auth-source-do-debug
"auth-source-netrc-create: wrote 1 new line to %s"
file)
(message "Saved new authentication information to %s" file)
nil))))
(auth-source--aput auth-source-netrc-cache key "ran"))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;;; Backend specific parsing: Secrets API backend
(defun auth-source-secrets-listify-pattern (pattern)
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 10:12:27 +00:00
"Convert a PATTERN with lists to a list of string patterns.
auth-source patterns can have values of the form :foo (\"bar\"
\"qux\"), which means to match any secret with :foo equal to
2014-02-23 02:46:12 +00:00
\"bar\" or :foo equal to \"qux\". The secrets backend supports
only string values for patterns, so this routine returns a list
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 10:12:27 +00:00
of patterns that is equivalent to the single original PATTERN
when interpreted such that if a secret matches any pattern in the
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 10:12:27 +00:00
list, it matches the original PATTERN."
(if (null pattern)
'(nil)
(let* ((key (pop pattern))
(value (pop pattern))
(tails (auth-source-secrets-listify-pattern pattern))
(heads (if (stringp value)
(list (list key value))
(mapcar (lambda (v) (list key v)) value))))
(cl-loop for h in heads
nconc (cl-loop for tl in tails collect (append h tl))))))
(cl-defun auth-source-secrets-search (&rest spec
&key backend create delete label max
&allow-other-keys)
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
"Search the Secrets API; spec is like `auth-source'.
The :label key specifies the item's label. It is the only key
that can specify a substring. Any :label value besides a string
will allow any label.
All other search keys must match exactly. If you need substring
matching, do a wider search and narrow it down yourself.
You'll get back all the properties of the token as a plist.
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
Here's an example that looks for the first item in the `Login'
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Secrets collection:
(let ((auth-sources \\='(\"secrets:Login\")))
(auth-source-search :max 1))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
Here's another that looks for the first item in the `Login'
Secrets collection whose label contains `gnus':
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(let ((auth-sources \\='(\"secrets:Login\")))
(auth-source-search :max 1 :label \"gnus\"))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
And this one looks for the first item in the `Login' Secrets
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
collection that's a Google Chrome entry for the git.gnus.org site
authentication tokens:
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(let ((auth-sources \\='(\"secrets:Login\")))
(auth-source-search :max 1 :signon_realm \"https://git.gnus.org/Git\"))"
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; TODO
;; (secrets-delete-item coll elt)
(cl-assert (not delete) nil
"The Secrets API auth-source backend doesn't support deletion yet")
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(let* ((coll (oref backend source))
(max (or max 5000)) ; sanity check: default to stop at 5K
(ignored-keys '(:create :delete :max :backend :label :require :type))
(search-keys (cl-loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; build a search spec without the ignored keys
;; if a search key is nil or t (match anything), we skip it
(search-specs (auth-source-secrets-listify-pattern
(apply #'append (mapcar
(lambda (k)
(let ((v (plist-get spec k)))
(if (or (null v)
(eq t v))
nil
(list
k
(auth-source-ensure-strings v)))))
search-keys))))
;; needed keys (always including host, login, port, and secret)
(returned-keys (delete-dups (append
'(:host :login :port :secret)
search-keys)))
(items
(cl-loop
for search-spec in search-specs
nconc
(cl-loop for item in (apply #'secrets-search-items coll search-spec)
unless (and (stringp label)
(not (string-match label item)))
collect item)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; TODO: respect max in `secrets-search-items', not after the fact
(items (take max items))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
;; convert the item name to a full plist
(items (mapcar (lambda (item)
(append
;; make an entry for the secret (password) element
(list
:secret
(let ((v (secrets-get-secret coll item)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(lambda () v)))
;; rewrite the entry from ((k1 v1) (k2 v2)) to plist
(apply #'append
(mapcar (lambda (entry)
(list (car entry) (cdr entry)))
(secrets-get-attributes coll item)))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
items))
;; ensure each item has each key in `returned-keys'
(items (mapcar (lambda (plist)
(append
(apply #'append
(mapcar (lambda (req)
(if (plist-get plist req)
nil
(list req nil)))
returned-keys))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
plist))
items)))
(cond
;; if we need to create an entry AND none were found to match
((and create
(not items))
;; create based on the spec and record the value
(setq items (or
;; if the user did not want to create the entry
;; in the file, it will be returned
(apply (slot-value backend 'create-function) spec)
;; if not, we do the search again without :create
;; to get the updated data.
;; the result will be returned, even if the search fails
(apply #'auth-source-secrets-search
(plist-put spec :create nil))))))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
items))
(cl-defun auth-source-secrets-create (&rest spec
&key backend host port create user
&allow-other-keys)
(let* ((base-required '(host user port secret label))
;; we know (because of an assertion in auth-source-search) that the
;; :create parameter is either t or a list (which includes nil)
(create-extra (if (eq t create) nil create))
(current-data (car (auth-source-search :max 1
:host host
:user user
:port port)))
(required (append base-required create-extra))
(collection (oref backend source))
;; Whether to set save-function.
save-function
;; `args' are the arguments for `secrets-create-item'.
args
;; `valist' is an alist
valist
;; `artificial' will be returned if no creation is needed
artificial)
;; only for base required elements (defined as function parameters):
;; fill in the valist with whatever data we may have from the search
;; we complete the first value if it's a list and use the value otherwise
(dolist (br base-required)
(let ((val (plist-get spec (auth-source--symbol-keyword br))))
(when val
(let ((br-choice (cond
;; all-accepting choice (predicate is t)
((eq t val) nil)
;; just the value otherwise
(t val))))
(when br-choice
(auth-source--aput valist br br-choice))))))
;; for extra required elements, see if the spec includes a value for them
(dolist (er create-extra)
(let ((k (auth-source--symbol-keyword er))
(keys (cl-loop for i below (length spec) by 2
collect (nth i spec))))
(when (memq k keys)
(auth-source--aput valist er (plist-get spec k)))))
;; for each required element
(dolist (r required)
(let* ((data (auth-source--aget valist r))
;; take the first element if the data is a list
(data (or (auth-source-netrc-element-or-first data)
(plist-get current-data
(auth-source--symbol-keyword r))))
;; this is the default to be offered
(given-default (auth-source--aget
auth-source-creation-defaults r))
;; the default supplementals are simple:
;; for the user, try `given-default' and then (user-login-name);
;; for the label, try `given-default' and then user@host;
;; otherwise take `given-default'
(default (cond
((and (not given-default) (eq r 'user))
(user-login-name))
((and (not given-default) (eq r 'label))
(format "%s@%s"
(or (auth-source-netrc-element-or-first
(auth-source--aget valist 'user))
(plist-get artificial :user))
(or (auth-source-netrc-element-or-first
(auth-source--aget valist 'host))
(plist-get artificial :host))))
(t given-default)))
(printable-defaults (list
(cons 'user
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'user))
(plist-get artificial :user)
"[any user]"))
(cons 'host
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'host))
(plist-get artificial :host)
"[any host]"))
(cons 'port
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'port))
(plist-get artificial :port)
"[any port]"))
(cons 'label
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'label))
(plist-get artificial :label)
"[any label]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h")
(label "Enter label for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
(?h ,(auth-source--aget printable-defaults 'host))
(?p ,(auth-source--aget printable-defaults 'port))))))
;; Store the data, prompting for the password if needed.
(setq data (or data
(if (eq r 'secret)
(or (eval default)
(read-passwd (format-prompt prompt nil)))
(if (and (stringp default) auth-source-save-behavior)
(read-string
(format-prompt prompt default) nil nil default)
(eval default)))))
(when data
(setq artificial (plist-put artificial
(auth-source--symbol-keyword r)
(if (eq r 'secret)
(let ((data data))
(lambda () data))
data))))
;; When r is not an empty string...
(when (and (stringp data)
(< 0 (length data)))
(if (eq r 'secret)
(setq save-function t)
(if (not (eq r 'label))
;; append the key (the symbol name of r)
;; and the value in r
(setq args (append args (list (auth-source--symbol-keyword r) data))))))))
(when save-function
(plist-put
artificial
:save-function
(let ((collection collection)
(item (plist-get artificial :label))
(secret (auth-info-password artificial)))
(lambda ()
(auth-source-secrets-saver collection item secret args)))))
(list artificial)))
Merge changes made in Gnus trunk. auth.texi (Overview, Help for users, Help for developers): Update docs. (Help for users): Talk about spaces. sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it. nnimap.el: Autoload `auth-source-forget+'. (nnimap-open-connection-1): Use it if the connection fails. auth-source.el: Require `password-cache'. (auth-source-hide-passwords, auth-source-cache): Remove and mark obsolete. (auth-source-magic): Marker for `password-cache' keys. (auth-source-do-cache): Update docstring. (auth-source-search): Use and check cache. (auth-source-forget-all-cached, auth-source-remember) (auth-source-recall, auth-source-forget, auth-source-forget+) (auth-source-specmatchp): Caching support functions. (auth-source-forget-user-or-password, auth-source-forget-all-cached): Remove and obsolete. (auth-source-user-or-password): Remove caching to further discourage using it. Always hide passwords. password-cache.el (password-cache-remove): Accept secrets that are not strings. mail-source.el: Autoload `auth-source-search'. (mail-source-keyword-map): Note order matters. (mail-source-set-1): Get all the mail-source source values and defaults and search auth-source on those if needed. This can all probably be simplified. nnimap.el: Autoload `auth-source-search'. (nnimap-credentials): Use it. (nnimap-open-connection-1): Ask for the virtual server and physical address in one shot. nntp.el: Autoload `auth-source-search'. (nntp-send-authinfo): Use it. Note TODO. auth-source.el (auth-source-secrets-search, auth-source-user-or-password): Use `append' instead of `nconc'. (auth-source-user-or-password): Build return list better and protect against nil :secret. auth-source.el (top): Require 'eieio unconditionally. Autoload `secrets-get-attributes' instead of `secrets-get-attribute'. (auth-source-secrets-search): Limit search when `max' is greater than number of results. auth-source.el (auth-source-secrets-search): Add examples. auth-source.el (auth-sources): Allow for simpler defaults for Secrets API with a string "secrets:collection-name" and with 'default. (auth-source-backend-parse): Parse "secrets:collection-name" and 'default. Recurse on parses instead of repeating code. Use the Secrets API is the source is not nil and 'ignore otherwise. Emit a message when ignoring a source. (auth-source-search): List ignored search keys at the top level. (auth-source-netrc-create): Use `case' instead of `cond'. (auth-source-secrets-search): Created with TODOs. (auth-source-secrets-create): Created with TODOs. (auth-source-retrieve, auth-source-create, auth-source-delete) (auth-source-protocol-defaults, auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) (auth-source-user-or-password-sftp) (auth-source-user-or-password-smtp): Removed. (auth-source-user-or-password): Deprecated and modified to be a wrapper around `auth-source-search'. Not tested thoroughly. auth-source.el: Bring in assoc and eioeio libraries. (secrets-enabled): New variable to track the status of the Secrets API. (auth-source-backend): New EIOEIO class to represent a backend. (auth-source-creation-defaults): New variable to set prompt defaults during token creation (see the `auth-source-search' docstring for details). (auth-sources): Simplify to allow a simple string as a netrc backend spec. (auth-source-backend-parse): Parse a backend from an `auth-sources' spec. (auth-source-backend-parse-parameters): Fill in the backend parameters. (auth-source-search): Main auth-source API entry point. (auth-source-delete): Wrapper around `auth-source-search' for deletion. (auth-source-search-collection): Helper function for searching. (auth-source-netrc-parse, auth-source-netrc-normalize) (auth-source-netrc-search, auth-source-netrc-create): Netrc backend. Supports search, create, and delete. (auth-source-secrets-search, auth-source-secrets-create): Secrets API backend stubs. (auth-source-user-or-password): Call `auth-source-search' but it's not ready yet.
2011-02-13 00:25:29 +00:00
(defun auth-source-secrets-saver (collection item secret args)
"Wrapper around `secrets-create-item', prompting along the way.
Respects `auth-source-save-behavior'."
(let ((prompt (format "Save auth info to secrets collection %s? " collection))
(done (not (eq auth-source-save-behavior 'ask)))
(doit (eq auth-source-save-behavior t))
(bufname "*auth-source Help*")
k)
(while (not done)
(setq k (auth-source-read-char-choice prompt '(?y ?n ?N ??)))
(cl-case k
(?y (setq done t doit t))
(?? (save-excursion
(with-output-to-temp-buffer bufname
(princ
(concat "(y)es, save\n"
"(n)o but use the info\n"
"(N)o and don't ask to save again\n"
"(?) for help as you can see.\n"))
;; Why? Doesn't with-output-to-temp-buffer already do
;; the exact same thing anyway? --Stef
(set-buffer standard-output)
(help-mode))))
(?n (setq done t doit nil))
(?N (setq done t doit nil)
(customize-save-variable 'auth-source-save-behavior nil))
(t nil)))
(when doit
(progn
(auth-source-do-debug
"secrets-create-item: wrote 1 new item to %s" collection)
(message "Saved new authentication information to %s" collection)
(apply 'secrets-create-item collection item secret args)))))
;;; Backend specific parsing: Mac OS Keychain (using /usr/bin/security) backend
(cl-defun auth-source-macos-keychain-search (&rest spec
&key backend create delete type max
&allow-other-keys)
"Search the macOS Keychain; spec is like `auth-source'.
All search keys must match exactly. If you need substring
matching, do a wider search and narrow it down yourself.
You'll get back all the properties of the token as a plist.
Prefer directed to neutral quotes Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
2015-08-25 06:39:33 +00:00
The :type key is either `macos-keychain-internet' or
`macos-keychain-generic'.
For the internet keychain type, the :label key searches the
item's labels (\"-l LABEL\" passed to \"/usr/bin/security\").
Similarly, :host maps to \"-s HOST\", :user maps to \"-a USER\",
and :port maps to \"-P PORT\" or \"-r PROT\"
\(note PROT has to be a 4-character string).
For the generic keychain type, the :label key searches the item's
labels (\"-l LABEL\" passed to \"/usr/bin/security\").
Similarly, :host maps to \"-c HOST\" (the \"creator\" keychain
field), :user maps to \"-a USER\", and :port maps to \"-s PORT\".
Here's an example that looks for the first item in the default
generic macOS Keychain:
(let ((auth-sources \\='(macos-keychain-generic)))
(auth-source-search :max 1)
Here's another that looks for the first item in the internet
macOS Keychain collection whose label is `gnus':
(let ((auth-sources \\='(macos-keychain-internet)))
(auth-source-search :max 1 :label \"gnus\")
And this one looks for the first item in the internet keychain
entries for git.gnus.org:
(let ((auth-sources \\='(macos-keychain-internet\")))
(auth-source-search :max 1 :host \"git.gnus.org\"))"
;; TODO
(cl-assert (not create) nil
"The macOS Keychain auth-source backend doesn't support creation yet")
;; TODO
;; (macos-keychain-delete-item coll elt)
(cl-assert (not delete) nil
"The macOS Keychain auth-source backend doesn't support deletion yet")
(let* ((coll (oref backend source))
(max (or max 5000)) ; sanity check: default to stop at 5K
;; Filter out ignored keys from the spec
(ignored-keys '(:create :delete :max :backend :label :host :port))
;; Build a search spec without the ignored keys
;; FIXME make this loop a function? it's used in at least 3 places
(search-keys (cl-loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
;; If a search key value is nil or t (match anything), we skip it
(search-spec (apply #'append (mapcar
(lambda (k)
(if (or (null (plist-get spec k))
(eq t (plist-get spec k)))
nil
(list k (plist-get spec k))))
search-keys)))
;; needed keys (always including host, login, port, and secret)
(returned-keys (delete-dups (append
'(:host :login :port :secret)
search-keys)))
;; Extract host, port and user from spec
(hosts (plist-get spec :host))
(hosts (if (consp hosts) hosts `(,hosts)))
(ports (plist-get spec :port))
(ports (if (consp ports) ports `(,ports)))
(users (plist-get spec :user))
(users (if (consp users) users `(,users)))
;; Loop through all combinations of host/port and pass each of these to
;; auth-source-macos-keychain-search-items. Convert numeric port to
;; string (bug#68376).
(items (catch 'match
(dolist (host hosts)
(dolist (port ports)
(when (numberp port) (setq port (number-to-string port)))
(dolist (user users)
(let ((items (apply
#'auth-source-macos-keychain-search-items
coll
type
max
host port user
search-spec)))
(when items
(throw 'match items))))))))
;; ensure each item has each key in `returned-keys'
(items (mapcar (lambda (plist)
(append
(apply #'append
(mapcar (lambda (req)
(if (plist-get plist req)
nil
(list req nil)))
returned-keys))
plist))
items)))
items))
(defun auth-source--decode-octal-string (string)
"Convert octal STRING to utf-8 string. E.g.: \"a\\134b\" to \"a\\b\"."
(let ((list (string-to-list string))
(size (length string)))
(decode-coding-string
(apply #'unibyte-string
(cl-loop for i = 0 then (+ i (if (eq (nth i list) ?\\) 4 1))
for var = (nth i list)
while (< i size)
if (eq var ?\\)
collect (string-to-number
(concat (cl-subseq list (+ i 1) (+ i 4))) 8)
else
collect var))
'utf-8)))
(cl-defun auth-source-macos-keychain-search-items (coll _type _max
host port user
&key label type
&allow-other-keys)
(let* ((keychain-generic (eq type 'macos-keychain-generic))
(args `(,(if keychain-generic
"find-generic-password"
"find-internet-password")
"-g"))
(ret (list :type type)))
(when label
(setq args (append args (list "-l" label))))
(when host
(setq args (append args (list (if keychain-generic "-c" "-s") host))))
(when user
(setq args (append args (list "-a" user))))
(when port
(if keychain-generic
(setq args (append args (list "-s" port)))
(setq args (append args (if (string-match-p "\\`[[:digit:]]+\\'" port)
(list "-P" port)
(list "-r" (substring
(format "%-4s" port)
0 4)))))))
(unless (equal coll "default")
(setq args (append args (list coll))))
(with-temp-buffer
(apply #'call-process "/usr/bin/security" nil t nil args)
(goto-char (point-min))
(while (not (eobp))
(cond
((looking-at "^password: \\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"")
(setq ret (auth-source-macos-keychain-result-append
ret
keychain-generic
"secret"
(let ((v (auth-source--decode-octal-string
(match-string 1))))
(lambda () v)))))
;; TODO: check if this is really the label
;; match 0x00000007 <blob>="AppleID"
((looking-at
"^[ ]+0x00000007 <blob>=\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"")
(setq ret (auth-source-macos-keychain-result-append
ret
keychain-generic
"label"
(auth-source--decode-octal-string (match-string 1)))))
;; match "crtr"<uint32>="aapl"
;; match "svce"<blob>="AppleID"
((looking-at
"^[ ]+\"\\([a-z]+\\)\"[^=]+=\\(?:0x[0-9A-F]+\\)? *\"\\(.+\\)\"")
(setq ret (auth-source-macos-keychain-result-append
ret
keychain-generic
(auth-source--decode-octal-string (match-string 1))
(auth-source--decode-octal-string (match-string 2))))))
(forward-line)))
;; return `ret' iff it has the :secret key
(and (plist-get ret :secret) (list ret))))
(defun auth-source-macos-keychain-result-append (result generic k v)
(push v result)
(push (auth-source--symbol-keyword
(cond
((equal k "acct") "user")
;; for generic keychains, creator is host, service is port
((and generic (equal k "crtr")) "host")
((and generic (equal k "svce")) "port")
;; for internet keychains, protocol is port, server is host
((and (not generic) (equal k "ptcl")) "port")
((and (not generic) (equal k "srvr")) "host")
(t k)))
result))
(defun auth-source-macos-keychain-create (&rest spec)
;; TODO
(debug spec))
;;; Backend specific parsing: PLSTORE backend
(cl-defun auth-source-plstore-search (&rest spec
&key backend create delete max
&allow-other-keys)
lisp/*.el: Fix typos and improve some docstrings * lisp/auth-source.el (auth-source-backend-parse-parameters) (auth-source-search-collection) (auth-source-secrets-listify-pattern) (auth-source--decode-octal-string, auth-source-plstore-search): * lisp/registry.el (registry-lookup) (registry-lookup-breaks-before-lexbind) (registry-lookup-secondary, registry-lookup-secondary-value) (registry-search, registry-delete, registry-size, registry-full) (registry-insert, registry-reindex, registry-prune) (registry-collect-prune-candidates): * lisp/subr.el (nbutlast, process-live-p): * lisp/tab-bar.el (tab-bar-list): * lisp/cedet/ede/linux.el (ede-linux--get-archs) (ede-linux--include-path, ede-linux-load): * lisp/erc/erc-log.el (erc-log-all-but-server-buffers): * lisp/erc/erc-pcomplete.el (pcomplete-erc-commands) (pcomplete-erc-ops, pcomplete-erc-not-ops, pcomplete-erc-nicks) (pcomplete-erc-all-nicks, pcomplete-erc-channels) (pcomplete-erc-command-name, pcomplete-erc-parse-arguments): * lisp/eshell/em-term.el (eshell-visual-command-p): * lisp/gnus/gnus-cache.el (gnus-cache-fully-p): * lisp/gnus/nnmail.el (nnmail-get-active) (nnmail-fancy-expiry-target): * lisp/mail/mail-utils.el (mail-string-delete): * lisp/mail/supercite.el (sc-hdr, sc-valid-index-p): * lisp/net/ange-ftp.el (ange-ftp-use-smart-gateway-p): * lisp/net/nsm.el (nsm-save-fingerprint-maybe) (nsm-network-same-subnet, nsm-should-check): * lisp/net/rcirc.el (rcirc-looking-at-input): * lisp/net/tramp-cache.el (tramp-get-hash-table): * lisp/net/tramp-compat.el (tramp-compat-process-running-p): * lisp/net/tramp-smb.el (tramp-smb-get-share) (tramp-smb-get-localname, tramp-smb-read-file-entry) (tramp-smb-get-cifs-capabilities, tramp-smb-get-stat-capability): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services) (zeroconf-get-host, zeroconf-get-domain) (zeroconf-get-host-domain): * lisp/nxml/rng-xsd.el (rng-xsd-compile) (rng-xsd-make-date-time-regexp, rng-xsd-convert-date-time): * lisp/obsolete/erc-hecomplete.el (erc-hecomplete) (erc-command-list, erc-complete-at-prompt): * lisp/org/ob-scheme.el (org-babel-scheme-get-buffer-impl): * lisp/org/ob-shell.el (org-babel--variable-assignments:sh-generic) (org-babel--variable-assignments:bash_array) (org-babel--variable-assignments:bash_assoc) (org-babel--variable-assignments:bash): * lisp/org/org-clock.el (org-day-of-week): * lisp/progmodes/cperl-mode.el (cperl-char-ends-sub-keyword-p): * lisp/progmodes/gud.el (gud-find-c-expr, gud-innermost-expr) (gud-prev-expr, gud-next-expr): * lisp/textmodes/table.el (table--at-cell-p, table--probe-cell) (table--get-cell-justify-property) (table--get-cell-valign-property) (table--put-cell-justify-property) (table--put-cell-valign-property): Fix typos. * lisp/so-long.el (fboundp): Doc fix. (so-long-mode-line-info, so-long-mode) (so-long--check-header-modes): Fix typos. * lisp/emulation/viper-mous.el (viper-surrounding-word) (viper-mouse-click-get-word): Fix typos. (viper-mouse-click-search-word): Doc fix. * lisp/erc/erc-backend.el (erc-forward-word, erc-word-at-arg-p) (erc-bounds-of-word-at-point): Fix typos. (erc-decode-string-from-target, define-erc-response-handler): Refill docstring. * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): Fix typo. (erc-dcc-get-host, erc-dcc-auto-mask-p, erc-dcc-get-file): Doc fixes. * lisp/erc/erc-networks.el (erc-network-name): Fix typo. (erc-determine-network): Refill docstring. * lisp/net/dbus.el (dbus-list-hash-table) (dbus-string-to-byte-array, dbus-byte-array-to-string) (dbus-check-event): Fix typos. (dbus-introspect-get-property): Doc fix. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler): Rename ARGS to ARGUMENTS. Doc fix. (tramp-adb-sh-fix-ls-output, tramp-adb-execute-adb-command) (tramp-adb-find-test-command): Fix typos. * lisp/net/tramp.el (tramp-set-completion-function) (tramp-get-completion-function) (tramp-completion-dissect-file-name) (tramp-completion-dissect-file-name1) (tramp-get-completion-methods, tramp-get-completion-user-host) (tramp-get-inode, tramp-get-device, tramp-mode-string-to-int) (tramp-call-process, tramp-call-process-region) (tramp-process-lines): Fix typos. (tramp-interrupt-process): Doc fix. * lisp/org/ob-core.el (org-babel-named-src-block-regexp-for-name) (org-babel-named-data-regexp-for-name): Doc fix. (org-babel-src-block-names, org-babel-result-names): Fix typos. * lisp/progmodes/inf-lisp.el (lisp-input-filter): Doc fix. (lisp-fn-called-at-pt): Fix typo. * lisp/progmodes/xref.el (xref-backend-identifier-at-point): Doc fix. (xref-backend-identifier-completion-table): Fix typo.
2019-10-20 10:12:27 +00:00
"Search the PLSTORE; SPEC is like `auth-source'."
(let* ((store (oref backend data))
(max (or max 5000)) ; sanity check: default to stop at 5K
(ignored-keys '(:create :delete :max :backend :label :require :type))
(search-keys (cl-loop for i below (length spec) by 2
unless (memq (nth i spec) ignored-keys)
collect (nth i spec)))
;; build a search spec without the ignored keys
;; if a search key is nil or t (match anything), we skip it
(search-spec (apply #'append (mapcar
(lambda (k)
(let ((v (plist-get spec k)))
(if (or (null v)
(eq t v))
nil
(list
k
(auth-source-ensure-strings v)))))
search-keys)))
;; needed keys (always including host, login, port, and secret)
(returned-keys (delete-dups (append
'(:host :login :port :secret)
search-keys)))
(items (plstore-find store search-spec))
(item-names (mapcar #'car items))
(items (take max items))
;; convert the item to a full plist
(items (mapcar (lambda (item)
(let* ((plist (copy-tree (cdr item)))
(secret (plist-member plist :secret)))
(if secret
(setcar
(cdr secret)
(let ((v (car (cdr secret))))
(if (functionp v)
(lambda () (funcall v plist))
(lambda () v)))))
plist))
items))
;; ensure each item has each key in `returned-keys'
(items (mapcar (lambda (plist)
(append
(apply #'append
(mapcar (lambda (req)
(if (plist-get plist req)
nil
(list req nil)))
returned-keys))
plist))
items)))
(cond
;; if we need to create an entry AND none were found to match
((and create
(not items))
;; create based on the spec and record the value
(setq items (or
;; if the user did not want to create the entry
;; in the file, it will be returned
(apply (slot-value backend 'create-function) spec)
;; if not, we do the search again without :create
;; to get the updated data.
;; the result will be returned, even if the search fails
(apply #'auth-source-plstore-search
(plist-put spec :create nil)))))
((and delete
item-names)
(dolist (item-name item-names)
(plstore-delete store item-name))
(plstore-save store)))
items))
(cl-defun auth-source-plstore-create (&rest spec
&key backend host port create user
&allow-other-keys)
(let* ((base-required '(host user port secret))
(base-secret '(secret))
;; we know (because of an assertion in auth-source-search) that the
;; :create parameter is either t, or a list (which includes nil
;; or a plist)
(create-extra-secret (plist-get create :encrypted))
(create-extra (if (eq t create) nil
(or (append (plist-get create :unencrypted)
create-extra-secret)
create)))
(current-data (car (auth-source-search :max 1
:host host
:user user
:port port)))
(required (append base-required create-extra))
(required-secret (append base-secret create-extra-secret))
;; `valist' is an alist
valist
;; `artificial' will be returned if no creation is needed
artificial
secret-artificial)
;; only for base required elements (defined as function parameters):
;; fill in the valist with whatever data we may have from the search
;; we complete the first value if it's a list and use the value otherwise
(dolist (br base-required)
(let ((val (plist-get spec (auth-source--symbol-keyword br))))
(when val
(let ((br-choice (cond
;; all-accepting choice (predicate is t)
((eq t val) nil)
;; just the value otherwise
(t val))))
(when br-choice
(auth-source--aput valist br br-choice))))))
;; for extra required elements, see if the spec includes a value for them
(let ((keys (cl-loop for i below (length spec) by 2
collect (nth i spec)))
k)
(dolist (er create-extra)
(setq k (auth-source--symbol-keyword er))
(when (memq k keys)
(auth-source--aput valist er (plist-get spec k)))))
;; for each required element
(dolist (r required)
(let* ((data (auth-source--aget valist r))
;; take the first element if the data is a list
(data (or (auth-source-netrc-element-or-first data)
(plist-get current-data
(auth-source--symbol-keyword r))))
;; this is the default to be offered
(given-default (auth-source--aget
auth-source-creation-defaults r))
;; the default supplementals are simple:
;; for the user, try `given-default' and then (user-login-name);
;; otherwise take `given-default'
(default (cond
((and (not given-default) (eq r 'user))
(user-login-name))
(t given-default)))
(printable-defaults (list
(cons 'user
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'user))
(plist-get artificial :user)
"[any user]"))
(cons 'host
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'host))
(plist-get artificial :host)
"[any host]"))
(cons 'port
(or
(auth-source-netrc-element-or-first
(auth-source--aget valist 'port))
(plist-get artificial :port)
"[any port]"))))
(prompt (or (auth-source--aget auth-source-creation-prompts r)
(cl-case r
(secret "%p password for %u@%h")
(user "%p user name for %h")
(host "%p host name for user %u")
(port "%p port for %u@%h"))
(format "Enter %s (%%u@%%h:%%p)" r)))
(prompt (auth-source-format-prompt
prompt
`((?u ,(auth-source--aget printable-defaults 'user))
(?h ,(auth-source--aget printable-defaults 'host))
(?p ,(auth-source--aget printable-defaults 'port))))))
;; Store the data, prompting for the password if needed.
(setq data (or data
(if (eq r 'secret)
(or (eval default)
(read-passwd (format-prompt prompt nil)))
(if (and (stringp default) auth-source-save-behavior)
(read-string
(format-prompt prompt default) nil nil default)
(eval default)))))
(when data
(if (member r required-secret)
(setq secret-artificial
(plist-put secret-artificial
(auth-source--symbol-keyword r)
data))
(setq artificial (plist-put artificial
(auth-source--symbol-keyword r)
data))))))
(plstore-put (oref backend data)
(sha1 (format "%s@%s:%s"
(plist-get artificial :user)
(plist-get artificial :host)
(plist-get artificial :port)))
artificial secret-artificial)
(if (y-or-n-p (format "Save auth info to file %s? "
(plstore-get-file (oref backend data))))
(plstore-save (oref backend data)))))
;;; Backend specific parsing: JSON backend
;; (auth-source-search :max 1 :machine "imap.gmail.com")
;; (auth-source-search :max 1 :host '("my-gmail" "imap.gmail.com") :port '(993 "imaps" "imap" "993" "143") :user nil :require '(:user :secret))
(defun auth-source-json-check (host user port require item)
(and item
(auth-source-search-collection
(or host t)
(or
(plist-get item :machine)
(plist-get item :host)
t))
(auth-source-search-collection
(or user t)
(or
(plist-get item :login)
(plist-get item :account)
(plist-get item :user)
t))
(auth-source-search-collection
(or port t)
(or
(plist-get item :port)
(plist-get item :protocol)
t))
(or
;; the required list of keys is nil, or
(null require)
;; every element of require is in
(cl-loop for req in require
always (plist-get item req)))))
(cl-defun auth-source-json-search (&rest spec
&key backend require
type max host user port
&allow-other-keys)
"Given a property list SPEC, return search matches from the `:backend'.
See `auth-source-search' for details on SPEC."
;; just in case, check that the type is correct (null or same as the backend)
(cl-assert (or (null type) (eq type (oref backend type)))
t "Invalid JSON search: %s %s")
;; Hide the secrets early to avoid accidental exposure.
(let* ((jdata
(mapcar (lambda (entry)
(let (ret)
(while entry
(let* ((item (pop entry))
(k (auth-source--symbol-keyword (car item)))
(v (cdr item)))
(setq k (cond ((memq k '(:machine)) :host)
((memq k '(:login :account)) :user)
((memq k '(:protocol)) :port)
((memq k '(:password)) :secret)
(t k)))
;; send back the secret in a function (lexical binding)
(when (eq k :secret)
(setq v (let ((lexv v))
(lambda () lexv))))
(setq ret (plist-put ret k v))))
ret))
(json-read-file (oref backend source))))
(max (or max 5000)) ; sanity check: default to stop at 5K
all)
(dolist (item jdata)
(when (and item
(> max (length all))
(auth-source-json-check host user port require item))
(push item all)))
(nreverse all)))
(defun auth-source-user-and-password (host &optional user)
(let* ((auth-info (car
(if user
(auth-source-search
:host host
:user user
:max 1
:require '(:user :secret)
:create nil)
(auth-source-search
:host host
:max 1
:require '(:user :secret)
:create nil))))
(user (plist-get auth-info :user))
(password (auth-info-password auth-info)))
(list user password auth-info)))
;;; Tiny mode for editing .netrc/.authinfo modes (that basically just
;;; hides passwords and adds basic syntax highlighting).
(defcustom authinfo-hidden "password"
"Regexp matching elements in .authinfo/.netrc files that should be hidden."
:type 'regexp
:version "27.1")
(defcustom authinfo-hide-elements t
"Whether to use `authinfo-hidden' to hide elements in authinfo files."
:type 'boolean
:version "28.1")
(defvar authinfo--keywords
'(("^#.*" . font-lock-comment-face)
("^\\(machine\\)[ \t]+\\([^ \t\n]+\\)"
(1 font-lock-variable-name-face)
(2 font-lock-builtin-face))
("\\(login\\)[ \t]+\\([^ \t\n]+\\)"
(1 font-lock-comment-delimiter-face)
(2 font-lock-keyword-face))
("\\(password\\)[ \t]+\\([^ \t\n]+\\)"
(1 font-lock-comment-delimiter-face)
(2 font-lock-doc-face))
("\\(port\\)[ \t]+\\([^ \t\n]+\\)"
(1 font-lock-comment-delimiter-face)
(2 font-lock-type-face))
("\\([^ \t\n]+\\)[, \t]+\\([^ \t\n]+\\)"
(1 font-lock-constant-face)
(2 nil))))
;;;###autoload
(define-derived-mode authinfo-mode fundamental-mode "Authinfo"
"Mode for editing .authinfo/.netrc files.
This is just like `fundamental-mode', but has basic syntax
highlighting and hides passwords. Passwords are revealed when
point is moved into the passwords (see `authinfo-hide-elements').
\\{authinfo-mode-map}"
(font-lock-add-keywords nil authinfo--keywords)
(setq-local comment-start "#")
(setq-local comment-end "")
(when authinfo-hide-elements
(authinfo--hide-passwords (point-min) (point-max))
(reveal-mode)))
(defun authinfo--hide-passwords (start end)
(save-excursion
(save-restriction
(narrow-to-region start end)
(goto-char start)
(while (re-search-forward (format "\\(\\s-\\|^\\)\\(%s\\)\\s-+"
authinfo-hidden)
nil t)
(when (auth-source-netrc-looking-at-token)
(let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
(overlay-put overlay 'display
(propertize "****" 'face 'font-lock-doc-face))
(overlay-put overlay 'reveal-toggle-invisible
#'authinfo--toggle-display)))))))
(defun authinfo--toggle-display (overlay hide)
(if hide
(overlay-put overlay 'display
(propertize "****" 'face 'font-lock-doc-face))
(overlay-put overlay 'display nil)))
;; It would be preferable to use "👁" ("\N{EYE}"). However, there is
;; no corresponding Unicode char with a slash. So we use symbols as
;; fallback only, with "⦵" ("\N{CIRCLE WITH HORIZONTAL BAR}") for
;; hiding the password.
(define-icon read-passwd--show-password-icon nil
'((image "reveal.svg" "reveal.pbm" :height (0.8 . em))
(symbol "👁")
(text "<o>"))
"Mode line icon to show a hidden password."
:group mode-line-faces
:version "30.1"
:help-echo "mouse-1: Toggle password visibility")
(define-icon read-passwd--hide-password-icon nil
'((image "conceal.svg" "conceal.pbm" :height (0.8 . em))
(symbol "")
(text "<\\>"))
"Mode line icon to hide a visible password."
:group mode-line-faces
:version "30.1"
:help-echo "mouse-1: Toggle password visibility")
(defvar read-passwd--mode-line-buffer nil
"Buffer to modify `mode-line-format' for showing/hiding passwords.")
(defvar read-passwd--mode-line-icon nil
"Propertized mode line icon for showing/hiding passwords.")
(defvar read-passwd--hide-password t
"Toggle whether password should be hidden in minubuffer.")
(defun read-passwd--hide-password ()
"Make password in minibuffer hidden or visible."
(let ((beg (minibuffer-prompt-end)))
(dotimes (i (1+ (- (buffer-size) beg)))
(if read-passwd--hide-password
(put-text-property
(+ i beg) (+ 1 i beg) 'display (string (or read-hide-char ?*)))
(remove-list-of-text-properties (+ i beg) (+ 1 i beg) '(display)))
(put-text-property
(+ i beg) (+ 1 i beg)
'help-echo "C-u: Clear password\nTAB: Toggle password visibility"))))
(defun read-passwd-toggle-visibility ()
"Toggle minibuffer contents visibility.
Adapt also mode line."
(interactive)
(let ((win (active-minibuffer-window)))
(unless win (error "No active minibuffer"))
;; FIXME: In case of a recursive minibuffer, this may select the wrong
;; mini-buffer.
(with-current-buffer (window-buffer win)
(setq read-passwd--hide-password (not read-passwd--hide-password))
(with-current-buffer read-passwd--mode-line-buffer
(setq read-passwd--mode-line-icon
`(:propertize
,(if icon-preference
(icon-string
(if read-passwd--hide-password
'read-passwd--show-password-icon
'read-passwd--hide-password-icon))
"")
mouse-face mode-line-highlight
keymap
,(eval-when-compile
(let ((map (make-sparse-keymap)))
(define-key map [mode-line mouse-1]
#'read-passwd-toggle-visibility)
map))))
(force-mode-line-update))
(read-passwd--hide-password))))
(defvar read-passwd-map
;; BEWARE: `defconst' would purecopy it, breaking the sharing with
;; minibuffer-local-map along the way!
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
(define-key map "\C-u" #'delete-minibuffer-contents) ;bug#12570
(define-key map "\t" #'read-passwd-toggle-visibility)
map)
"Keymap used while reading passwords.")
(define-minor-mode read-passwd-mode
"Toggle visibility of password in minibuffer."
:group 'mode-line
:group 'minibuffer
:keymap read-passwd-map
:version "30.1"
(setq read-passwd--hide-password nil
;; Stolen from `eldoc-minibuffer-message'.
read-passwd--mode-line-buffer
(window-buffer
(or (window-in-direction 'above (minibuffer-window))
(minibuffer-selected-window)
(get-largest-window))))
(if read-passwd-mode
(with-current-buffer read-passwd--mode-line-buffer
;; Add `read-passwd--mode-line-icon'.
(when (listp mode-line-format)
(setq mode-line-format
(cons '(:eval read-passwd--mode-line-icon)
mode-line-format))))
(with-current-buffer read-passwd--mode-line-buffer
;; Remove `read-passwd--mode-line-icon'.
(when (listp mode-line-format)
(setq mode-line-format (cdr mode-line-format)))))
(when read-passwd-mode
(read-passwd-toggle-visibility)))
(defvar overriding-text-conversion-style)
;;;###autoload
(defun read-passwd (prompt &optional confirm default)
"Read a password, prompting with PROMPT, and return it.
If optional CONFIRM is non-nil, read the password twice to make sure.
Optional DEFAULT is a default password to use instead of empty input.
This function echoes `*' for each character that the user types.
You could let-bind `read-hide-char' to another hiding character, though.
Once the caller uses the password, it can erase the password
by doing (clear-string STRING)."
(if confirm
(let (success)
(while (not success)
(let ((first (read-passwd prompt nil default))
(second (read-passwd "Confirm password: " nil default)))
(if (equal first second)
(progn
(and (arrayp second) (not (eq first second)) (clear-string second))
(setq success first))
(and (arrayp first) (clear-string first))
(and (arrayp second) (clear-string second))
(message "Password not repeated accurately; please start over")
(sit-for 1))))
success)
(let (minibuf)
(minibuffer-with-setup-hook
(lambda ()
(setq minibuf (current-buffer))
;; Turn off electricity.
(setq-local post-self-insert-hook nil)
(setq-local buffer-undo-list t)
(setq-local select-active-regions nil)
(use-local-map read-passwd-map)
(setq-local inhibit-modification-hooks nil) ;bug#15501.
(setq-local show-paren-mode nil) ;bug#16091.
(setq-local inhibit--record-char t)
(read-passwd-mode 1)
(add-hook 'post-command-hook #'read-passwd--hide-password nil t))
(unwind-protect
(let ((enable-recursive-minibuffers t)
(read-hide-char (or read-hide-char ?*))
(overriding-text-conversion-style 'password))
(read-string prompt nil t default)) ; t = "no history"
(when (buffer-live-p minibuf)
(with-current-buffer minibuf
(read-passwd-mode -1)
;; Not sure why but it seems that there might be cases where the
;; minibuffer is not always properly reset later on, so undo
;; whatever we've done here (bug#11392).
(remove-hook 'after-change-functions
#'read-passwd--hide-password 'local)
(kill-local-variable 'post-self-insert-hook)
;; And of course, don't keep the sensitive data around.
(erase-buffer)
;; Then restore the previous text conversion style.
(when (fboundp 'set-text-conversion-style)
(set-text-conversion-style text-conversion-style)))))))))
(provide 'auth-source)
;;; auth-source.el ends here