From 630d5d01eabbd71dfaff4f683b3d01eb96add4c0 Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Tue, 5 Mar 2024 18:29:04 +0200 Subject: [PATCH 1/2] eyre: do not store localhost as eauth-url --- pkg/arvo/sys/vane/eyre.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 4ef00859ee..190a419588 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1306,7 +1306,8 @@ o(session-id session.fex) :: store the hostname used for this login, later reuse it for eauth :: - =? endpoint.auth.state ?=(^ host) + =? endpoint.auth.state + &(?=(^ host) !=('localhost' (fall (rush u.host host-sans-port) ''))) %- (trace 2 |.("eauth: storing endpoint at {(trip u.host)}")) =/ new-auth=(unit @t) `(cat 3 ?:(secure 'https://' 'http://') u.host) From 5ecef371b747c69db021045c8fac7ec176240d7b Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Thu, 21 Mar 2024 13:39:30 +0200 Subject: [PATCH 2/2] eyre: do not overwrite public eauth domains with localhost Co-authored-by: fang --- pkg/arvo/sys/vane/eyre.hoon | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 190a419588..68ce5eab80 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1306,8 +1306,13 @@ o(session-id session.fex) :: store the hostname used for this login, later reuse it for eauth :: - =? endpoint.auth.state - &(?=(^ host) !=('localhost' (fall (rush u.host host-sans-port) ''))) + =? endpoint.auth.state + :: avoid overwriting public domains with localhost + :: + ?& ?=(^ host) + ?| ?=(~ auth.endpoint.auth.state) + !=('localhost' (fall (rush u.host host-sans-port) ''))) + == == %- (trace 2 |.("eauth: storing endpoint at {(trip u.host)}")) =/ new-auth=(unit @t) `(cat 3 ?:(secure 'https://' 'http://') u.host)