Commit Graph

504 Commits

Author SHA1 Message Date
Joe Bryan
d280fbcdbb
Merge branch 'develop' into next/kelvin/412 2023-06-28 11:19:32 -04:00
yosoyubik
b359239f3d Merge branch 'develop' into next/kelvin/412 2023-06-28 12:52:18 +02:00
Philip Monk
90333c2e91 ping: rewrite to add non-NAT mode 2023-06-26 21:18:04 -07:00
fang
c33ddfa101
Merge branch 'next/kelvin/412' into m/eyre-mirage 2023-06-26 13:47:39 +02:00
Joe Bryan
28f2cddf8e ames: reinitialize rift for all ranks, not just moons 2023-06-22 11:14:34 -04:00
Philip Monk
74ed6daa02 fine: use %q, and don't interpret null as tombstoned 2023-06-15 18:44:05 -07:00
Philip Monk
238a36de1d fine: actively fetch rift for moons 2023-06-14 23:28:37 -07:00
Philip Monk
f68f3dc833 fine: use progressive insertion sort instead of quicksort to assemble fragments 2023-06-14 21:46:29 -07:00
Philip Monk
4a8c0b2d6c fine: fix pathological congestion control case with large windows 2023-06-13 23:06:51 -07:00
Philip Monk
3c3f59a2ac ames: rewrite +fi-on-ack to not use +dip 2023-06-13 22:13:38 -07:00
Ted Blackman
6153f8c7e3
Merge pull request #6609 from urbit/yu/remove-num-live
ames: remove num-live from pump-metrics
2023-06-12 11:50:15 -04:00
fang
ef89cf2410
eyre: rework eauth to be client-initiated
Instead of doing formal network traffic on the host-side whenever a
login attempt gets initiated, we now do it no earlier than when we're on
the client-side. This has the important property that network traffic
can only be initiated by authenticated HTTP requests. The previous
implementation, where hosts sent pleas when an unauthenticated HTTP
client said then wanted to log in, was vulnerable to abuse.

So now, formally, the eauth flow starts at the client's confirmation
screen. There is an optional step preceding this, where an attempt is
started on the host (and data is still stored for this), but to get the
redirect target, the host uses remote scry to get the eauth URL out of
the client ship.

Hosts now also give attempt-specific return URLs, useful in case they
are accessible (or even serving different content) from different
hostnames.
2023-06-09 15:46:04 +02:00
Tinnus Napbus
7c3a1c4d7c Merge branch 'next/kelvin/412' into tinnus/local-provenance 2023-06-07 20:38:05 +12:00
Ted Blackman
fc5598718b Merge branch 'develop' into next/kelvin/412 2023-06-06 12:50:11 -04:00
yosoyubik
d5bc16ee3e ames: don't crash if sndr/rcvr lifes mismatch 2023-06-05 11:06:22 +02:00
Tinnus Napbus
0105be6459 Merge branch 'develop' into tinnus/local-provenance 2023-05-31 12:52:53 +12:00
yosoyubik
96e3bdcf11 Merge branch 'develop' into i/6103/abet-pure 2023-05-30 10:38:39 +02:00
yosoyubik
d3489cc8db ames: generalize $deep tasks
currently all $deep tasks are focused on a particular ship but future
 ones might not, so we move $ship to each individual task
2023-05-30 10:33:13 +02:00
yosoyubik
7ce74f36c6 ames: add %deep task to handle deferred calls
note: %ames tests have not been updated to account for this change
2023-05-30 10:33:13 +02:00
Joe Bryan
d4b900bf3f
Merge pull request #6612 from urbit/i/6611/lose-boon
ames: correctly %lose a %boon we crashed on
2023-05-26 11:19:57 -04:00
Ted Blackman
7d9df71d5e
Merge pull request #6613 from urbit/i/6608/skip-corks
ames: skip corks if pending acks for naxplanations
2023-05-26 10:51:33 -04:00
Ted Blackman
d234b3205f
Merge pull request #6607 from urbit/yu/fix-drop-nack
ames: don't no-op if getting %ack on nack bone
2023-05-26 10:19:31 -04:00
yosoyubik
6528c62b1f Merge branch 'develop' into i/6608/skip-corks 2023-05-26 10:17:19 +02:00
yosoyubik
1e74e8d19a ames: simplify pending-acks conditional 2023-05-26 10:09:44 +02:00
Ted Blackman
13ae086837
Merge pull request #6617 from urbit/jb/fine-misordered
fine: handle misordered responses
2023-05-24 17:19:33 -04:00
Joe Bryan
fee0f604cc fine: sort response fragments before deserializing 2023-05-24 13:01:29 -04:00
Joe Bryan
b0d2db25b5 fine: narrows error message scope on bad responses 2023-05-24 13:00:48 -04:00
fang
2b9d603951
ames: turn all pending %boons into %losts
This was the behavior prior to d8e11b6, except that we now correctly include
the new %boon in the transformation also.
2023-05-24 14:07:29 +02:00
yosoyubik
f6101569f5 ames: skip corks if pending acks for naxplanations 2023-05-24 12:35:38 +02:00
fang
d8e11b68c2
ames: correctly %lose a %boon we crashed on
Previously, if we noticed %boon handling had caused a crash, we would
transform any existing %boons into %losts, but still emit a new %boon
for the message we ostensibly crashed on.

Now, we make sure to just directly send a %lost if sending the %boon
caused a crash. We drop the existing-moves transformation entirely,
assuming it to vestigial.
2023-05-23 22:10:17 +02:00
yosoyubik
3554ab895d ames: remove num-live from pump-metrics 2023-05-23 06:48:15 +02:00
yosoyubik
e440a443e5 ames: don't no-op if getting %ack on nack bone 2023-05-22 17:53:20 +02:00
yosoyubik
1921fd277c ames: add comment 2023-05-22 17:38:31 +02:00
Josh Lehman
799c49f873
Merge branch 'develop' into i/6103/abet-pure 2023-05-22 08:37:32 -07:00
Tinnus Napbus
de51f74dc2 gall: implement local provenance 2023-05-23 01:12:09 +12:00
yosoyubik
89da6d433b ames: fix incorrect handling of acks in |pack 2023-05-22 15:05:18 +02:00
jose
7df931b375
Merge branch 'develop' into i/6103/abet-pure 2023-05-22 13:23:02 +02:00
yosoyubik
a765954cee ames: don't get ship-state in +enqueue-alien-todo
ship-state is retrieved in +send-blob only for sponsors of the ship
2023-05-22 12:49:00 +02:00
yosoyubik
7d153ba99a ames: fix no-op if getting %ack on nack-trace bone 2023-05-22 12:14:53 +02:00
yosoyubik
66b92800e3 ames: don't retrieve ship-state in +send-blob 2023-05-22 11:41:32 +02:00
yosoyubik
b427f1c321 ames: early abet in |fi after route update
Continuation of https://github.com/urbit/urbit/pull/6593
2023-05-22 10:58:50 +02:00
fang
8579b6c952
eyre: eauth, cross-ship authentication
aka "mirage" aka "eyre oauth"

With Eyre now supporting both local identity authentication, and fake
guest identities, the logical next step is to support authentication
with real non-local identities. Here, we implement that, building on top
of the groundwork laid by #6561.

The primary change is adding a %real case to Eyre's $identity type, and
implementing an http<->ames<->ames handshaking protocol into Eyre for
negotiating approval of login attempts made by unauthenticated HTTP
clients.

The authentication flow, where a "visitor" logs into a "~host" as their
own "~client" identity can be described in brief as follows:
1) Visitor makes an HTTP request saying they are ~client.
2) ~host tells ~client, over Ames, about its own public-facing hostname.
3) ~client responds with its own public-facing hostname.
4) ~host forwards the visitor to ~client's eauth page.
5) Visitor, there already logged in as ~client, approves the login
   attempt.
6) ~client shares a secret with ~host over Ames, and forwards the
   visitor to ~host's eauth page, including the secret in the request.
7) ~host sees that the secrets received over Ames and HTTP match, and
   gives the visitor a new session token, identifying them as ~client.

The negotiating of hostnames/URLs via Ames is crucial to keeping this
handshake sequence secure.

Discovering a ship's public-facing hostname happens when successful
local logins are made by reading out the Host header from the request.
Users may hard-code a value to override this.

Each eauth login attempt comes with a unique nonce. Both the host and
client track the lifetime of these. The corresponding Ames flow (which
goes from ~host -> ~client) is corked when the login attempt gets
aborted, or its associated session expires.

The logout functionality has been updated to let clients ask to be
logged out of sessions on other ships.
2023-05-18 23:13:15 +02:00
Joe Bryan
15440d3dda ames: add %rift to %stir 2023-05-17 16:51:12 -04:00
Philip Monk
8cba74630f ames: bugfixes 2023-05-16 23:05:17 -07:00
yosoyubik
42c22bf4f3 ames: on-take-wake no-op if not path for keen 2023-05-10 17:18:31 +02:00
yosoyubik
b154c62fdc ames, tests: remove extraneous comments 2023-05-09 11:43:54 +02:00
yosoyubik
f53fee723a ames: defer mutual calls between |pump and |sink
|pump and |sink call into each other in three places
related to nacks and naxplanations (sending a nack,
notifying the |pump of a naxplanation, or dropping a
nack from the |sink). This intra calls are making implicit
updates to more parts of the state than the core should
manage. To avoid that we emit a move to %arvo, encoded
as an %ames plea, to handle that in the next event.
2023-05-08 15:28:13 +02:00
yosoyubik
6213e0bbb3 ames: move +bind-duct to peer-core 2023-05-05 13:06:17 +02:00
yosoyubik
df47808047 Merge branch 'develop' into i/6103/abet-pure 2023-05-05 09:53:01 +02:00
~wicrum-wicrun
c1e14bdbf5 ames: use +pry:mop and +del:mop instead of virtualizing 2023-05-02 17:07:14 +02:00