Commit Graph

179 Commits

Author SHA1 Message Date
jesopo 2245ba23a2 ERR_NOSUCHUSER -> ERR_NOSUCHNICK 2020-06-07 19:41:26 +01:00
jesopo 06afec2738 WHOIS should have nick, user/host/real are required, handle NOSUCHUSER 2020-06-07 17:46:38 +01:00
jesopo 17ecd1416a glob.py.compile should have a return type 2020-06-07 17:45:47 +01:00
jesopo 63878e75cd :Optional, not =Optional 2020-06-03 21:38:27 +01:00
jesopo 5b04a5d1fd allow Formatless and Folded to be nested 2020-06-01 14:17:19 +01:00
jesopo 97c4a616c9 `channels` needs to be a list and needs enumerate() 2020-06-01 11:04:22 +01:00
jesopo 33bcba8001 add basic code for using labeled-responses as wait_for matches 2020-05-24 01:05:51 +01:00
jesopo fae9acb288 parse out RPL_WHOISCHANNELS when available (send_whois()) 2020-05-01 15:30:10 +01:00
jesopo 7ce706a0ab .defer() needs to actually return Future result 2020-05-01 15:26:15 +01:00
jesopo bc70afe04b move setting wait_for_fut result to WaitFor await in case it isn't awaited 2020-04-30 11:22:47 +01:00
jesopo e4af62a30c make wait_reads a deque instead of a list 2020-04-29 14:52:22 +01:00
jesopo 8f0a3045c5 self._wait_for is no longer used 2020-04-29 14:31:41 +01:00
jesopo 6d4222b4c1 minor refactor of how we call _next_line() 2020-04-29 12:23:11 +01:00
jesopo 51cfd0f36b rewrite how wait_for works - only one at a time now 2020-04-29 12:13:06 +01:00
jesopo a3abae811a we don't need to prefold `channel` 2020-04-28 11:45:46 +01:00
jesopo 04354c7d36 add send_message() - optionally await echo 2020-04-28 01:41:20 +01:00
jesopo 9d4572edcc handle failure in send_joins() 2020-04-28 01:41:05 +01:00
jesopo 20290807d9 Self -> MaskSelf, add Self for param 2020-04-28 01:40:13 +01:00
jesopo 6b2b3d71c8 add send_nick() - optionally await success 2020-04-28 00:35:32 +01:00
jesopo 33e191b980 better Nick repr, add Mask repr 2020-04-27 23:29:09 +01:00
jesopo 22b549708d add matching Hostmask type for Self, Nickname->Nick 2020-04-27 23:27:24 +01:00
jesopo ab66df4d43 add backtracking irc glob matching 2020-04-27 23:26:41 +01:00
jesopo 0921cb8086 allow ResponseOr to be shorthanded as a Set[IMatchResponse] 2020-04-27 01:28:46 +01:00
jesopo 8afadd1fdf add start of hostmask matching: mask collapsing 2020-04-27 00:41:17 +01:00
jesopo c25f6d2a00 SCRAM should take mechanisms as Enum values 2020-04-26 17:08:03 +01:00
jesopo e26190c283 rectify TimeoutError namespace 2020-04-26 15:17:08 +01:00
jesopo 60dfda48e0 ping_sent doesn't have to be global 2020-04-26 15:14:13 +01:00
jesopo ba57d06a56 implement client-to-server read timeout PINGs 2020-04-26 15:07:05 +01:00
jesopo f33a0ad369 add ConnectionParams.reconnect - we'll use this for exponential backoff 2020-04-26 01:19:16 +01:00
jesopo f18efda31b isinstance for SASL types, so EXTERNAL doesn't have blank user/pass 2020-04-26 01:08:47 +01:00
jesopo 5b927beb25 enact provided ResumePolicy (incl. cancelling handshake) 2020-04-25 20:13:46 +01:00
jesopo 15b97ab3da implement draft/resume-0.5 2020-04-25 19:30:36 +01:00
jesopo 064c786db7 minor codestyling 2020-04-23 15:30:33 +01:00
jesopo 955c284282 object-ify WaitFor future stuff 2020-04-23 15:22:30 +01:00
jesopo f48aaded5a _line_or_await *after* checking wait_fors so we don't match current line 2020-04-23 14:53:28 +01:00
jesopo 45269a98a9 change wait_for to not spin up nested next_line() loops 2020-04-23 14:42:42 +01:00
jesopo d51fcf0987 update ircstates, now only one (maybe Optional) Emit 2020-04-22 18:05:23 +01:00
jesopo 4286e75749 add matching.params.Regex 2020-04-21 21:59:20 +01:00
jesopo 2246236e83 add Formatless matching param 2020-04-21 21:54:51 +01:00
jesopo 89c7ac15dd rename some matching Params, restructure matching 2020-04-21 21:40:46 +01:00
jesopo b4f9cc02b9 `source` should be on Response as well as Responses 2020-04-21 21:16:18 +01:00
jesopo b00ecf6e86 replace ParamLiteral with string literals 2020-04-21 21:11:19 +01:00
jesopo f14f2b2e6b break, not continue; continue does not refer to parent for loop 2020-04-21 21:05:41 +01:00
jesopo a425077c29 put overriddable methods in Server not just IServer 2020-04-21 16:24:18 +01:00
jesopo 770b76f671 don't CAP REQ userhost-in-names, we run a WHO on JOIN anyway 2020-04-21 13:19:46 +01:00
jesopo 5892c9ff45 add Server.send_part() that optionally awaits PART confirmation 2020-04-20 16:53:49 +01:00
jesopo a79958affd add wait_for() hostmask matching functionality 2020-04-20 16:53:14 +01:00
jesopo 079460dd35 IBot isn't defined yet 2020-04-20 16:52:45 +01:00
jesopo 4831ec88fb make IServer.sts_policy() async in case e.g. saving needs await 2020-04-20 16:24:26 +01:00
jesopo 8340419b99 add IServer.bot:IBot 2020-04-20 16:22:39 +01:00
jesopo fedef3ba3d also catch sts outside of connection reg, throw up Disconnect to be sure 2020-04-20 16:21:29 +01:00
jesopo 3208ee738c don't catch and "handle" server disconnect. throw up to bot.py 2020-04-20 12:04:01 +01:00
jesopo feb71d5b14 STS transmuting doesn't need the context of a server object 2020-04-19 23:19:23 +01:00
jesopo 899d6f69d8 server_hostname is only useful for TLS connections 2020-04-19 23:05:21 +01:00
jesopo ae01201d39 support requested disconnects, support STS connection transmutations 2020-04-19 23:04:56 +01:00
jesopo 1bfe06d2ea implement STS policies; we're not parsing them yet though 2020-04-19 21:51:33 +01:00
jesopo c4019e6242 set future on awaited self.send() after we've processed for session state 2020-04-19 13:11:06 +01:00
jesopo 47223c257c remove commented-out proof of concept auto-join stuff 2020-04-19 02:23:00 +01:00
jesopo ebef439e0a grab WHO on JOIN but make sure we only do one at once 2020-04-19 02:19:19 +01:00
jesopo d15e9ee361 `Numeric` doesn't exist anymore 2020-04-19 01:32:55 +01:00
jesopo a187dd2175 SASL auth text should be wrapped at 400 bytes 2020-04-19 00:56:24 +01:00
jesopo a48a0dedd9 add missing Responses import on server.py 2020-04-19 00:56:01 +01:00
jesopo bf68b6cb75 ah oops, the bindhost port was a test value that got committed 2020-04-19 00:55:32 +01:00
jesopo 7232876a75 update ircstates to v0.9.0, use const RPL/ERR vars 2020-04-17 21:06:20 +01:00
jesopo 624ffe2cf8 add py.typed 2020-04-16 14:20:16 +01:00
jesopo 0e2a2bcd00 create a fake echo-message when we have not CAP negotiated echo-message 2020-04-15 21:10:24 +01:00
jesopo b88fa51907 should be checking `self.hostname`, not `self.hostmask` (func pointer!) 2020-04-15 21:10:02 +01:00
jesopo 68054eacd5 support PASS from ConnectionParams 2020-04-13 19:10:02 +01:00
jesopo 8656f63d09 support labeled-response (but don't REQ it yet) 2020-04-13 18:23:05 +01:00
jesopo bd424d11ff Future[Line], not Awaitable[Line] in self._wait_for 2020-04-13 17:32:39 +01:00
jesopo cb3439e674 also match wait_fors that were in progress when a new one was triggered 2020-04-13 17:30:14 +01:00
jesopo 7cb2457136 add util functions to join a channel and whois a user 2020-04-12 13:54:27 +01:00
jesopo d571ad7ff9 self.recv() can return an empty array 2020-04-12 13:53:39 +01:00
jesopo 923809ab43 add async_stagger reference for backported happy eyeballs open_connection 2020-04-11 11:33:53 +01:00
jesopo c4009e1c07 on ERR_SASLFAIL, pop from matches 2020-04-10 21:37:26 +01:00
jesopo 3700ba4ab6 on RPL_SASLMECHS, we should still wait_for the ERR_SASLFAIL after it 2020-04-10 21:36:17 +01:00
jesopo 5da82e7d66 check for PLAIN should use `match[0]` not `match` 2020-04-10 21:36:03 +01:00
jesopo a546a468b7 remove premature import for future work 2020-04-09 11:12:02 +01:00
jesopo 85ee8e95e0 WHO ourselves on 001 to get our realname 2020-04-09 11:09:44 +01:00
jesopo 9f832df2f1 allow Numerics() with `params` use NUMERICS list from ircstates 2020-04-09 11:09:15 +01:00
jesopo 179a2ca93a refactor TCP logic in to ITCPTransport (we can mock this for unittests) 2020-04-06 13:22:17 +01:00
jesopo 750fbd8acc comment about why server CAP/USER/NICK send() calls are not awaited 2020-04-05 23:57:02 +01:00
jesopo 730fef38f3 server.send() should be sync and return a Future - no nead for double await 2020-04-05 23:54:57 +01:00
jesopo 899d4821f0 add asyncs.MaybeAwait() - optionally awaitable coroutines 2020-04-05 23:37:54 +01:00
jesopo 84b374f43d FoldString -> ParamFolded 2020-04-05 17:40:22 +01:00
jesopo d837529698 next_line() doesn't need `wait_for` param 2020-04-05 17:22:33 +01:00
jesopo 423623fec1 add a Response subclass just to take RPL_/ERR_ names along with params 2020-04-05 17:16:19 +01:00
jesopo 0829fd9499 refactor and simplify normal reading vs wait_for 2020-04-05 17:11:04 +01:00
jesopo b8ddc6883d oops; add missing return statement from server.send 2020-04-05 13:19:19 +01:00
jesopo 1c7caf9039 use Server.registerd to detect handshake CAP LS; handle non-handshake CAP LS 2020-04-05 13:18:23 +01:00
jesopo 2a9d658207 return Future from `async send()` to *optionally* wait for it to hit the wire 2020-04-05 13:17:53 +01:00
jesopo e470d57780 pass IServer to Response so we can have FoldString (match with casefold rules) 2020-04-05 13:00:13 +01:00
jesopo f70932ac44 move more CAP related stuff to CAPContext 2020-04-05 12:48:29 +01:00
jesopo afe9ec359d update ircstates to 0.8.2 2020-04-05 12:47:19 +01:00
jesopo 404154e6a2 add __repr__ for matching.py objects 2020-04-03 13:05:38 +01:00
jesopo 688418df04 dont tg.spawn() for each message, allow wait_for to read 2020-04-03 13:04:02 +01:00
jesopo 45ac3be550 ssl/ssl_verify -> tls/tls_verify 2020-04-03 09:50:30 +01:00
jesopo 2d93e27feb maybe_sasl() -> sasl_auth(SASLParms) 2020-04-03 09:49:46 +01:00
jesopo 8cc3db5e58 ensure server nonce .startswith() our nonce 2020-04-03 00:07:48 +01:00
jesopo 99d55de170 fix JOIN emit typehint issue (emit.channel may be None) 2020-04-02 23:53:47 +01:00