Commit Graph

456 Commits

Author SHA1 Message Date
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
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
~wicrum-wicrun
c1e14bdbf5 ames: use +pry:mop and +del:mop instead of virtualizing 2023-05-02 17:07:14 +02:00
~wicrum-wicrun
c03c3dc13b ames: migration uses +tap:deq instead of +dip-left:deq 2023-05-02 17:01:53 +02:00
~wicrum-wicrun
ecaf70bc00 ames,lull,zuse: move +pha and +deq into ames to not pollute kelvin code 2023-05-02 16:26:59 +02:00
~wicrum-wicrun
ded0b75914 ames,lull: .wan.keen uses fragment as mop key 2023-05-02 16:25:51 +02:00
~wicrum-wicrun
d7a2c53df8 lull,ames: use mop instead of pha in .wan.keens 2023-05-02 15:17:25 +02:00
Joe Bryan
517df2aebd ames: fix fine error printf 2023-04-25 10:14:42 -04:00
Joe Bryan
5dfc8e3c5d arvo: restructures |mass, switches to %x //whey 2023-04-24 16:21:41 -04:00
~wicrum-wicrun
673803fe0b ames: use $spar 2023-04-24 19:10:05 +02:00
~wicrum-wicrun
dafa1cc030 lull,ames: reference +mop in $packet-pump-size 2023-04-24 19:10:05 +02:00
yosoyubik
66a7b7b1c2 ames: make fi-send take a blob 2023-04-24 18:54:36 +02:00
yosoyubik
d43e684bae ames: rename @uxmeow as $yowl 2023-04-24 18:54:36 +02:00
Joe Bryan
8f43d9674d ames: removes stale comments, dead code 2023-04-24 12:53:29 -04:00
Joe Bryan
cf8a887b80 arvo: rebinds and uses $omen 2023-04-24 12:52:33 -04:00
Joe Bryan
2ece07f096 ames: %fine requests are always for public data 2023-04-24 12:36:53 -04:00
yosoyubik
714d0b13f1 ames: remove sigpam 2023-04-24 17:00:41 +02:00
~wicrum-wicrun
641326ad36 ames,lull: remove .siz from $meow 2023-04-24 16:23:09 +02:00
yosoyubik
bf0a4a3327 ames: fix upgrade from state 4&5 2023-04-24 11:44:24 +02:00
Joe Bryan
d2d1412c3a ames: replace (empty) signatures with tag byte in fine requests (wail) 2023-04-23 01:09:53 -04:00
yosoyubik
599eb6231b ames: rename etch-keen to etch-wail 2023-04-22 20:26:08 +02:00
Ted Blackman
f3655a8662 ames: re-enable life&rift check on fine requests 2023-04-22 11:30:17 -04:00
yosoyubik
5bbd727f18 Merge branch 'develop' into i/5788/remote-scry 2023-04-22 16:07:44 +02:00
yosoyubik
64a1680e2c ames: don't crash if waking up on a strange wire
This was a regression introduced in 8e54f7fcc3
the previous behavior was not to crash so we
restore it here
2023-04-22 13:47:15 +02:00
yosoyubik
2bcfd7599a ames: fix %fine tests to account for updated %tune 2023-04-21 17:54:01 +02:00
Joe Bryan
4d84131464 ames: refactors %tune, supercedes %miss 2023-04-21 10:43:30 -04:00
~wicrum-wicrun
6746687ade ames: print fine errors instead of propagating 2023-04-20 22:32:16 +02:00
~wicrum-wicrun
b92e4c4238 ames: get dat from etched body 2023-04-20 18:52:01 +02:00
~wicrum-wicrun
953e6f5861 ames: set signature in fine requests to all zeroes 2023-04-20 18:12:29 +02:00
yosoyubik
bee09fe5e1 ames: in %larva +load always set cached-state 2023-04-19 16:23:01 +02:00
yosoyubik
873de61269 ames: give %miss to all listeners on %keen cancel
%spider will send a %yawn task to ames if a thread fails
or stops. if the thread is done, it will delete the scry
from its state without notifying %ames
2023-04-19 11:03:11 +02:00
Joe Bryan
51effc6be9 ames: add (disabled) rift/life verification 2023-04-19 00:50:13 -04:00
Joe Bryan
846276f85a ames: refactors $sign and $note 2023-04-19 00:50:13 -04:00
Joe Bryan
80a1cf626c ames: cleanup comments/whitespace 2023-04-18 10:34:47 -04:00
Joe Bryan
c864f95598 ames: drop %pine 2023-04-18 10:25:45 -04:00
yosoyubik
5c838a42a7 ames: use fi-emit for %fine gifts 2023-04-18 05:31:23 +02:00
Joe Bryan
790a0de292 ames: fix move clobbering in +fi-done 2023-04-17 18:29:44 -04:00
Joe Bryan
2cb0a06976 ames: fix build, bypassing alias 2023-04-17 16:08:01 -04:00
yosoyubik
03b3d0b3f4 tests: fix /tests/sys/fine 2023-04-17 16:41:53 +02:00
yosoyubik
296815e097 ames: remove keen-id from remote scry state
TODO: udpate /~debug frontend
2023-04-17 16:22:57 +02:00
yosoyubik
c062d7c2b0 ames: handle error for hearing fine responses
WIP the error is not propagated to the listeners (TODO error gift?)
2023-04-17 15:06:28 +02:00
yosoyubik
0987cddd7e ames: add /fine/ducts/[path] scry endpoint 2023-04-17 14:22:20 +02:00
yosoyubik
1d91bb5e33 ames: first pass a %fine unit tests 2023-04-17 14:15:35 +02:00
pkova
24f7f3549f ames: properly migrate old %snub tasks 2023-04-14 20:41:57 +03:00
yosoyubik
69a5c5e6df ames: factor out is-corked logic into a gate 2023-04-14 09:12:16 +02:00
yosoyubik
898ed99863 ames: no-op on naxplanation acks for corked bones 2023-04-13 08:53:01 +02:00
~wicrum-wicrun
97c8e3833d ames: emit %miss on failed signature verification 2023-04-12 15:04:59 +02:00
yosoyubik
4840b2aed2 ames: simplify reset timer 2023-04-11 14:24:05 +02:00
yosoyubik
48a60d602c ames: reset timer for naxplanation on corked bones 2023-04-09 08:13:21 +02:00
yosoyubik
98a5ab9035 ames: fix handling of fine tasks for aliens 2023-04-08 06:34:10 +02:00