fix(overseas): support projected authorization headers

This commit is contained in:
2026-09-08 21:59:13 +08:00
parent 55fda1f616
commit a060f8dca8
7 changed files with 122 additions and 60 deletions
@@ -9,6 +9,9 @@ import java.nio.file.Path;
import static org.assertj.core.api.Assertions.assertThat;
class OverseasSecurityValidationDeploymentContractTest {
private static final String HEADER_SIZE =
"max-http-request-header-size: ${SERVER_MAX_HTTP_REQUEST_HEADER_SIZE:32KB}";
@Test
void gatewayLocalJwtDefaultsMatchAuthAndLastleg() throws Exception {
String gatewayApplication = read("gateway-overseas/src/main/resources/application.yml");
@@ -64,6 +67,15 @@ class OverseasSecurityValidationDeploymentContractTest {
"OVERSEAS_SECURITY_SERVICE_URL", "OVERSEAS_SECURITY_EVENT_CONSUMER_URL");
}
@Test
void overseasAuthorizationSnapshotHeadersFitEveryServletService() throws Exception {
assertThat(read("config/nacos/overseas/baiyue-common.yml")).contains(HEADER_SIZE);
assertThat(read("lastleg-service/src/main/resources/application.yml")).contains(HEADER_SIZE);
assertThat(read("warehouse-overseas-service/src/main/resources/application.yml")).contains(HEADER_SIZE);
assertThat(read("deploy/docker-compose.overseas.yml"))
.contains("SERVER_MAX_HTTP_REQUEST_HEADER_SIZE: ${SERVER_MAX_HTTP_REQUEST_HEADER_SIZE:-32KB}");
}
private static String read(String relative) throws Exception {
Path path = Path.of(relative);
if (!Files.exists(path)) path = Path.of("..").resolve(relative);