From f4fdd0aa46df69b5ba319e9ca4d7378fe53190b6 Mon Sep 17 00:00:00 2001 From: Ian Shim <100327837+ian-shim@users.noreply.github.com> Date: Wed, 18 Dec 2024 08:44:06 -0800 Subject: [PATCH] Remove hardcoded localhost auth from relay authenticator (#1007) --- inabox/deploy/config.go | 2 ++ relay/auth/authenticator.go | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/inabox/deploy/config.go b/inabox/deploy/config.go index ca14d13720..53e61a863d 100644 --- a/inabox/deploy/config.go +++ b/inabox/deploy/config.go @@ -357,6 +357,8 @@ func (env *Config) generateRelayVars(ind int, graphUrl, grpcPort string) RelayVa RELAY_ONCHAIN_STATE_REFRESH_INTERVAL: "1s", RELAY_MAX_CONCURRENT_GET_CHUNK_OPS_CLIENT: "10", RELAY_MAX_GET_CHUNK_BYTES_PER_SECOND_CLIENT: "100000000", + // TODO(ian-shim): set this to false once there is request signing at the relay client + RELAY_AUTHENTICATION_DISABLED: "true", } env.applyDefaults(&v, "RELAY", "relay", ind) diff --git a/relay/auth/authenticator.go b/relay/auth/authenticator.go index 628a8db25c..664979d366 100644 --- a/relay/auth/authenticator.go +++ b/relay/auth/authenticator.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "strings" "sync" "time" @@ -107,11 +106,6 @@ func (a *requestAuthenticator) AuthenticateGetChunksRequest( request *pb.GetChunksRequest, now time.Time) error { - if strings.HasPrefix(origin, "127.0.0.1") { - // TODO(ian-shim): Remove this block once we have a way to authenticate requests. - return nil - } - if a.isAuthenticationStillValid(now, origin) { // We've recently authenticated this client. Do not authenticate again for a while. return nil