1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-20 04:30:55 -08:00
emacs/test/lisp/erc/resources/services/auth-source/libera.eld
F. Jason Park 0590224343 Standardize auth-source queries in ERC
* lisp/erc/erc.el (erc-password): Deprecate variable only used by
`erc-select-read-args'.  Server passwords are primarily used as
surrogates for other forms of authentication.  Such use is common but
nonstandard and often discouraged in favor of the de facto standard,
SASL.  Folks in the habit of invoking `erc(-tls)' interactively should
be encouraged to use auth-source instead.
(erc-select-read-args): Before this change, `erc-select-read-args'
offered to use the value of a non-nil `erc-password' as the :password
argument for `erc' and `erc-tls', referring to it as the "default"
password.  And when `erc-prompt-for-password' was nil and
`erc-password' wasn't, the latter was passed along unconditionally.
This only further complicated an already confusing situation for new
users, who in most cases shouldn't be worried about sending a PASS
command at all.  Until SASL arrives, they should provide server
passwords manually or learn to use auth-source.
(erc-auth-source-server-function, erc-auth-source-join-function): New
user options for retrieving a password externally, ostensibly by
calling `auth-source-search'.
(erc--auth-source-determine-params-defaults): New helper for
`erc--auth-source-search' with potential for exporting publicly in the
future.  Favors :host and :port fields above others.  Prioritizes
network IDs over announced servers and dialed endpoints.
(erc--auth-source-determine-params-merge): Add new function for
merging contextual and default parameters.  This is another contender
for possible exporting.
(erc--auth-source-search): New function for consulting auth-source and
sorting the result as filtered and prioritized by the previously
mentioned helpers.
(erc-auth-source-search): New function to serve as default
value for auth-source query-function options.
(erc-server-join-channel): Use user option for consulting auth-source
facility.  Also accept nil for first argument (instead of server).
(erc-cmd-JOIN): Use above-mentioned facilities when joining new
channel.  Omit server when calling `erc-server-join-channel'.  Don't
filter target buffers twice.  Don't call `switch-to-buffer', which
would create phantom buffers with names like target/server that were
never used.  IOW, only switch to existing target buffers.
(erc--compute-server-password): Add new helper function for
determining password.
(erc-open, erc-determine-parameters): Move password figuring from the
first to the latter.

* lisp/erc/erc-services.el
(erc-auth-source-services-function): Add new option for consulting
auth-source in a NickServ context.
(erc-nickserv-get-password): Pass network-context ID, when looking up
password in `erc-nickserv-passwords' and when formatting prompt for
user input.
(erc-nickserv-passwords): Add comment to custom option definition type
tag.

* test/lisp/erc/erc-services-tests.el: Add new test file for above
changes.  For now, stash auth-source-related tests here until a
suitable home can be found.

* lisp/erc/erc-join.el (erc-autojoin--join): Don't pass session-like
entity from `erc-autojoin-channels-alist' match to
`erc-server-join-channel'.  Allow that function to decide for itself
which host to look up if necessary.

* test/lisp/erc/resources/base/auth-source/foonet.eld: New file.
* test/lisp/erc/resources/base/auth-source/nopass.eld: New file.
* test/lisp/erc/resources/erc-scenarios-common.el: New file.
* test/lisp/erc/resources/services/auth-source/libera.eld: New file.
* test/lisp/erc/erc-scenarios-auth-source.el: New file.
* test/lisp/erc/erc-scenarios-base-reuse-buffers.el: New file.
* test/lisp/erc/erc-scenarios-join-auth-source.el: New file.
* test/lisp/erc/resources/base/reuse-buffers/channel/barnet.eld: New file.
* test/lisp/erc/resources/base/reuse-buffers/channel/foonet.eld: New file.
* test/lisp/erc/resources/join/auth-source/foonet.eld: New file.
(Bug#48598)
2022-06-30 15:18:22 -07:00

49 lines
4 KiB
Text

;; -*- mode: lisp-data; -*-
((nick 1 "NICK tester"))
((user 1 "USER user 0 * :tester")
(0.26 ":zirconium.libera.chat NOTICE * :*** Checking Ident")
(0.01 ":zirconium.libera.chat NOTICE * :*** Looking up your hostname...")
(0.01 ":zirconium.libera.chat NOTICE * :*** No Ident response")
(0.02 ":zirconium.libera.chat NOTICE * :*** Found your hostname: static-198-54-131-100.cust.tzulo.com")
(0.02 ":zirconium.libera.chat 001 tester :Welcome to the Libera.Chat Internet Relay Chat Network tester")
(0.01 ":zirconium.libera.chat 002 tester :Your host is zirconium.libera.chat[46.16.175.175/6697], running version solanum-1.0-dev")
(0.03 ":zirconium.libera.chat 003 tester :This server was created Wed Jun 9 2021 at 01:38:28 UTC")
(0.02 ":zirconium.libera.chat 004 tester zirconium.libera.chat solanum-1.0-dev DGQRSZaghilopsuwz CFILMPQSbcefgijklmnopqrstuvz bkloveqjfI")
(0.00 ":zirconium.libera.chat 005 tester ETRACE WHOX FNC MONITOR=100 SAFELIST ELIST=CTU CALLERID=g KNOCK CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimnprstuz :are supported by this server")
(0.03 ":zirconium.libera.chat 005 tester CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server")
(0.02 ":zirconium.libera.chat 005 tester TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 :are supported by this server")
(0.02 ":zirconium.libera.chat 251 tester :There are 68 users and 37640 invisible on 25 servers")
(0.00 ":zirconium.libera.chat 252 tester 36 :IRC Operators online")
(0.01 ":zirconium.libera.chat 253 tester 5 :unknown connection(s)")
(0.00 ":zirconium.libera.chat 254 tester 19341 :channels formed")
(0.01 ":zirconium.libera.chat 255 tester :I have 3321 clients and 1 servers")
(0.01 ":zirconium.libera.chat 265 tester 3321 4289 :Current local users 3321, max 4289")
(0.00 ":zirconium.libera.chat 266 tester 37708 38929 :Current global users 37708, max 38929")
(0.01 ":zirconium.libera.chat 250 tester :Highest connection count: 4290 (4289 clients) (38580 connections received)")
(0.21 ":zirconium.libera.chat 375 tester :- zirconium.libera.chat Message of the Day - ")
(0.00 ":zirconium.libera.chat 372 tester :- This server provided by Seeweb <https://www.seeweb.it/>")
(0.01 ":zirconium.libera.chat 372 tester :- Welcome to Libera Chat, the IRC network for")
(0.01 ":zirconium.libera.chat 372 tester :- free & open-source software and peer directed projects.")
(0.00 ":zirconium.libera.chat 372 tester :- ")
(0.00 ":zirconium.libera.chat 372 tester :- Use of Libera Chat is governed by our network policies.")
(0.00 ":zirconium.libera.chat 372 tester :- ")
(0.01 ":zirconium.libera.chat 372 tester :- Please visit us in #libera for questions and support.")
(0.01 ":zirconium.libera.chat 372 tester :- ")
(0.01 ":zirconium.libera.chat 372 tester :- Website and documentation: https://libera.chat")
(0.01 ":zirconium.libera.chat 372 tester :- Webchat: https://web.libera.chat")
(0.01 ":zirconium.libera.chat 372 tester :- Network policies: https://libera.chat/policies")
(0.01 ":zirconium.libera.chat 372 tester :- Email: support@libera.chat")
(0.00 ":zirconium.libera.chat 376 tester :End of /MOTD command."))
((mode-user 1.2 "MODE tester +i")
(0.02 ":tester MODE tester :+Zi")
(0.02 ":NickServ!NickServ@services.libera.chat NOTICE tester :This nickname is registered. Please choose a different nickname, or identify via \2/msg NickServ IDENTIFY tester <password>\2"))
((privmsg 2 "PRIVMSG NickServ :IDENTIFY changeme")
(0.96 ":NickServ!NickServ@services.libera.chat NOTICE tester :You are now identified for \2tester\2.")
(0.25 ":NickServ!NickServ@services.libera.chat NOTICE tester :Last login from: \2~tester@school.edu/tester\2 on Jun 18 01:15:56 2021 +0000."))
((quit 5 "QUIT :\2ERC\2")
(0.19 ":tester!~user@static-198-54-131-100.cust.tzulo.com QUIT :Client Quit"))
((linger 1 LINGER))