From 688d0771d3543a4f20e7d3f8ce650ee7f52d6944 Mon Sep 17 00:00:00 2001 From: Vlad Lazar Date: Fri, 25 Jul 2025 12:15:08 +0100 Subject: [PATCH] review: validate that neon and hadron tokens aren't mixed --- pageserver/src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pageserver/src/config.rs b/pageserver/src/config.rs index bb73ae1dd5..bf37640bb4 100644 --- a/pageserver/src/config.rs +++ b/pageserver/src/config.rs @@ -629,6 +629,13 @@ impl PageServerConf { } }; + let auth_types = [conf.http_auth_type, conf.pg_auth_type, conf.grpc_auth_type]; + if auth_types.contains(&AuthType::NeonJWT) && auth_types.contains(&AuthType::HadronJWT) { + return Err(anyhow::anyhow!( + "Mixing neon and hadron style JWT tokens is not supported" + )); + } + Ok(conf) }