refactor: 백엔드 리펙토링 진행 중
This commit is contained in:
+4
-7
@@ -22,7 +22,7 @@ APP_SERVER_PORT=8080
|
||||
MANAGEMENT_SERVER_PORT=9001
|
||||
APP_SERVER_SHUTDOWN=graceful
|
||||
APP_SERVER_SHUTDOWN_TIMEOUT=30s
|
||||
APP_SERVER_FORWARD_HEADERS_STRATEGY=framework
|
||||
APP_SERVER_FORWARD_HEADERS_STRATEGY=native
|
||||
APP_SERVER_TOMCAT_MAX_THREADS=200
|
||||
APP_SERVER_TOMCAT_MIN_SPARE_THREADS=10
|
||||
APP_SERVER_TOMCAT_ACCEPT_COUNT=100
|
||||
@@ -96,7 +96,6 @@ APP_SESSION_MAXIMUM_SCALAR_BYTES=8192
|
||||
APP_SECURITY_JWT_ISSUER=
|
||||
APP_SECURITY_JWT_AUDIENCE=
|
||||
APP_RATE_LIMIT_ENABLED=false
|
||||
APP_RATE_LIMIT_CLIENT_IP_MODE=remote-addr-only
|
||||
APP_RATE_LIMIT_REDIS_ENABLED=false
|
||||
APP_RATE_LIMIT_PROVIDER=disabled
|
||||
APP_RATE_LIMIT_FAILURE_POLICY=fail-closed
|
||||
@@ -277,7 +276,6 @@ SPRING_MONGODB_URI=
|
||||
APP_MESSAGING_ENABLED=true
|
||||
APP_GRAPHQL_ENABLED=true
|
||||
APP_GRAPHQL_DEPLOYMENT_MODE=
|
||||
APP_GRAPHQL_EXECUTION_PROFILE=BLOCKING_MVC
|
||||
APP_GRAPHQL_VALIDATION_POLICY_VERSION=v1
|
||||
APP_GRAPHQL_OBSERVED_OPERATION_NAMES=
|
||||
APP_GRAPHQL_GRAPHIQL_ENABLED=false
|
||||
@@ -294,6 +292,7 @@ APP_WEBSOCKET_ENABLED=true
|
||||
APP_WEBSOCKET_ENDPOINT=/ws
|
||||
APP_WEBSOCKET_ALLOWED_ORIGINS=http://localhost:3000
|
||||
APP_WEBSOCKET_BROADCAST_DESTINATION=/topic/events
|
||||
APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY=10000
|
||||
APP_OUTBOX_ENABLED=false
|
||||
APP_OUTBOX_RELAY_ENABLED=false
|
||||
APP_OUTBOX_CANONICAL_TRANSPORT_ENABLED=false
|
||||
@@ -376,8 +375,8 @@ APP_LEASE_REDIS_KEY_HMAC_SECRET=
|
||||
APP_CACHE_REDIS_PASSWORD=
|
||||
APP_CACHE_REDIS_KEY_HMAC_SECRET=
|
||||
APP_FILESERVER_PLATFORM_OBSERVABILITY_FINGERPRINT_KEY=
|
||||
# The notification platform's eight key purposes. Each is base64 of at least 32 bytes and must
|
||||
# differ from the other seven; the platform decodes all eight at startup and refuses to boot if one
|
||||
# The notification platform's seven key purposes. Each is base64 of at least 32 bytes and must
|
||||
# differ from the other six; the platform decodes all seven at startup and refuses to boot if one
|
||||
# is blank, short or shared. Only needed when the notification module is selected and not switched
|
||||
# off with APP_NOTIFICATION_PLATFORM_ENABLED=false.
|
||||
APP_NOTIFICATION_PLATFORM_CONTACT_ENCRYPTION_KEY=
|
||||
@@ -385,7 +384,6 @@ APP_NOTIFICATION_PLATFORM_CONTACT_LOOKUP_HMAC_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_CALLBACK_SIGNING_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_PROVIDER_CREDENTIAL_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_PAYLOAD_ENCRYPTION_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_PROVIDER_REQUEST_LOOKUP_HMAC_KEY=
|
||||
APP_NOTIFICATION_PLATFORM_CALLBACK_FINGERPRINT_HMAC_KEY=
|
||||
# The id each of those keys is active under — an identifier, not secret material, and required:
|
||||
@@ -396,6 +394,5 @@ APP_NOTIFICATION_PLATFORM_CONTACT_LOOKUP_HMAC_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_CALLBACK_SIGNING_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_PROVIDER_CREDENTIAL_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_PAYLOAD_ENCRYPTION_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_VAPID_SIGNING_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_PROVIDER_REQUEST_LOOKUP_HMAC_KEY_ID=
|
||||
APP_NOTIFICATION_PLATFORM_CALLBACK_FINGERPRINT_HMAC_KEY_ID=
|
||||
|
||||
+6
-5
@@ -223,9 +223,9 @@ drift하기 시작하면 그때 자동화합니다. 진짜 항목을 상대로,
|
||||
- **`APP_RATE_LIMIT_ENABLED`** — provider-neutral edge rate-limit interceptor 활성화
|
||||
(429 + `Retry-After` + `X-RateLimit-*` 응답). 기본값은 `false`이며, `true`로 바꿀 때는
|
||||
`APP_RATE_LIMIT_PROVIDER=redis`와 canonical coordination role을 함께 구성해야 합니다.
|
||||
- **`APP_RATE_LIMIT_CLIENT_IP_MODE`** — 클라이언트 IP 판별 방식. `remote-addr-only` |
|
||||
`forwarded-headers-trusted`. **신뢰된 ingress/LB 가 `X-Forwarded-For` 를 앱 도달 전에 덮어쓸 때만**
|
||||
`forwarded-headers-trusted` 를 쓰세요. 아니면 IP 위조에 노출됩니다.
|
||||
비인증 요청의 키는 `getRemoteAddr()` 입니다. 프록시 뒤라면
|
||||
`APP_SERVER_FORWARD_HEADERS_STRATEGY=native` 와 `server.tomcat.remoteip.internal-proxies` 로 신뢰할
|
||||
프록시를 지정하세요(`framework` 면 rate limit 이 기동을 거부합니다).
|
||||
- **`APP_IDEMPOTENCY_PROVIDER`** — 요청 멱등성 store. `disabled`(기본) | `redis` | `postgresql`.
|
||||
`postgresql` 은 PostgreSQL data source 가 아니면 기동을 거부하므로 `bootRunH2` 에서는
|
||||
`disabled` 나 `redis` 를 씁니다.
|
||||
@@ -469,8 +469,9 @@ Boot 기본값이 바뀌어도 wire 계약이 조용히 깨지지 않게 합니
|
||||
- **`APP_SERVER_COMPRESSION_ENABLED`** — `true` | `false`.
|
||||
- **`APP_SERVER_COMPRESSION_MIN_RESPONSE_SIZE`** — 이 크기 미만 payload 는 압축하지 않음(bytes 또는
|
||||
단위, 예: `1024` | `1KB` | `2KB`).
|
||||
- **`APP_SERVER_FORWARD_HEADERS_STRATEGY`** — `none` | `native` | `framework`. 기본값은 `none`.
|
||||
LB/proxy가 외부 forwarded header를 제거·치환하는 배포에서만 명시적으로 활성화한다.
|
||||
- **`APP_SERVER_FORWARD_HEADERS_STRATEGY`** — `none` | `native`. 기본값은 `none`.
|
||||
LB/proxy 뒤 배포는 `native` 로 켜고 `server.tomcat.remoteip.internal-proxies` 로 신뢰할 프록시를
|
||||
지정한다. `framework` 는 모든 peer 의 헤더를 믿으므로 쓰지 않는다.
|
||||
- **`APP_SERVER_ERROR_INCLUDE_STACKTRACE`** — `always` | `never` | `on_param`.
|
||||
- **`APP_SERVER_ERROR_INCLUDE_MESSAGE`** — `always` | `never` | `on_param`.
|
||||
|
||||
|
||||
@@ -96,15 +96,11 @@ application/platform namespace split.
|
||||
- test scope 에 한해 `archunit-junit5` — 전송 경계 규칙(`GraphQlTransportBoundaryArchitectureTest`).
|
||||
|
||||
**서버는 이 leaf 가 고르지 않는다.** production 파일 중 `org.springframework.web`·
|
||||
`jakarta.servlet`·`org.springframework.http` 을 import 하는 것은 **하나도 없다**. 예전에는
|
||||
`spring-boot-starter-web` 을 production `implementation` 으로 두어 모든 adopter 의
|
||||
runtimeClasspath 에 Tomcat 을 올리면서, 동시에 같은 artifact 가 `REACTIVE_WEBFLUX` 실행
|
||||
프로파일을 표방했다 — leaf 와 함께 servlet 컨테이너가 따라오므로 결코 성립할 수 없는 조합이었다.
|
||||
|
||||
이제 서버 선택은 composition root 의 결정이고, `gradle.lockfile` 이 이를 고정한다
|
||||
(`spring-boot-starter-web`·`spring-webmvc`·`spring-webflux`·`tomcat-embed-*` 전부
|
||||
`testCompileClasspath,testRuntimeClasspath` 만). `GraphQlRuntimeTransport` 가 실제 실행 중인
|
||||
서버를 감지해 `backend.graphql.execution-profile` 과 어긋나면 **부팅을 거부**한다.
|
||||
`org.springframework.http` 을 import 하는 것은 **하나도 없다**(servlet API 는 body 상한 필터만
|
||||
`compileOnly` 로 쓴다). 서버 선택은 composition root 의 결정이고, `gradle.lockfile` 이 이를
|
||||
고정한다(`spring-boot-starter-web`·`spring-webmvc`·`spring-webflux`·`tomcat-embed-*` 전부
|
||||
`testCompileClasspath,testRuntimeClasspath` 만). 템플릿은 servlet 단일 스택(D4)이라 실행
|
||||
프로파일(`execution-profile`)·reactive 런타임 감지·blocking bridge 는 2026-09-25 에 삭제했다.
|
||||
- `annotationProcessor` 로 `spring-boot-configuration-processor` — `GraphQlPlatformProperties` 가
|
||||
`@ConfigurationProperties` 이므로 `ca.spring-config` convention plugin이 주는 패리티
|
||||
게이트가 이 선언을 요구한다.
|
||||
|
||||
@@ -104,7 +104,7 @@ gRPC 와 달리 spring-graphql / graphql-java 는 Spring Boot BOM 이 관리한
|
||||
전송 계층 설정(path, graphiql, introspection, schema location)은 프레임워크 `spring.graphql.*`
|
||||
가 소유한다. composition-root `application.yml` 에서 설정하며 모듈별 `yml` 은 없다.
|
||||
|
||||
플랫폼 정책은 `spring.graphql.*` 로 표현할 수 없다 — 실행 프로파일, cost/page 한계, preparsed
|
||||
플랫폼 정책은 `spring.graphql.*` 로 표현할 수 없다 — cost/page 한계, preparsed
|
||||
캐시 경계, 관측 label 로 허용할 operation 이름은 전부 이 leaf 의 결정이다. 그래서
|
||||
`GraphQlPlatformProperties` 가 **`backend.graphql`** prefix 로 `@ConfigurationProperties` 를
|
||||
바인딩한다(`spring.graphql.platform.*` 이 아니다 — 그 prefix 는 존재한 적이 없다).
|
||||
@@ -113,7 +113,6 @@ gRPC 와 달리 spring-graphql / graphql-java 는 Spring Boot BOM 이 관리한
|
||||
backend:
|
||||
graphql:
|
||||
deployment-mode: PRODUCTION_INTERNAL
|
||||
execution-profile: BLOCKING_MVC
|
||||
validation-policy-version: v1 # preparsed 캐시 키의 일부
|
||||
console:
|
||||
graphiql-enabled: false
|
||||
|
||||
+4
-43
@@ -114,7 +114,6 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
GraphQlExecutionPipeline pipeline,
|
||||
GraphQlScalarWiringConfigurer scalarWiring,
|
||||
GraphQlClientPolicy clientPolicy,
|
||||
ObjectProvider<GraphQlRuntimeTransport> transport,
|
||||
ObjectProvider<GraphQlProperties> frameworkProperties,
|
||||
Environment environment) {
|
||||
return () -> {
|
||||
@@ -128,46 +127,17 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
pipeline,
|
||||
scalarWiring,
|
||||
clientPolicy,
|
||||
transport.getIfAvailable(() -> GraphQlRuntimeTransport.NONE),
|
||||
framework == null ? null : framework.getSchema().getIntrospection().isEnabled(),
|
||||
framework == null ? null : framework.getGraphiql().isEnabled()));
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects a servlet runtime.
|
||||
*
|
||||
* <p>Nested conditional configurations rather than a classpath probe in the validator: this is
|
||||
* exactly the question {@code @ConditionalOnWebApplication} answers, and it answers it the same
|
||||
* way Spring Boot decides which transport to wire.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
|
||||
static class ServletRuntimeDetection {
|
||||
|
||||
@Bean
|
||||
GraphQlRuntimeTransport graphQlRuntimeTransport() {
|
||||
return GraphQlRuntimeTransport.SERVLET;
|
||||
}
|
||||
}
|
||||
|
||||
/** Detects a reactive runtime. */
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE)
|
||||
static class ReactiveRuntimeDetection {
|
||||
|
||||
@Bean
|
||||
GraphQlRuntimeTransport graphQlRuntimeTransport() {
|
||||
return GraphQlRuntimeTransport.REACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Caps the raw request body upstream of the JSON decoder, on a servlet stack.
|
||||
*
|
||||
* <p>Loaded only where servlets exist. The leaf takes the servlet API as {@code compileOnly}, so
|
||||
* on a reactive or non-web application this class is simply not on the classpath and the
|
||||
* condition never matches — which is why the guard is {@code @ConditionalOnClass} as well as
|
||||
* on a non-web application this class is simply not on the classpath and the condition never
|
||||
* matches — which is why the guard is {@code @ConditionalOnClass} as well as
|
||||
* {@code @ConditionalOnWebApplication}.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@@ -624,8 +594,6 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
* longer supplies is the machinery around it.
|
||||
*
|
||||
* @param factory the loader factory
|
||||
* @param blockingBridge the bounded hand-off, when a runtime provides one
|
||||
* @param properties the platform settings, which declare the runtime the loaders will execute on
|
||||
* @return the registrar
|
||||
*/
|
||||
@Bean
|
||||
@@ -633,15 +601,8 @@ public class GraphQlPlatformAutoConfiguration {
|
||||
dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlBatchLoaderRegistrar.class)
|
||||
public dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlBatchLoaderRegistrar
|
||||
graphQlBatchLoaderRegistrar(
|
||||
dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderFactory factory,
|
||||
ObjectProvider<dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlBlockingBridge>
|
||||
blockingBridge,
|
||||
GraphQlPlatformSettings properties) {
|
||||
// The profile decides where a chunk may run, so the registrar receives it rather than assuming
|
||||
// the servlet answer. A reactive deployment that registers a blocking loader with no bridge is
|
||||
// refused at startup instead of discovering it as event-loop starvation.
|
||||
return new dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlBatchLoaderRegistrar(
|
||||
factory, blockingBridge.getIfAvailable(), properties.executionProfile());
|
||||
dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderFactory factory) {
|
||||
return new dev.caskeleton.adapter.inbound.graphql.runtime.GraphQlBatchLoaderRegistrar(factory);
|
||||
}
|
||||
|
||||
private static String schemaContractHash(ObjectProvider<GraphQlSource> graphQlSource) {
|
||||
|
||||
-3
@@ -18,7 +18,6 @@ import java.util.Objects;
|
||||
* @param pipeline the pipeline that will run, derived from the registered handler chain
|
||||
* @param scalarWiring the scalar wiring that will be applied to the schema
|
||||
* @param clientPolicy the limits a request will be measured against
|
||||
* @param transport the server this context is actually running on
|
||||
* @param frameworkIntrospectionEnabled {@code spring.graphql.schema.introspection.enabled}, or
|
||||
* {@code null} when the framework properties are not on the classpath
|
||||
* @param frameworkGraphiqlEnabled {@code spring.graphql.graphiql.enabled}, or {@code null} when the
|
||||
@@ -29,7 +28,6 @@ public record GraphQlPlatformRuntime(
|
||||
GraphQlExecutionPipeline pipeline,
|
||||
GraphQlScalarWiringConfigurer scalarWiring,
|
||||
GraphQlClientPolicy clientPolicy,
|
||||
GraphQlRuntimeTransport transport,
|
||||
Boolean frameworkIntrospectionEnabled,
|
||||
Boolean frameworkGraphiqlEnabled) {
|
||||
|
||||
@@ -38,6 +36,5 @@ public record GraphQlPlatformRuntime(
|
||||
Objects.requireNonNull(pipeline, "pipeline is required");
|
||||
Objects.requireNonNull(scalarWiring, "scalar wiring is required");
|
||||
Objects.requireNonNull(clientPolicy, "client policy is required");
|
||||
transport = transport == null ? GraphQlRuntimeTransport.NONE : transport;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-57
@@ -1,6 +1,5 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.autoconfigure;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import java.time.Duration;
|
||||
import java.util.Set;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -22,27 +21,21 @@ import org.springframework.boot.context.properties.bind.DefaultValue;
|
||||
* internet-facing production endpoint while every protection reading the boolean behaved otherwise.
|
||||
*
|
||||
* @param deploymentMode the single safety posture; required, see {@link GraphQlDeploymentMode}
|
||||
* @param executionProfile runtime execution profile
|
||||
* @param console query console and introspection exposure
|
||||
* @param limits page and cost ceilings
|
||||
* @param unbridgedBlockingResolvers resolvers that block without an approved bridge
|
||||
*/
|
||||
@ConfigurationProperties("backend.graphql")
|
||||
public record GraphQlPlatformSettings(
|
||||
GraphQlDeploymentMode deploymentMode,
|
||||
@DefaultValue("BLOCKING_MVC") GraphQlExecutionProfile executionProfile,
|
||||
@DefaultValue Console console,
|
||||
@DefaultValue Limits limits,
|
||||
@DefaultValue("v1") String validationPolicyVersion,
|
||||
@DefaultValue Set<String> observedOperationNames,
|
||||
@DefaultValue Set<String> unbridgedBlockingResolvers) {
|
||||
@DefaultValue Set<String> observedOperationNames) {
|
||||
|
||||
public GraphQlPlatformSettings {
|
||||
// Belt and braces for programmatic construction: the binder honours @DefaultValue, but this
|
||||
// record is also built directly in tests and by adopters composing a policy in Java.
|
||||
// deploymentMode is deliberately not defaulted here — see the class Javadoc.
|
||||
executionProfile =
|
||||
executionProfile == null ? GraphQlExecutionProfile.BLOCKING_MVC : executionProfile;
|
||||
console = console == null ? Console.disabled() : console;
|
||||
limits = limits == null ? Limits.defaults() : limits;
|
||||
// Part of the preparsed cache key: bumping it invalidates every cached validation, which is
|
||||
@@ -55,8 +48,6 @@ public record GraphQlPlatformSettings(
|
||||
// safe default: a cardinality bound that has to be switched on is one nobody has switched on.
|
||||
observedOperationNames =
|
||||
observedOperationNames == null ? Set.of() : Set.copyOf(observedOperationNames);
|
||||
unbridgedBlockingResolvers =
|
||||
unbridgedBlockingResolvers == null ? Set.of() : Set.copyOf(unbridgedBlockingResolvers);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,24 +106,16 @@ public record GraphQlPlatformSettings(
|
||||
public static GraphQlPlatformSettings productionDefaults() {
|
||||
return new GraphQlPlatformSettings(
|
||||
GraphQlDeploymentMode.PRODUCTION_INTERNAL,
|
||||
GraphQlExecutionProfile.BLOCKING_MVC,
|
||||
Console.disabled(),
|
||||
Limits.defaults(),
|
||||
"v1",
|
||||
Set.of(),
|
||||
Set.of());
|
||||
}
|
||||
|
||||
/** Returns a copy running under a different deployment mode. */
|
||||
public GraphQlPlatformSettings withDeploymentMode(GraphQlDeploymentMode mode) {
|
||||
return new GraphQlPlatformSettings(
|
||||
mode,
|
||||
executionProfile,
|
||||
console,
|
||||
limits,
|
||||
validationPolicyVersion,
|
||||
observedOperationNames,
|
||||
unbridgedBlockingResolvers);
|
||||
mode, console, limits, validationPolicyVersion, observedOperationNames);
|
||||
}
|
||||
|
||||
/** Returns a copy with GraphiQL enabled or disabled. */
|
||||
@@ -148,48 +131,12 @@ public record GraphQlPlatformSettings(
|
||||
/** Returns a copy with a different console policy. */
|
||||
public GraphQlPlatformSettings withConsole(Console replacement) {
|
||||
return new GraphQlPlatformSettings(
|
||||
deploymentMode,
|
||||
executionProfile,
|
||||
replacement,
|
||||
limits,
|
||||
validationPolicyVersion,
|
||||
observedOperationNames,
|
||||
unbridgedBlockingResolvers);
|
||||
deploymentMode, replacement, limits, validationPolicyVersion, observedOperationNames);
|
||||
}
|
||||
|
||||
/** Returns a copy with different limits. */
|
||||
public GraphQlPlatformSettings withLimits(Limits replacement) {
|
||||
return new GraphQlPlatformSettings(
|
||||
deploymentMode,
|
||||
executionProfile,
|
||||
console,
|
||||
replacement,
|
||||
validationPolicyVersion,
|
||||
observedOperationNames,
|
||||
unbridgedBlockingResolvers);
|
||||
}
|
||||
|
||||
/** Returns a copy declaring resolvers that block without an approved bridge. */
|
||||
public GraphQlPlatformSettings withUnbridgedBlockingResolvers(Set<String> coordinates) {
|
||||
return new GraphQlPlatformSettings(
|
||||
deploymentMode,
|
||||
executionProfile,
|
||||
console,
|
||||
limits,
|
||||
validationPolicyVersion,
|
||||
observedOperationNames,
|
||||
Set.copyOf(coordinates));
|
||||
}
|
||||
|
||||
/** Returns a copy running a different execution profile. */
|
||||
public GraphQlPlatformSettings withExecutionProfile(GraphQlExecutionProfile profile) {
|
||||
return new GraphQlPlatformSettings(
|
||||
deploymentMode,
|
||||
profile,
|
||||
console,
|
||||
limits,
|
||||
validationPolicyVersion,
|
||||
observedOperationNames,
|
||||
unbridgedBlockingResolvers);
|
||||
deploymentMode, console, replacement, validationPolicyVersion, observedOperationNames);
|
||||
}
|
||||
}
|
||||
|
||||
-27
@@ -1,6 +1,5 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.autoconfigure;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import dev.caskeleton.shared.runtime.RuntimeEnvironment;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -53,13 +52,6 @@ public final class GraphQlPlatformStartupValidator {
|
||||
if (properties.limits().maximumComplexity() < 1) {
|
||||
problems.add("maximum complexity must be positive");
|
||||
}
|
||||
|
||||
if (properties.executionProfile() == GraphQlExecutionProfile.REACTIVE_WEBFLUX
|
||||
&& !properties.unbridgedBlockingResolvers().isEmpty()) {
|
||||
problems.add(
|
||||
"blocking resolvers without an executor bridge cannot run on the reactive profile: "
|
||||
+ new java.util.TreeSet<>(properties.unbridgedBlockingResolvers()));
|
||||
}
|
||||
return List.copyOf(problems);
|
||||
}
|
||||
|
||||
@@ -119,25 +111,6 @@ public final class GraphQlPlatformStartupValidator {
|
||||
dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionPipelineValidator.problems(
|
||||
runtime.pipeline()));
|
||||
|
||||
if (!runtime.transport().supports(runtime.properties().executionProfile())) {
|
||||
problems.add(
|
||||
"backend.graphql.execution-profile is "
|
||||
+ runtime.properties().executionProfile()
|
||||
+ " but this context runs on "
|
||||
+ runtime.transport()
|
||||
+ "; the composition root chooses the server and the two must agree");
|
||||
}
|
||||
// Independent of the declared profile: on an event loop, a resolver that blocks without a
|
||||
// bridge stalls every other request sharing the thread. MIXED_CONTROLLED is accepted on a
|
||||
// reactive transport precisely because the crossings are declared, so an undeclared one is the
|
||||
// condition that makes the profile a lie.
|
||||
if (runtime.transport() == GraphQlRuntimeTransport.REACTIVE
|
||||
&& !runtime.properties().unbridgedBlockingResolvers().isEmpty()) {
|
||||
problems.add(
|
||||
"resolvers block without an executor bridge on a reactive transport: "
|
||||
+ new java.util.TreeSet<>(runtime.properties().unbridgedBlockingResolvers()));
|
||||
}
|
||||
|
||||
try {
|
||||
runtime.scalarWiring().wiredScalars();
|
||||
} catch (RuntimeException unwirable) {
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.autoconfigure;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
|
||||
/**
|
||||
* The server this context is actually running on, as opposed to the one it was configured for.
|
||||
*
|
||||
* <p>The two used to be unable to disagree, because the leaf shipped an embedded servlet container
|
||||
* itself — which made {@code REACTIVE_WEBFLUX} a profile nobody could ever run. Now the composition
|
||||
* root chooses the server, so the two can disagree, and something has to notice.
|
||||
*/
|
||||
public enum GraphQlRuntimeTransport {
|
||||
|
||||
/** A servlet application: Spring MVC owns the {@code /graphql} route. */
|
||||
SERVLET,
|
||||
|
||||
/** A reactive application: WebFlux owns the {@code /graphql} route. */
|
||||
REACTIVE,
|
||||
|
||||
/** No web server — a plain application context, a test slice, or a batch process. */
|
||||
NONE;
|
||||
|
||||
/**
|
||||
* Whether an execution profile can run on this transport.
|
||||
*
|
||||
* <p>{@link #NONE} accepts every profile: a context with no server has no route to contradict,
|
||||
* and failing there would break every non-web test that assembles the platform.
|
||||
*
|
||||
* <p>{@code MIXED_CONTROLLED} runs on both by definition — it is the profile for a deployment
|
||||
* that crosses between blocking and reactive work through declared bridges. Accepting it here is
|
||||
* not a loophole: a reactive context still refuses to start with resolvers that block without a
|
||||
* bridge, whichever profile is declared.
|
||||
*/
|
||||
public boolean supports(GraphQlExecutionProfile profile) {
|
||||
if (this == NONE || profile == GraphQlExecutionProfile.MIXED_CONTROLLED) {
|
||||
return true;
|
||||
}
|
||||
return switch (this) {
|
||||
case SERVLET -> profile == GraphQlExecutionProfile.BLOCKING_MVC;
|
||||
case REACTIVE -> profile == GraphQlExecutionProfile.REACTIVE_WEBFLUX;
|
||||
case NONE -> true;
|
||||
};
|
||||
}
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.execution;
|
||||
|
||||
/**
|
||||
* The runtime execution profile (design §10).
|
||||
*
|
||||
* <p>{@code MIXED_CONTROLLED} is explicitly not "accept any return type". Mixing blocking and
|
||||
* reactive work is legitimate, but only across a declared bridge — without one, the same code path
|
||||
* either blocks an event loop or blocks a request thread waiting on a publisher, and which one it
|
||||
* does depends on where it happened to be called from.
|
||||
*/
|
||||
public enum GraphQlExecutionProfile {
|
||||
|
||||
/** Servlet stack with virtual threads or a bounded pool; blocking resolvers are expected. */
|
||||
BLOCKING_MVC,
|
||||
|
||||
/** Reactive stack; blocking work must be bridged off the event loop. */
|
||||
REACTIVE_WEBFLUX,
|
||||
|
||||
/** Both, with every crossing declared through an approved bridge. */
|
||||
MIXED_CONTROLLED
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.execution;
|
||||
|
||||
/**
|
||||
* Raised when a resolver's execution type cannot be served by the active runtime profile.
|
||||
*
|
||||
* <p>Thrown at startup or at the transport boundary rather than under load: a blocking repository
|
||||
* call on a WebFlux event loop does not fail, it starves the loop, and that is far harder to
|
||||
* diagnose than a refused registration.
|
||||
*/
|
||||
public class GraphQlExecutionProfileException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Creates the failure.
|
||||
*
|
||||
* @param message description naming the resolver and the conflict
|
||||
*/
|
||||
public GraphQlExecutionProfileException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
+8
-53
@@ -6,13 +6,12 @@ import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchExecutor;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchTimeoutException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderFactory;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderName;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfileException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.BiFunction;
|
||||
import org.springframework.graphql.execution.BatchLoaderRegistry;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Registers the platform's batch loaders with Spring, so they are the ones a field actually uses.
|
||||
@@ -27,48 +26,20 @@ import org.springframework.graphql.execution.BatchLoaderRegistry;
|
||||
* as something the adopter has to remember. What the adopter supplies is the downstream call; what
|
||||
* this adds is everything that makes it safe to run on a shared request budget.
|
||||
*
|
||||
* <p>Where the chunk actually runs is a property of the runtime, so the registrar is told which one
|
||||
* it is. On a servlet stack the answer is "here": Spring already put the request on a thread, and a
|
||||
* second pool would only add a queue and a wait. On a reactive stack the same inline call runs on
|
||||
* the event loop, where one slow downstream stalls every request the loop is serving — so a
|
||||
* reactive deployment either supplies the bounded bridge or does not get to register a blocking
|
||||
* loader at all. Refusing at registration makes that a startup failure rather than a latency
|
||||
* mystery under load.
|
||||
* <p>The chunk runs on the calling thread. The template is servlet-only (D4): Spring has already
|
||||
* put the request on a thread, and a second pool would only add a queue and a wait.
|
||||
*/
|
||||
public final class GraphQlBatchLoaderRegistrar {
|
||||
|
||||
private final GraphQlDataLoaderFactory factory;
|
||||
private final GraphQlBlockingBridge blockingBridge;
|
||||
private final GraphQlExecutionProfile profile;
|
||||
|
||||
/**
|
||||
* Creates a registrar that runs loaders on the calling thread.
|
||||
*
|
||||
* <p>No scheduler of its own. Spring has already put the request on a thread; handing the work to
|
||||
* a second pool adds a queue, a wait and a context hop, and buys nothing on a servlet stack.
|
||||
* Creates the registrar.
|
||||
*
|
||||
* @param factory supplies the per-loader batch policy and executor
|
||||
* @param profile the runtime this deployment declared
|
||||
*/
|
||||
public GraphQlBatchLoaderRegistrar(
|
||||
GraphQlDataLoaderFactory factory, GraphQlExecutionProfile profile) {
|
||||
this(factory, null, profile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a registrar that hands blocking loads to a bounded bridge.
|
||||
*
|
||||
* @param factory supplies the per-loader batch policy and executor
|
||||
* @param blockingBridge the bounded hand-off, for a runtime where blocking in place is unsafe
|
||||
* @param profile the runtime this deployment declared
|
||||
*/
|
||||
public GraphQlBatchLoaderRegistrar(
|
||||
GraphQlDataLoaderFactory factory,
|
||||
GraphQlBlockingBridge blockingBridge,
|
||||
GraphQlExecutionProfile profile) {
|
||||
public GraphQlBatchLoaderRegistrar(GraphQlDataLoaderFactory factory) {
|
||||
this.factory = Objects.requireNonNull(factory, "data loader factory is required");
|
||||
this.blockingBridge = blockingBridge;
|
||||
this.profile = Objects.requireNonNull(profile, "execution profile is required");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,12 +60,6 @@ public final class GraphQlBatchLoaderRegistrar {
|
||||
GraphQlDataLoaderName loaderName,
|
||||
BiFunction<List<K>, GraphQlBatchContext, Map<K, V>> loadChunk) {
|
||||
|
||||
if (profile != GraphQlExecutionProfile.BLOCKING_MVC && blockingBridge == null) {
|
||||
throw new GraphQlExecutionProfileException(
|
||||
"loader "
|
||||
+ loaderName.value()
|
||||
+ " would block the event loop; declare a bounded blocking bridge");
|
||||
}
|
||||
GraphQlBatchExecutor executor = factory.executorFor(loaderName);
|
||||
|
||||
registry
|
||||
@@ -108,21 +73,11 @@ public final class GraphQlBatchLoaderRegistrar {
|
||||
if (context == null) {
|
||||
// Fail closed. A loader running without the platform context has no deadline, no
|
||||
// tenant and no actor, and would happily batch across whatever the caller was.
|
||||
return reactor.core.publisher.Mono.error(
|
||||
new GraphQlBatchTimeoutException(loaderName.value()));
|
||||
return Mono.error(new GraphQlBatchTimeoutException(loaderName.value()));
|
||||
}
|
||||
GraphQlBatchContext batchContext = factory.batchContext(context);
|
||||
reactor.core.publisher.Mono<Map<K, V>> load =
|
||||
reactor.core.publisher.Mono.fromCallable(
|
||||
() -> executor.load(List.copyOf(keys), batchContext, loadChunk));
|
||||
// Inline unless an adopter asked for the bridge. `supplyAsync` would have used the
|
||||
// common ForkJoinPool: a shared, unbounded-admission scheduler with no relationship
|
||||
// to the request budget, which is the second queue this platform exists to avoid.
|
||||
return blockingBridge == null
|
||||
? load
|
||||
: load.subscribeOn(
|
||||
reactor.core.scheduler.Schedulers.fromExecutor(
|
||||
blockingBridge.executorFor(context)));
|
||||
return Mono.fromCallable(
|
||||
() -> executor.load(List.copyOf(keys), batchContext, loadChunk));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
-93
@@ -1,93 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlContextPropagator;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.RejectedExecutionException;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* An opt-in, bounded hand-off for blocking work, carrying the request context with it.
|
||||
*
|
||||
* <p>Bounded on both axes, because a pool is only half of it. A virtual-thread-per-task executor
|
||||
* limits nothing: it accepts every task and the bound becomes whatever the downstream system will
|
||||
* tolerate. A fixed pool bounds threads and then queues without limit, which converts an overload
|
||||
* into unbounded memory and latency rather than into a refusal. Here both the pool and the queue
|
||||
* are finite and a full bridge refuses immediately, which is the answer a caller can act on.
|
||||
*
|
||||
* <p>Opt-in on purpose. The platform schedules nothing by default: work runs on the thread Spring
|
||||
* already gave it, so there is one scheduler and one queue rather than two of each with a wait
|
||||
* between them. A bridge exists for the case an adopter genuinely has — blocking work that must
|
||||
* leave an event loop — and then it is explicit, sized, and visible.
|
||||
*
|
||||
* <p>The context travels through {@link GraphQlContextPropagator}, so the thread local is bound on
|
||||
* the bridge thread and unbound afterwards. Reading the thread local is what a blocking library
|
||||
* does; the GraphQL context remains the source of truth, and this only mirrors it for the duration
|
||||
* of the hand-off.
|
||||
*/
|
||||
public final class GraphQlBlockingBridge implements AutoCloseable {
|
||||
|
||||
private final ThreadPoolExecutor executor;
|
||||
|
||||
private GraphQlBlockingBridge(ThreadPoolExecutor executor) {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a bridge with a finite pool and a finite queue.
|
||||
*
|
||||
* @param threads how many blocking calls may run at once
|
||||
* @param queueDepth how many may wait; beyond this the bridge refuses
|
||||
*/
|
||||
public static GraphQlBlockingBridge bounded(int threads, int queueDepth) {
|
||||
if (threads < 1 || queueDepth < 1) {
|
||||
throw new IllegalArgumentException("a blocking bridge needs a positive pool and queue");
|
||||
}
|
||||
ThreadPoolExecutor executor =
|
||||
new ThreadPoolExecutor(
|
||||
threads,
|
||||
threads,
|
||||
0,
|
||||
TimeUnit.MILLISECONDS,
|
||||
new ArrayBlockingQueue<>(queueDepth),
|
||||
runnable -> Thread.ofVirtual().name("graphql-blocking-bridge-", 0).unstarted(runnable),
|
||||
new ThreadPoolExecutor.AbortPolicy());
|
||||
return new GraphQlBlockingBridge(executor);
|
||||
}
|
||||
|
||||
/** How many blocking calls may run at once. */
|
||||
public int threads() {
|
||||
return executor.getMaximumPoolSize();
|
||||
}
|
||||
|
||||
/** How many may wait before the bridge refuses. */
|
||||
public int queueDepth() {
|
||||
return executor.getQueue().remainingCapacity() + executor.getQueue().size();
|
||||
}
|
||||
|
||||
/**
|
||||
* The executor, with the context bound around every task.
|
||||
*
|
||||
* @param context the request context to bind on the bridge thread
|
||||
*/
|
||||
public Executor executorFor(GraphQlRequestContext context) {
|
||||
Objects.requireNonNull(context, "request context is required");
|
||||
return task -> {
|
||||
try {
|
||||
executor.execute(() -> GraphQlContextPropagator.wrap(context, task).run());
|
||||
} catch (RejectedExecutionException full) {
|
||||
// Refusing is the point. Growing the queue here would turn an overload into latency that
|
||||
// the request deadline has to discover later, by which time the work is already queued.
|
||||
throw new GraphQlBlockingBridgeFullException(threads(), queueDepth());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
executor.shutdownNow();
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
/**
|
||||
* Raised when the blocking bridge has no capacity left.
|
||||
*
|
||||
* <p>A refusal rather than a wait. An unbounded queue turns an overload into latency that only the
|
||||
* request deadline discovers, by which time the work is already queued behind everything else and
|
||||
* the client has been waiting for all of it.
|
||||
*
|
||||
* <p>Carries the configured bounds, never a key, an actor or a tenant.
|
||||
*/
|
||||
public class GraphQlBlockingBridgeFullException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** Stable error code clients and operators see. */
|
||||
public static final String CODE = "GRAPHQL_BLOCKING_BRIDGE_FULL";
|
||||
|
||||
/**
|
||||
* Creates the failure.
|
||||
*
|
||||
* @param threads configured concurrency
|
||||
* @param queueDepth configured queue depth
|
||||
*/
|
||||
public GraphQlBlockingBridgeFullException(int threads, int queueDepth) {
|
||||
super(CODE + ": threads=" + threads + ", queue=" + queueDepth);
|
||||
}
|
||||
}
|
||||
+28
-7
@@ -13,6 +13,8 @@ import graphql.language.InlineFragment;
|
||||
import graphql.language.OperationDefinition;
|
||||
import graphql.language.Selection;
|
||||
import graphql.language.SelectionSet;
|
||||
import graphql.schema.GraphQLObjectType;
|
||||
import graphql.schema.GraphQLSchema;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
@@ -63,7 +65,7 @@ public final class GraphQlDocumentAuthorizationHandler implements GraphQlExecuti
|
||||
analyzer.verifyIntrospection(
|
||||
context.requireDocument(), operation, policy.introspectionAllowed());
|
||||
|
||||
String rootTypeName = rootTypeName(operation);
|
||||
String rootTypeName = rootTypeName(context.schema(), operation);
|
||||
for (String fieldName : rootFieldNames(context, operation, analyzer.maximumVisitedNodes())) {
|
||||
authorization.authorize(
|
||||
context.requestContext(), new GraphQlSchemaCoordinate(rootTypeName, fieldName));
|
||||
@@ -71,16 +73,35 @@ public final class GraphQlDocumentAuthorizationHandler implements GraphQlExecuti
|
||||
return context;
|
||||
}
|
||||
|
||||
private static String rootTypeName(OperationDefinition operation) {
|
||||
/**
|
||||
* The root type name the schema actually declares for this operation.
|
||||
*
|
||||
* <p>Read from the schema, never assumed. {@code schema { query: RootQuery }} is legal, and a
|
||||
* rule written against {@code RootQuery.adminReport} must be the rule this stage consults — a
|
||||
* literal {@code "Query"} would look up a coordinate nobody wrote, and an allow-by-default policy
|
||||
* would then allow the field its rule restricts.
|
||||
*
|
||||
* @throws IllegalStateException when there is no schema or it declares no such root; both fail
|
||||
* the request closed rather than authorize against a guessed name
|
||||
*/
|
||||
private static String rootTypeName(GraphQLSchema schema, OperationDefinition operation) {
|
||||
OperationDefinition.Operation kind =
|
||||
operation.getOperation() == null
|
||||
? OperationDefinition.Operation.QUERY
|
||||
: operation.getOperation();
|
||||
return switch (kind) {
|
||||
case QUERY -> "Query";
|
||||
case MUTATION -> "Mutation";
|
||||
case SUBSCRIPTION -> "Subscription";
|
||||
};
|
||||
if (schema == null) {
|
||||
throw new IllegalStateException("no schema is available to name the root type of " + kind);
|
||||
}
|
||||
GraphQLObjectType root =
|
||||
switch (kind) {
|
||||
case QUERY -> schema.getQueryType();
|
||||
case MUTATION -> schema.getMutationType();
|
||||
case SUBSCRIPTION -> schema.getSubscriptionType();
|
||||
};
|
||||
if (root == null) {
|
||||
throw new IllegalStateException("the schema declares no root type for " + kind);
|
||||
}
|
||||
return root.getName();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,6 @@ backend:
|
||||
# 켠 상태에서 필수이고 runtime 환경과 맞아야 한다
|
||||
# (local->LOCAL, dev->DEV, prod->PRODUCTION_INTERNAL|PRODUCTION_PUBLIC).
|
||||
deployment-mode: ${APP_GRAPHQL_DEPLOYMENT_MODE:}
|
||||
execution-profile: ${APP_GRAPHQL_EXECUTION_PROFILE:BLOCKING_MVC}
|
||||
validation-policy-version: ${APP_GRAPHQL_VALIDATION_POLICY_VERSION:v1}
|
||||
observed-operation-names: ${APP_GRAPHQL_OBSERVED_OPERATION_NAMES:}
|
||||
console:
|
||||
|
||||
+3
-2
@@ -203,7 +203,6 @@ class GraphQlPlatformAutoConfigurationTest {
|
||||
.contains("backend.graphql.deployment-mode")
|
||||
.doesNotContain("backend.graphql.production")
|
||||
.doesNotContain("backend.graphql.environment")
|
||||
.contains("backend.graphql.execution-profile")
|
||||
.contains("backend.graphql.console.graphiql-enabled")
|
||||
.contains("backend.graphql.console.introspection-enabled")
|
||||
.contains("backend.graphql.limits.maximum-page-size")
|
||||
@@ -211,7 +210,9 @@ class GraphQlPlatformAutoConfigurationTest {
|
||||
// Keys that only failed the boot or were echoed back unused were removed (2026-09-25).
|
||||
.doesNotContain("backend.graphql.cursor.key-ids")
|
||||
.doesNotContain("backend.graphql.unsupported.multipart-upload")
|
||||
.contains("backend.graphql.unbridged-blocking-resolvers");
|
||||
// Servlet-only template (D4): no reactive profile to choose, no event loop to bridge off.
|
||||
.doesNotContain("backend.graphql.execution-profile")
|
||||
.doesNotContain("backend.graphql.unbridged-blocking-resolvers");
|
||||
}
|
||||
|
||||
private static GraphQlProperties frameworkDefaults() {
|
||||
|
||||
-13
@@ -4,8 +4,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import java.util.Set;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Starter configuration and startup validation (Stable plan Task 46). */
|
||||
@@ -40,17 +38,6 @@ class GraphQlPlatformStartupValidatorTest {
|
||||
assertThat(new GraphQlPlatformStartupValidator().problems(properties)).hasSize(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aBlockingResolverWithoutABridgeCannotRunOnTheReactiveProfile() {
|
||||
var properties =
|
||||
GraphQlPlatformSettings.productionDefaults()
|
||||
.withExecutionProfile(GraphQlExecutionProfile.REACTIVE_WEBFLUX)
|
||||
.withUnbridgedBlockingResolvers(Set.of("Order.total"));
|
||||
|
||||
assertThat(new GraphQlPlatformStartupValidator().problems(properties))
|
||||
.anySatisfy(problem -> assertThat(problem).contains("Order.total"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void introspectionAndGraphiqlFollowTheDeploymentMode() {
|
||||
assertThat(GraphQlDeploymentMode.LOCAL.graphiqlAllowed()).isTrue();
|
||||
|
||||
+4
-121
@@ -2,7 +2,6 @@ package dev.caskeleton.adapter.inbound.graphql.autoconfigure;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Files;
|
||||
@@ -10,24 +9,15 @@ import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
|
||||
/**
|
||||
* The leaf must not decide which server an adopter runs.
|
||||
*
|
||||
* <p>This artifact used to depend on {@code spring-boot-starter-web}, which put an embedded Tomcat
|
||||
* on every adopter's runtime classpath — while the same artifact advertised a {@code
|
||||
* REACTIVE_WEBFLUX} execution profile that could never have been honoured. Not one production file
|
||||
* imports a servlet or {@code org.springframework.web} type, so the dependency bought nothing and
|
||||
* cost adopters a server they may not have wanted.
|
||||
*
|
||||
* <p>Two checks, because each catches what the other cannot. The lockfile assertion catches a
|
||||
* transitive server sneaking back onto the runtime classpath, which no test that boots a context
|
||||
* can see. The context assertions catch a deployment whose declared profile does not match the
|
||||
* server it is actually running on, which the lockfile has no opinion about.
|
||||
* on every adopter's runtime classpath. Not one production file imports a servlet or {@code
|
||||
* org.springframework.web} type, so the dependency bought nothing and cost adopters a server they
|
||||
* may not have wanted. The lockfile assertion catches a transitive server sneaking back onto the
|
||||
* runtime classpath, which no test that boots a context can see.
|
||||
*/
|
||||
class GraphQlTransportNeutralityTest {
|
||||
|
||||
@@ -61,113 +51,6 @@ class GraphQlTransportNeutralityTest {
|
||||
line -> assertThat(line).startsWith("org.springframework.graphql:spring-graphql"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aNonWebContextAcceptsAnyProfile() {
|
||||
new ApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.execution-profile=REACTIVE_WEBFLUX")
|
||||
.run(context -> assertThat(context).hasNotFailed());
|
||||
}
|
||||
|
||||
@Test
|
||||
void aServletContextRunningTheReactiveProfileRefusesToStart() {
|
||||
new WebApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.execution-profile=REACTIVE_WEBFLUX")
|
||||
.run(
|
||||
context ->
|
||||
assertThat(context)
|
||||
.hasFailed()
|
||||
.getFailure()
|
||||
.rootCause()
|
||||
.hasMessageContaining("this context runs on SERVLET"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aReactiveContextRunningTheBlockingProfileRefusesToStart() {
|
||||
new ReactiveWebApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.execution-profile=BLOCKING_MVC")
|
||||
.run(
|
||||
context ->
|
||||
assertThat(context)
|
||||
.hasFailed()
|
||||
.getFailure()
|
||||
.rootCause()
|
||||
.hasMessageContaining("this context runs on REACTIVE"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void aServletContextRunningTheBlockingProfileStarts() {
|
||||
new WebApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.execution-profile=BLOCKING_MVC")
|
||||
.run(
|
||||
context -> {
|
||||
assertThat(context).hasNotFailed();
|
||||
assertThat(context.getBean(GraphQlRuntimeTransport.class))
|
||||
.isEqualTo(GraphQlRuntimeTransport.SERVLET);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void aReactiveContextRunningTheReactiveProfileStarts() {
|
||||
new ReactiveWebApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.enabled=true", "backend.graphql.execution-profile=REACTIVE_WEBFLUX")
|
||||
.run(
|
||||
context -> {
|
||||
assertThat(context).hasNotFailed();
|
||||
assertThat(context.getBean(GraphQlRuntimeTransport.class))
|
||||
.isEqualTo(GraphQlRuntimeTransport.REACTIVE);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void everyProfileNamesTheTransportItCanRunOn() {
|
||||
assertThat(GraphQlRuntimeTransport.SERVLET.supports(GraphQlExecutionProfile.BLOCKING_MVC))
|
||||
.isTrue();
|
||||
assertThat(GraphQlRuntimeTransport.SERVLET.supports(GraphQlExecutionProfile.REACTIVE_WEBFLUX))
|
||||
.isFalse();
|
||||
assertThat(GraphQlRuntimeTransport.REACTIVE.supports(GraphQlExecutionProfile.REACTIVE_WEBFLUX))
|
||||
.isTrue();
|
||||
assertThat(GraphQlRuntimeTransport.REACTIVE.supports(GraphQlExecutionProfile.BLOCKING_MVC))
|
||||
.isFalse();
|
||||
|
||||
for (GraphQlRuntimeTransport transport : GraphQlRuntimeTransport.values()) {
|
||||
assertThat(transport.supports(GraphQlExecutionProfile.MIXED_CONTROLLED))
|
||||
.as("MIXED_CONTROLLED is the profile for a deployment that runs on both")
|
||||
.isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void aReactiveContextWithUnbridgedBlockingResolversRefusesToStart() {
|
||||
new ReactiveWebApplicationContextRunner()
|
||||
.withPropertyValues("backend.graphql.enabled=true", "backend.graphql.deployment-mode=LOCAL")
|
||||
.withConfiguration(AutoConfigurations.of(GraphQlRootAutoConfiguration.class))
|
||||
.withPropertyValues(
|
||||
"backend.graphql.execution-profile=MIXED_CONTROLLED",
|
||||
"backend.graphql.unbridged-blocking-resolvers=Order.total")
|
||||
.run(
|
||||
context ->
|
||||
assertThat(context)
|
||||
.hasFailed()
|
||||
.getFailure()
|
||||
.rootCause()
|
||||
.hasMessageContaining("block without an executor bridge on a reactive"));
|
||||
}
|
||||
|
||||
private static boolean onProductionClasspath(String line) {
|
||||
int separator = line.indexOf('=');
|
||||
if (separator < 0) {
|
||||
|
||||
+1
-50
@@ -1,7 +1,6 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlDeadline;
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
@@ -12,9 +11,6 @@ import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlBatchPolicyRegis
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderFactory;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlDataLoaderName;
|
||||
import dev.caskeleton.adapter.inbound.graphql.dataloader.GraphQlMissingKeyPolicy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfile;
|
||||
import dev.caskeleton.adapter.inbound.graphql.execution.GraphQlExecutionProfileException;
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlContextPropagator;
|
||||
import dev.caskeleton.adapter.inbound.graphql.testkit.GraphQlRequestContexts;
|
||||
import graphql.ExecutionInput;
|
||||
import graphql.ExecutionResult;
|
||||
@@ -202,45 +198,6 @@ class GraphQlBatchLoaderRegistrationTest {
|
||||
.isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aReactiveRuntimeWithoutABridgeRefusesTheLoader() {
|
||||
GraphQlBatchLoaderRegistrar registrar =
|
||||
new GraphQlBatchLoaderRegistrar(
|
||||
factory(chunkSize(20), Clock.systemUTC()), GraphQlExecutionProfile.REACTIVE_WEBFLUX);
|
||||
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
registrar.<String, Map<String, Object>>register(
|
||||
new DefaultBatchLoaderRegistry(), LOADER, (keys, batchContext) -> Map.of()))
|
||||
.as("an inline blocking chunk on an event loop stalls every request that loop is serving")
|
||||
.isInstanceOf(GraphQlExecutionProfileException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aBridgedLoaderRunsOffTheCallingThreadAndStillSeesTheRequest() {
|
||||
RecordingLoader downstream = new RecordingLoader();
|
||||
try (GraphQlBlockingBridge bridge = GraphQlBlockingBridge.bounded(1, 4)) {
|
||||
Fixture fixture =
|
||||
new Fixture(
|
||||
new GraphQlBatchLoaderRegistrar(
|
||||
factory(chunkSize(20), Clock.systemUTC()),
|
||||
bridge,
|
||||
GraphQlExecutionProfile.REACTIVE_WEBFLUX),
|
||||
"tenant-a",
|
||||
Clock.systemUTC());
|
||||
|
||||
ExecutionResult result = fixture.execute(orders(5, 5), downstream);
|
||||
|
||||
assertThat(result.getErrors()).isEmpty();
|
||||
assertThat(downstream.observedThreads)
|
||||
.as("the bridge exists to move the blocking call off the thread that subscribed")
|
||||
.doesNotContain(Thread.currentThread().getName());
|
||||
assertThat(downstream.observedBoundContexts)
|
||||
.as("a batch that arrives on the bridge thread with no context has no tenant")
|
||||
.containsExactly(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void aServletRuntimeLoadsOnTheThreadItWasGiven() {
|
||||
RecordingLoader downstream = new RecordingLoader();
|
||||
@@ -267,11 +224,7 @@ class GraphQlBatchLoaderRegistrationTest {
|
||||
}
|
||||
|
||||
private static Fixture fixture(GraphQlBatchPolicy policy, Clock clock, String tenant) {
|
||||
return new Fixture(
|
||||
new GraphQlBatchLoaderRegistrar(
|
||||
factory(policy, clock), GraphQlExecutionProfile.BLOCKING_MVC),
|
||||
tenant,
|
||||
clock);
|
||||
return new Fixture(new GraphQlBatchLoaderRegistrar(factory(policy, clock)), tenant, clock);
|
||||
}
|
||||
|
||||
private static GraphQlDataLoaderFactory factory(GraphQlBatchPolicy policy, Clock clock) {
|
||||
@@ -305,7 +258,6 @@ class GraphQlBatchLoaderRegistrationTest {
|
||||
private final Set<String> observedScopes = new LinkedHashSet<>();
|
||||
private Runnable onCall = () -> {};
|
||||
private final Set<String> observedThreads = new LinkedHashSet<>();
|
||||
private final Set<Boolean> observedBoundContexts = new LinkedHashSet<>();
|
||||
private String extraKey;
|
||||
private String nullValueKey;
|
||||
private String omittedKey;
|
||||
@@ -315,7 +267,6 @@ class GraphQlBatchLoaderRegistrationTest {
|
||||
requestedKeys.addAll(keys);
|
||||
observedScopes.add(context.cacheScope());
|
||||
observedThreads.add(Thread.currentThread().getName());
|
||||
observedBoundContexts.add(GraphQlContextPropagator.current().isPresent());
|
||||
onCall.run();
|
||||
Map<String, Map<String, Object>> rows = new LinkedHashMap<>();
|
||||
for (String key : keys) {
|
||||
|
||||
-118
@@ -1,118 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.graphql.runtime;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.graphql.context.GraphQlRequestContext;
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlContextPropagator;
|
||||
import dev.caskeleton.adapter.inbound.graphql.testkit.GraphQlRequestContexts;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* A hand-off that refuses is bounded; one that queues is not.
|
||||
*
|
||||
* <p>The platform previously offered two "bounded" executors that were not: a
|
||||
* virtual-thread-per-task executor, which admits every task, and a fixed pool, whose default {@code
|
||||
* LinkedBlockingQueue} is unbounded — so an overload became latency and memory instead of a
|
||||
* refusal, and the request deadline was the only thing that ever noticed.
|
||||
*/
|
||||
class GraphQlBlockingBridgeTest {
|
||||
|
||||
private final GraphQlRequestContext context = GraphQlRequestContexts.testContext("tenant-a");
|
||||
|
||||
@Test
|
||||
void aFullBridgeRefusesInsteadOfQueueing() throws Exception {
|
||||
CountDownLatch occupied = new CountDownLatch(1);
|
||||
CountDownLatch release = new CountDownLatch(1);
|
||||
|
||||
try (GraphQlBlockingBridge bridge = GraphQlBlockingBridge.bounded(1, 1)) {
|
||||
bridge
|
||||
.executorFor(context)
|
||||
.execute(
|
||||
() -> {
|
||||
occupied.countDown();
|
||||
try {
|
||||
release.await(5, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException interrupted) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
});
|
||||
assertThat(occupied.await(5, TimeUnit.SECONDS)).isTrue();
|
||||
|
||||
// One running, one queued: the bridge is now full.
|
||||
bridge.executorFor(context).execute(() -> {});
|
||||
|
||||
assertThatThrownBy(() -> bridge.executorFor(context).execute(() -> {}))
|
||||
.isInstanceOf(GraphQlBlockingBridgeFullException.class)
|
||||
.hasMessageContaining(GraphQlBlockingBridgeFullException.CODE);
|
||||
release.countDown();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void theRequestContextTravelsWithTheWork() throws Exception {
|
||||
AtomicReference<GraphQlRequestContext> seen = new AtomicReference<>();
|
||||
CountDownLatch done = new CountDownLatch(1);
|
||||
|
||||
try (GraphQlBlockingBridge bridge = GraphQlBlockingBridge.bounded(1, 1)) {
|
||||
bridge
|
||||
.executorFor(context)
|
||||
.execute(
|
||||
() -> {
|
||||
seen.set(GraphQlContextPropagator.current().orElse(null));
|
||||
done.countDown();
|
||||
});
|
||||
assertThat(done.await(5, TimeUnit.SECONDS)).isTrue();
|
||||
}
|
||||
|
||||
assertThat(seen.get())
|
||||
.as("a batch load that hopped threads without its context has no tenant")
|
||||
.isNotNull();
|
||||
assertThat(seen.get().tenant().value()).isEqualTo("tenant-a");
|
||||
}
|
||||
|
||||
@Test
|
||||
void theContextDoesNotLeakIntoAPooledThreadAfterwards() throws Exception {
|
||||
AtomicReference<Boolean> boundAfterwards = new AtomicReference<>();
|
||||
CountDownLatch first = new CountDownLatch(1);
|
||||
CountDownLatch second = new CountDownLatch(1);
|
||||
|
||||
try (GraphQlBlockingBridge bridge = GraphQlBlockingBridge.bounded(1, 2)) {
|
||||
bridge.executorFor(context).execute(first::countDown);
|
||||
assertThat(first.await(5, TimeUnit.SECONDS)).isTrue();
|
||||
|
||||
// A raw task on the same pool: nothing should still be bound to that thread.
|
||||
bridge
|
||||
.executorFor(context)
|
||||
.execute(
|
||||
() -> {
|
||||
boundAfterwards.set(GraphQlContextPropagator.current().isPresent());
|
||||
second.countDown();
|
||||
});
|
||||
assertThat(second.await(5, TimeUnit.SECONDS)).isTrue();
|
||||
}
|
||||
|
||||
assertThat(boundAfterwards.get())
|
||||
.as("the propagator binds for the task and restores afterwards")
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aBridgeMustBeGivenPositiveBounds() {
|
||||
assertThatThrownBy(() -> GraphQlBlockingBridge.bounded(0, 1))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
assertThatThrownBy(() -> GraphQlBlockingBridge.bounded(1, 0))
|
||||
.isInstanceOf(IllegalArgumentException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void theBoundsAreReadableForOperations() {
|
||||
try (GraphQlBlockingBridge bridge = GraphQlBlockingBridge.bounded(4, 16)) {
|
||||
assertThat(bridge.threads()).isEqualTo(4);
|
||||
assertThat(bridge.queueDepth()).isEqualTo(16);
|
||||
}
|
||||
}
|
||||
}
|
||||
+71
-1
@@ -14,8 +14,12 @@ import dev.caskeleton.adapter.inbound.graphql.security.GraphQlAuthorizationInter
|
||||
import dev.caskeleton.adapter.inbound.graphql.security.GraphQlAuthorizationPolicy;
|
||||
import dev.caskeleton.adapter.inbound.graphql.testkit.GraphQlRequestContexts;
|
||||
import graphql.parser.Parser;
|
||||
import graphql.schema.GraphQLSchema;
|
||||
import graphql.schema.idl.SchemaParser;
|
||||
import graphql.schema.idl.UnExecutableSchemaGenerator;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
@@ -37,6 +41,27 @@ class GraphQlDocumentAuthorizationHandlerTest {
|
||||
GraphQlSchemaCoordinate.parse("Query.adminReport"), new GraphQlClientProfile("admin"))
|
||||
.build();
|
||||
|
||||
private static final GraphQLSchema DEFAULT_ROOTS_SCHEMA =
|
||||
schema(
|
||||
"type Query { health: String adminReport: String a: String b: String c: String d: String }");
|
||||
|
||||
/** An adopter is free to name its roots; the rule is written against the names it chose. */
|
||||
private static final GraphQLSchema RENAMED_ROOTS_SCHEMA =
|
||||
schema(
|
||||
"schema { query: RootQuery mutation: RootMutation } "
|
||||
+ "type RootQuery { adminReport: String } type RootMutation { purge: String }");
|
||||
|
||||
private static final GraphQlAuthorizationPolicy RENAMED_ROOTS_FOR_ADMINS_ONLY =
|
||||
GraphQlAuthorizationPolicy.builder()
|
||||
.denyByDefault(false)
|
||||
.allow(
|
||||
GraphQlSchemaCoordinate.parse("RootQuery.adminReport"),
|
||||
new GraphQlClientProfile("admin"))
|
||||
.allow(
|
||||
GraphQlSchemaCoordinate.parse("RootMutation.purge"),
|
||||
new GraphQlClientProfile("admin"))
|
||||
.build();
|
||||
|
||||
@Test
|
||||
void exponentialFragmentFanOutIsAuthorizedWithinTheTimeBound() {
|
||||
// given
|
||||
@@ -76,6 +101,43 @@ class GraphQlDocumentAuthorizationHandlerTest {
|
||||
.hasMessage("GraphQL authorization denied: COORDINATE_NOT_AUTHORIZED");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"query Q { adminReport }", "mutation Q { purge }"})
|
||||
@DisplayName("root 타입 이름을 바꾼 schema 에서도 보호된 root field 는 그 이름의 규칙으로 거부된다")
|
||||
void aProtectedFieldOnARenamedRootTypeIsStillDenied(String document) {
|
||||
// given
|
||||
GraphQlDocumentAuthorizationHandler handler =
|
||||
new GraphQlDocumentAuthorizationHandler(
|
||||
new GraphQlAuthorizationInterceptor(RENAMED_ROOTS_FOR_ADMINS_ONLY),
|
||||
new GraphQlDocumentShapeAnalyzer(),
|
||||
GraphQlClientPolicy.defaults(100, 10_000, false));
|
||||
GraphQlExecutionContext selected = selected(document, RENAMED_ROOTS_SCHEMA);
|
||||
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> handler.handle(selected));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(GraphQlAuthorizationDeniedException.class)
|
||||
.hasMessage("GraphQL authorization denied: COORDINATE_NOT_AUTHORIZED");
|
||||
}
|
||||
|
||||
@Test
|
||||
void aContextWithoutASchemaIsRefusedInsteadOfGuessingRootNames() {
|
||||
// given
|
||||
GraphQlDocumentAuthorizationHandler handler =
|
||||
handler(new GraphQlDocumentShapeAnalyzer(), false);
|
||||
GraphQlExecutionContext selected = selected("query Q { health }", null);
|
||||
|
||||
// when
|
||||
Throwable thrown = catchThrowable(() -> handler.handle(selected));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(IllegalStateException.class)
|
||||
.hasMessage("no schema is available to name the root type of QUERY");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(booleans = {true, false})
|
||||
void aDocumentBeyondTheTraversalBudgetIsRejectedAsTooComplex(boolean introspectionAllowed) {
|
||||
@@ -105,16 +167,24 @@ class GraphQlDocumentAuthorizationHandlerTest {
|
||||
}
|
||||
|
||||
private static GraphQlExecutionContext selected(String document) {
|
||||
return selected(document, DEFAULT_ROOTS_SCHEMA);
|
||||
}
|
||||
|
||||
private static GraphQlExecutionContext selected(String document, GraphQLSchema schema) {
|
||||
GraphQlExecutionContext starting =
|
||||
GraphQlExecutionContext.starting(
|
||||
new GraphQlExecutionRequest(document, "Q", Map.of(), document.length(), 0),
|
||||
GraphQlRequestContexts.testContext("tenant-a"),
|
||||
null,
|
||||
schema,
|
||||
Parser.parse(document));
|
||||
return new GraphQlOperationSelectionHandler(GraphQlClientPolicy.defaults(100, 10_000, false))
|
||||
.handle(starting);
|
||||
}
|
||||
|
||||
private static GraphQLSchema schema(String sdl) {
|
||||
return UnExecutableSchemaGenerator.makeUnExecutableSchema(new SchemaParser().parse(sdl));
|
||||
}
|
||||
|
||||
/** {@code F0} spreads {@code F1} twice, and so on: {@code levels} levels, 2^levels leaf paths. */
|
||||
private static String doublingFragments(int levels) {
|
||||
StringBuilder document = new StringBuilder("query Q { ...F0 }");
|
||||
|
||||
+7
-6
@@ -57,17 +57,18 @@ public final class TusRequestParser {
|
||||
/**
|
||||
* Reads the declared final length.
|
||||
*
|
||||
* <p>{@code Upload-Defer-Length: 1} means the client will declare it later, which is legal and
|
||||
* distinct from a length of zero.
|
||||
* <p>{@code Upload-Defer-Length} is refused. It belongs to the {@code creation-defer-length}
|
||||
* extension, which this server does not advertise because no PATCH here can declare the length
|
||||
* later — an upload created that way could never be finalized.
|
||||
*/
|
||||
public OptionalLong declaredLength(HttpServletRequest request) {
|
||||
if ("1".equals(request.getHeader(TusHeaders.UPLOAD_DEFER_LENGTH))) {
|
||||
return OptionalLong.empty();
|
||||
if (request.getHeader(TusHeaders.UPLOAD_DEFER_LENGTH) != null) {
|
||||
throw MalformedRequestException.of(
|
||||
"Upload-Defer-Length is not supported; declare Upload-Length on creation");
|
||||
}
|
||||
String header = request.getHeader(TusHeaders.UPLOAD_LENGTH);
|
||||
if (header == null || header.isBlank()) {
|
||||
throw MalformedRequestException.of(
|
||||
"tus creation requires Upload-Length or Upload-Defer-Length");
|
||||
throw MalformedRequestException.of("tus creation requires Upload-Length");
|
||||
}
|
||||
long length = parseNonNegative(header);
|
||||
if (length > properties.maxSize()) {
|
||||
|
||||
+1
@@ -80,6 +80,7 @@ public final class RecordingAdminService implements FileserverAdminService {
|
||||
0,
|
||||
"",
|
||||
null,
|
||||
Optional.empty(),
|
||||
1));
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -12,6 +12,7 @@ import dev.caskeleton.application.fileserver.upload.FinalizeUploadRequest;
|
||||
import dev.caskeleton.application.fileserver.upload.FinalizeUploadService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Records which uploads a protocol adapter decided to finalize. */
|
||||
@@ -43,6 +44,7 @@ public final class RecordingFinalizeService implements FinalizeUploadService {
|
||||
0,
|
||||
"",
|
||||
FileserverWebFixtures.NOW,
|
||||
Optional.empty(),
|
||||
1));
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -18,6 +18,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -106,6 +107,7 @@ public final class RecordingUploadService implements SingleShotUploadService {
|
||||
body.length(),
|
||||
"c".repeat(64),
|
||||
Instant.parse("2026-08-07T10:00:00Z"),
|
||||
Optional.empty(),
|
||||
1);
|
||||
return FileView.of(descriptor);
|
||||
}
|
||||
|
||||
+2
@@ -30,6 +30,7 @@ import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Download service backed by an in-memory immutable representation. */
|
||||
@@ -121,6 +122,7 @@ public final class StubDownloadService implements DownloadApplicationService {
|
||||
content.length,
|
||||
DIGEST,
|
||||
PUBLISHED_AT,
|
||||
Optional.empty(),
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
+13
-14
@@ -127,23 +127,22 @@ class TusProtocolContractTest {
|
||||
assertThat(finalizeService.finalized()).containsExactly(uploadIdOf(location));
|
||||
}
|
||||
|
||||
/**
|
||||
* No PATCH can declare the length later, so a deferred-length upload could never finish. The
|
||||
* {@code creation-defer-length} extension is not advertised, and a request that assumes it is
|
||||
* refused before a resource exists.
|
||||
*/
|
||||
@Test
|
||||
void aDeferredLengthUploadIsNeverAutoFinalized() throws Exception {
|
||||
String location =
|
||||
void aCreateThatDefersItsLengthIsRefusedBecauseTheExtensionIsNotOffered() throws Exception {
|
||||
// when
|
||||
ResultActions created =
|
||||
mvc.perform(
|
||||
post("/v1/uploads")
|
||||
.header(TusHeaders.RESUMABLE, "1.0.0")
|
||||
.header(TusHeaders.UPLOAD_DEFER_LENGTH, "1"))
|
||||
.andExpect(status().isCreated())
|
||||
.andReturn()
|
||||
.getResponse()
|
||||
.getHeader("Location");
|
||||
post("/v1/uploads")
|
||||
.header(TusHeaders.RESUMABLE, "1.0.0")
|
||||
.header(TusHeaders.UPLOAD_DEFER_LENGTH, "1"));
|
||||
|
||||
appendAt(location, 0, "abc");
|
||||
|
||||
assertThat(finalizeService.finalized()).isEmpty();
|
||||
mvc.perform(head(location).header(TusHeaders.RESUMABLE, "1.0.0"))
|
||||
.andExpect(header().string(TusHeaders.UPLOAD_DEFER_LENGTH, "1"));
|
||||
// then
|
||||
created.andExpect(status().isBadRequest());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+15
-6
@@ -3,6 +3,7 @@ package dev.caskeleton.adapter.inbound.web.notification.platform.callback;
|
||||
import dev.caskeleton.adapter.inbound.web.core.OwnsAbsoluteWebRoute;
|
||||
import dev.caskeleton.application.notification.platform.api.error.CallbackValidationException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
@@ -12,7 +13,6 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -73,13 +73,22 @@ public final class NotificationCallbackMvcController {
|
||||
*/
|
||||
public static final int MAX_STORABLE_BODY_BYTES = 65_536 - 28;
|
||||
|
||||
/** Receive one provider callback. */
|
||||
/**
|
||||
* Receive one provider callback.
|
||||
*
|
||||
* <p>The body is read here, not bound: this path is unauthenticated until the signature is
|
||||
* checked, so a converter that buffers the whole body first would let anyone make the server hold
|
||||
* whatever they send. A declared oversize is refused before a byte is read; a chunked or
|
||||
* understated one after one byte past the ceiling.
|
||||
*/
|
||||
@PostMapping(path = "/{provider}/{profile}")
|
||||
public ResponseEntity<Void> callback(
|
||||
@PathVariable String provider,
|
||||
@PathVariable String profile,
|
||||
HttpServletRequest request,
|
||||
@RequestBody byte[] body) {
|
||||
@PathVariable String provider, @PathVariable String profile, HttpServletRequest request)
|
||||
throws IOException {
|
||||
if (request.getContentLengthLong() > maxBodyBytes) {
|
||||
return ResponseEntity.status(HttpStatus.CONTENT_TOO_LARGE).build();
|
||||
}
|
||||
byte[] body = request.getInputStream().readNBytes(maxBodyBytes + 1);
|
||||
if (body.length > maxBodyBytes) {
|
||||
return ResponseEntity.status(HttpStatus.CONTENT_TOO_LARGE).build();
|
||||
}
|
||||
|
||||
+39
-21
@@ -56,7 +56,7 @@ class NotificationCallbackMvcControllerTest {
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
controller.callback(
|
||||
"twilio", "twilio-primary", request("application/x-www-form-urlencoded"), body))
|
||||
"twilio", "twilio-primary", request("application/x-www-form-urlencoded", body)))
|
||||
.isInstanceOf(CallbackValidationException.class);
|
||||
|
||||
assertThat(received).hasSize(1);
|
||||
@@ -67,15 +67,12 @@ class NotificationCallbackMvcControllerTest {
|
||||
|
||||
@Test
|
||||
void aForwardedHostFromAnUntrustedPeerIsIgnored() {
|
||||
var request = request("application/json");
|
||||
var request = request("application/json", "{}".getBytes(StandardCharsets.UTF_8));
|
||||
request.setRemoteAddr("203.0.113.9");
|
||||
request.addHeader("X-Forwarded-Proto", "https");
|
||||
request.addHeader("X-Forwarded-Host", "attacker.example.com");
|
||||
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
controller.callback(
|
||||
"twilio", "twilio-primary", request, "{}".getBytes(StandardCharsets.UTF_8)))
|
||||
assertThatThrownBy(() -> controller.callback("twilio", "twilio-primary", request))
|
||||
.isInstanceOf(CallbackValidationException.class);
|
||||
|
||||
assertThat(received.getFirst().externalUrl()).doesNotContain("attacker.example.com");
|
||||
@@ -83,15 +80,12 @@ class NotificationCallbackMvcControllerTest {
|
||||
|
||||
@Test
|
||||
void aForwardedHostFromATrustedProxyBecomesTheCanonicalUrl() {
|
||||
var request = request("application/json");
|
||||
var request = request("application/json", "{}".getBytes(StandardCharsets.UTF_8));
|
||||
request.setRemoteAddr(TRUSTED_PROXY);
|
||||
request.addHeader("X-Forwarded-Proto", "https");
|
||||
request.addHeader("X-Forwarded-Host", "callback.example.com");
|
||||
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
controller.callback(
|
||||
"twilio", "twilio-primary", request, "{}".getBytes(StandardCharsets.UTF_8)))
|
||||
assertThatThrownBy(() -> controller.callback("twilio", "twilio-primary", request))
|
||||
.isInstanceOf(CallbackValidationException.class);
|
||||
|
||||
assertThat(received.getFirst().externalUrl())
|
||||
@@ -101,13 +95,10 @@ class NotificationCallbackMvcControllerTest {
|
||||
|
||||
@Test
|
||||
void headersSurviveContainerCasingAndStayCaseInsensitive() {
|
||||
var request = request("application/json");
|
||||
var request = request("application/json", "{}".getBytes(StandardCharsets.UTF_8));
|
||||
request.addHeader("X-Twilio-Signature", "abc123");
|
||||
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
controller.callback(
|
||||
"twilio", "twilio-primary", request, "{}".getBytes(StandardCharsets.UTF_8)))
|
||||
assertThatThrownBy(() -> controller.callback("twilio", "twilio-primary", request))
|
||||
.isInstanceOf(CallbackValidationException.class);
|
||||
|
||||
assertThat(received.getFirst().header("x-twilio-signature")).contains("abc123");
|
||||
@@ -115,13 +106,39 @@ class NotificationCallbackMvcControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void aBodyOverTheTransportCeilingIsRefusedBeforeIngress() {
|
||||
byte[] oversized = new byte[NotificationCallbackMvcController.MAX_STORABLE_BODY_BYTES + 1];
|
||||
void aDeclaredOversizeBodyIsRefusedWithoutReadingIt() throws Exception {
|
||||
// given
|
||||
int oversize = NotificationCallbackMvcController.MAX_STORABLE_BODY_BYTES + 1;
|
||||
var request = request("application/json", new byte[oversize]);
|
||||
|
||||
var response =
|
||||
controller.callback("twilio", "twilio-primary", request("application/json"), oversized);
|
||||
// when
|
||||
var response = controller.callback("twilio", "twilio-primary", request);
|
||||
|
||||
// then
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CONTENT_TOO_LARGE);
|
||||
assertThat(request.getInputStream().available()).isEqualTo(oversize);
|
||||
}
|
||||
|
||||
@Test
|
||||
void anUndeclaredOversizeBodyIsRefusedAfterReadingOneByteOverTheCeiling() throws Exception {
|
||||
// given: a chunked body carries no Content-Length
|
||||
int ceiling = NotificationCallbackMvcController.MAX_STORABLE_BODY_BYTES;
|
||||
var request =
|
||||
new MockHttpServletRequest(
|
||||
"POST", "/internal/notification/callbacks/twilio/twilio-primary") {
|
||||
@Override
|
||||
public long getContentLengthLong() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
request.setContent(new byte[ceiling + 1_000]);
|
||||
|
||||
// when
|
||||
var response = controller.callback("twilio", "twilio-primary", request);
|
||||
|
||||
// then
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CONTENT_TOO_LARGE);
|
||||
assertThat(request.getInputStream().available()).isEqualTo(999);
|
||||
assertThat(received).isEmpty();
|
||||
}
|
||||
|
||||
@@ -138,11 +155,12 @@ class NotificationCallbackMvcControllerTest {
|
||||
assertThat(response.getBody()).isNull();
|
||||
}
|
||||
|
||||
private static MockHttpServletRequest request(String contentType) {
|
||||
private static MockHttpServletRequest request(String contentType, byte[] body) {
|
||||
var request =
|
||||
new MockHttpServletRequest(
|
||||
"POST", "/internal/notification/callbacks/twilio/twilio-primary");
|
||||
request.setContentType(contentType);
|
||||
request.setContent(body);
|
||||
return request;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,10 +297,12 @@ commit-aware response wrapper 계약을 구현한다. 또한 이 모듈은 HTML
|
||||
- `HandlerInterceptor` 입력으로 resolve 하는 이유: route template(`/v1/worklogs/{id}`)을 쓰기 위함. servlet
|
||||
filter 는 handler mapping 이전에 실행돼 구체 경로만 보므로 모든 id 가 서로 다른 키가 되어버린다.
|
||||
|
||||
### RateLimitClientIpMode
|
||||
- 비인증 rate-limit 키의 클라이언트 IP 소스 선택 enum.
|
||||
- `REMOTE_ADDR_ONLY` — 직접 노출 배포의 안전한 기본값(spoofing 가능한 forwarded 헤더 무시).
|
||||
- `FORWARDED_HEADERS_TRUSTED` — 신뢰할 수 있는 ingress/LB 가 forwarded 헤더를 덮어쓰는 경우에만 사용.
|
||||
### 클라이언트 IP
|
||||
- 비인증 키의 IP 는 `getRemoteAddr()` 하나다. 헤더를 직접 읽는 모드(`FORWARDED_HEADERS_TRUSTED`)는
|
||||
XFF 맨 왼쪽 값(호출자가 쓰는 값)을 키로 써서 삭제했다.
|
||||
- 프록시 뒤에서는 `server.forward-headers-strategy=native` + `server.tomcat.remoteip.internal-proxies`
|
||||
로 Tomcat 이 신뢰 프록시에게서 온 XFF 만 반영한다. `framework` 는 모든 peer 를 믿으므로
|
||||
`RateLimitWebConfig` 가 기동을 거부한다.
|
||||
|
||||
### RateLimitWebConfig
|
||||
- servlet filter 가 아니라 interceptor 를 쓰는 이유: 비인증 키에 필요한 route template 이 interceptor 단계에서
|
||||
|
||||
+8
-1
@@ -275,6 +275,13 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
|
||||
HttpHeaders headers,
|
||||
HttpStatusCode status,
|
||||
WebRequest request) {
|
||||
// The JSON body ceiling fails the read that crosses it; inside a bean property the parser
|
||||
// wraps that failure, and it is still an oversized body rather than a malformed one.
|
||||
for (Throwable cause = ex.getCause(); cause != null; cause = cause.getCause()) {
|
||||
if (cause instanceof MaxUploadSizeExceededException tooLarge) {
|
||||
return handleMaxUploadSizeExceededException(tooLarge, headers, status, request);
|
||||
}
|
||||
}
|
||||
Map<String, Object> details =
|
||||
ex.getCause() != null ? Map.of("cause", ex.getCause().getClass().getSimpleName()) : null;
|
||||
return new ResponseEntity<>(
|
||||
@@ -336,7 +343,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
|
||||
HttpHeaders headers,
|
||||
HttpStatusCode status,
|
||||
WebRequest request) {
|
||||
// An oversized request body classifies as 413 inside the envelope.
|
||||
// An oversized request body — multipart or JSON — classifies as 413 inside the envelope.
|
||||
return new ResponseEntity<>(
|
||||
ErrorResponseFactory.body(
|
||||
OperationalError.PAYLOAD_TOO_LARGE,
|
||||
|
||||
+26
-3
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.inbound.web.mvc.autoconfigure;
|
||||
|
||||
import dev.caskeleton.adapter.inbound.web.error.GlobalExceptionHandler;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.context.WebMvcRequestContextArgumentResolver;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.filter.JsonBodyLimitFilter;
|
||||
import dev.caskeleton.adapter.inbound.web.mvc.filter.WebMvcRequestIdFilter;
|
||||
import dev.caskeleton.shared.tracing.SpanErrorRecorder;
|
||||
import java.util.List;
|
||||
@@ -11,9 +12,11 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import tools.jackson.core.StreamReadFeature;
|
||||
|
||||
/**
|
||||
* Wires the web platform into a servlet application.
|
||||
@@ -22,9 +25,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
* corrected onto: the condition lives here and everything else is imported, so "off" means no beans
|
||||
* rather than beans that happen not to be called.
|
||||
*
|
||||
* <p>Three beans: the {@code Envelope} error handler, the request-id filter, and the argument
|
||||
* resolver that lets a controller declare {@code WebRequestContext}. HTTP errors are the {@code
|
||||
* Envelope} this handler writes; {@code spring.mvc.problemdetails.enabled} stays false.
|
||||
* <p>The {@code Envelope} error handler, the request-id filter, the request-body boundary (JSON
|
||||
* size ceiling and duplicate-key refusal), and the argument resolver that lets a controller declare
|
||||
* {@code WebRequestContext}. HTTP errors are the {@code Envelope} this handler writes; {@code
|
||||
* spring.mvc.problemdetails.enabled} stays false.
|
||||
*
|
||||
* <p>Every bean is {@link ConditionalOnMissingBean}: the platform supplies the one that would
|
||||
* otherwise be missing rather than the one that must be used.
|
||||
@@ -61,6 +65,25 @@ public class WebMvcPlatformAutoConfiguration {
|
||||
org.springframework.core.Ordered.HIGHEST_PRECEDENCE + 10);
|
||||
}
|
||||
|
||||
/** Refuses a JSON body over the configured ceiling before the converter reads it. */
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public JsonBodyLimitFilter jsonBodyLimitFilter(WebMvcPlatformSettings properties) {
|
||||
return new JsonBodyLimitFilter(properties.maxJsonBodySize().toBytes());
|
||||
}
|
||||
|
||||
/**
|
||||
* Rejects a JSON object that names the same key twice.
|
||||
*
|
||||
* <p>Jackson keeps the last value by default, so {@code {"role":"user","role":"admin"}} binds as
|
||||
* admin while a proxy, a validator or a log line that read the first value saw user. Refusing the
|
||||
* document is the only reading every party agrees on.
|
||||
*/
|
||||
@Bean
|
||||
public JsonMapperBuilderCustomizer strictDuplicateJsonKeys() {
|
||||
return builder -> builder.enable(StreamReadFeature.STRICT_DUPLICATE_DETECTION);
|
||||
}
|
||||
|
||||
/** Lets a controller declare the request context instead of the servlet request. */
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(name = "webMvcRequestContextConfigurer")
|
||||
|
||||
+9
-2
@@ -1,6 +1,7 @@
|
||||
package dev.caskeleton.adapter.inbound.web.mvc.autoconfigure;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.unit.DataSize;
|
||||
|
||||
/**
|
||||
* The bound settings of the MVC web platform.
|
||||
@@ -16,19 +17,25 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*
|
||||
* @param enabled whether the platform's MVC wiring is installed at all
|
||||
* @param trustInboundRequestId whether a caller may choose its own request id
|
||||
* @param maxJsonBodySize the largest JSON request body accepted; 1MB when omitted
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "backend.web.mvc")
|
||||
public record WebMvcPlatformSettings(Boolean enabled, Boolean trustInboundRequestId) {
|
||||
public record WebMvcPlatformSettings(
|
||||
Boolean enabled, Boolean trustInboundRequestId, DataSize maxJsonBodySize) {
|
||||
|
||||
public WebMvcPlatformSettings {
|
||||
enabled = enabled == null || enabled;
|
||||
// Defaults to false: a caller that can choose its own request id can make two exchanges share
|
||||
// one identity, which is how a support investigation reads somebody else's request.
|
||||
trustInboundRequestId = trustInboundRequestId != null && trustInboundRequestId;
|
||||
maxJsonBodySize = maxJsonBodySize == null ? DataSize.ofMegabytes(1) : maxJsonBodySize;
|
||||
if (maxJsonBodySize.toBytes() < 1) {
|
||||
throw new IllegalArgumentException("backend.web.mvc.max-json-body-size must be positive");
|
||||
}
|
||||
}
|
||||
|
||||
/** The defaults a deployment that configures nothing runs with. */
|
||||
public static WebMvcPlatformSettings defaults() {
|
||||
return new WebMvcPlatformSettings(null, null);
|
||||
return new WebMvcPlatformSettings(null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
package dev.caskeleton.adapter.inbound.web.mvc.filter;
|
||||
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ReadListener;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
|
||||
/**
|
||||
* Caps a JSON request body before the message converter reads it.
|
||||
*
|
||||
* <p>Nothing else in the servlet stack does: Tomcat bounds form posts and Spring bounds multipart,
|
||||
* but a JSON body is read to the end, and Jackson's own limits (nesting depth 500, number length
|
||||
* 1000) say nothing about length. Two checks, because either alone is bypassable: the declared
|
||||
* {@code Content-Length} is refused without reading a byte, and the stream is counted so a chunked
|
||||
* or understated body fails the read that crosses the ceiling.
|
||||
*
|
||||
* <p>The refusal is {@link MaxUploadSizeExceededException}, which the error handler already answers
|
||||
* as {@code 413 PAYLOAD_TOO_LARGE} in the envelope. Other media types keep their own ceilings
|
||||
* (multipart, form posts, upload protocols) and pass through untouched.
|
||||
*/
|
||||
public final class JsonBodyLimitFilter extends OncePerRequestFilter implements Ordered {
|
||||
|
||||
private final long maxBytes;
|
||||
|
||||
/**
|
||||
* A filter with the given ceiling.
|
||||
*
|
||||
* @param maxBytes the largest JSON body accepted, in bytes
|
||||
*/
|
||||
public JsonBodyLimitFilter(long maxBytes) {
|
||||
if (maxBytes < 1) {
|
||||
throw new IllegalArgumentException("maxBytes must be positive");
|
||||
}
|
||||
this.maxBytes = maxBytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldNotFilter(HttpServletRequest request) {
|
||||
String contentType = request.getContentType();
|
||||
if (contentType == null) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
MediaType type = MediaType.parseMediaType(contentType);
|
||||
return !MediaType.APPLICATION_JSON.isCompatibleWith(type)
|
||||
&& !type.getSubtype().endsWith("+json");
|
||||
} catch (IllegalArgumentException unparseable) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(
|
||||
HttpServletRequest request, HttpServletResponse response, FilterChain chain)
|
||||
throws ServletException, IOException {
|
||||
chain.doFilter(new BoundedBodyRequest(request, maxBytes), response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE + 15;
|
||||
}
|
||||
|
||||
private static final class BoundedBodyRequest extends HttpServletRequestWrapper {
|
||||
|
||||
private final long limit;
|
||||
|
||||
BoundedBodyRequest(HttpServletRequest request, long limit) {
|
||||
super(request);
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletInputStream getInputStream() throws IOException {
|
||||
if (getContentLengthLong() > limit) {
|
||||
throw new MaxUploadSizeExceededException(limit);
|
||||
}
|
||||
return new BoundedInputStream(super.getInputStream(), limit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getReader() throws IOException {
|
||||
String encoding = getCharacterEncoding();
|
||||
Charset charset = encoding == null ? StandardCharsets.UTF_8 : Charset.forName(encoding);
|
||||
return new BufferedReader(new InputStreamReader(getInputStream(), charset));
|
||||
}
|
||||
}
|
||||
|
||||
private static final class BoundedInputStream extends ServletInputStream {
|
||||
|
||||
private final ServletInputStream delegate;
|
||||
private final long limit;
|
||||
private long consumed;
|
||||
|
||||
BoundedInputStream(ServletInputStream delegate, long limit) {
|
||||
this.delegate = delegate;
|
||||
this.limit = limit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
int value = delegate.read();
|
||||
if (value >= 0) {
|
||||
count(1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] buffer, int offset, int length) throws IOException {
|
||||
int read = delegate.read(buffer, offset, length);
|
||||
if (read > 0) {
|
||||
count(read);
|
||||
}
|
||||
return read;
|
||||
}
|
||||
|
||||
private void count(int read) {
|
||||
consumed += read;
|
||||
if (consumed > limit) {
|
||||
throw new MaxUploadSizeExceededException(limit);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return delegate.isFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return delegate.isReady();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener listener) {
|
||||
delegate.setReadListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
delegate.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
interface ClientIpResolver {
|
||||
|
||||
String resolve(HttpServletRequest request);
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
final class ClientIpResolverFactory {
|
||||
|
||||
private ClientIpResolverFactory() {}
|
||||
|
||||
static ClientIpResolver create(RateLimitClientIpMode mode) {
|
||||
return switch (mode) {
|
||||
case REMOTE_ADDR_ONLY -> new RemoteAddrClientIpResolver();
|
||||
case FORWARDED_HEADERS_TRUSTED -> new ForwardedHeaderClientIpResolver();
|
||||
};
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -13,11 +13,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "app.rate-limit")
|
||||
public record EdgeRateLimitTransportSettings(
|
||||
boolean enabled,
|
||||
String defaultPolicyId,
|
||||
Duration callerDeadlineBudget,
|
||||
int hashKeyVersion,
|
||||
RateLimitClientIpMode clientIpMode) {
|
||||
boolean enabled, String defaultPolicyId, Duration callerDeadlineBudget, int hashKeyVersion) {
|
||||
|
||||
private static final Pattern POLICY_ID = Pattern.compile("[a-z][a-z0-9-]{0,62}");
|
||||
|
||||
@@ -27,7 +23,6 @@ public record EdgeRateLimitTransportSettings(
|
||||
callerDeadlineBudget =
|
||||
callerDeadlineBudget == null ? Duration.ofSeconds(2) : callerDeadlineBudget;
|
||||
hashKeyVersion = hashKeyVersion == 0 ? 1 : hashKeyVersion;
|
||||
clientIpMode = clientIpMode == null ? RateLimitClientIpMode.REMOTE_ADDR_ONLY : clientIpMode;
|
||||
if (!POLICY_ID.matcher(defaultPolicyId).matches()) {
|
||||
throw new IllegalArgumentException("defaultPolicyId must be a bounded policy identifier");
|
||||
}
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
final class ForwardedHeaderClientIpResolver implements ClientIpResolver {
|
||||
|
||||
private static final String X_FORWARDED_FOR = "X-Forwarded-For";
|
||||
|
||||
@Override
|
||||
public String resolve(HttpServletRequest request) {
|
||||
String forwarded = request.getHeader(X_FORWARDED_FOR);
|
||||
if (forwarded == null || forwarded.isBlank()) {
|
||||
return request.getRemoteAddr();
|
||||
}
|
||||
String firstHop = forwarded.split(",", 2)[0].trim();
|
||||
return firstHop.isEmpty() ? request.getRemoteAddr() : firstHop;
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
/**
|
||||
* Selects the client-IP source for unauthenticated rate-limit keys. See README for the design
|
||||
* rationale.
|
||||
*/
|
||||
public enum RateLimitClientIpMode {
|
||||
/** Uses {@code remoteAddr} only; ignores forwarded headers. */
|
||||
REMOTE_ADDR_ONLY,
|
||||
|
||||
/** Trusts forwarded headers. */
|
||||
FORWARDED_HEADERS_TRUSTED
|
||||
}
|
||||
+6
-7
@@ -19,17 +19,16 @@ import org.springframework.web.servlet.HandlerMapping;
|
||||
*
|
||||
* <p>The returned raw identity exists only until {@link EdgeSubjectPseudonymizer} runs. It must not
|
||||
* cross the provider port boundary.
|
||||
*
|
||||
* <p>The client IP is {@code getRemoteAddr()} and nothing else. Behind a proxy the container
|
||||
* rewrites it from {@code X-Forwarded-For} only for peers it trusts ({@code
|
||||
* server.forward-headers-strategy=native} with {@code server.tomcat.remoteip.internal-proxies}); a
|
||||
* header read here would be whatever the caller typed.
|
||||
*/
|
||||
public final class RateLimitKeyResolver {
|
||||
|
||||
private static final String SERVICE_ROLE = "service";
|
||||
|
||||
private final ClientIpResolver clientIpResolver;
|
||||
|
||||
public RateLimitKeyResolver(ClientIpResolver clientIpResolver) {
|
||||
this.clientIpResolver = clientIpResolver;
|
||||
}
|
||||
|
||||
public EdgeRateLimitSubject resolve(HttpServletRequest request) {
|
||||
String operationId = operationId(request);
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
@@ -43,7 +42,7 @@ public final class RateLimitKeyResolver {
|
||||
return new EdgeRateLimitSubject(kind, user.idpUserId(), operationId);
|
||||
}
|
||||
return new EdgeRateLimitSubject(
|
||||
EdgeRateLimitSubject.Kind.CLIENT_IP, clientIpResolver.resolve(request), operationId);
|
||||
EdgeRateLimitSubject.Kind.CLIENT_IP, request.getRemoteAddr(), operationId);
|
||||
}
|
||||
|
||||
private static String operationId(HttpServletRequest request) {
|
||||
|
||||
+15
-6
@@ -4,6 +4,7 @@ import dev.caskeleton.application.observability.UserPrincipalPseudonymizerPort;
|
||||
import dev.caskeleton.shared.ratelimit.EdgeRateLimitPort;
|
||||
import java.time.Clock;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -14,9 +15,9 @@ import tools.jackson.databind.ObjectMapper;
|
||||
/**
|
||||
* Wires provider-neutral edge enforcement into MVC.
|
||||
*
|
||||
* <p>Transport activation, trusted client-IP selection, policy selection, and deadlines come from
|
||||
* {@code app.rate-limit}. Provider activation is a separate composition-root decision; an enabled
|
||||
* bridge requires exactly one semantic port and never installs a local fallback.
|
||||
* <p>Transport activation, policy selection, and deadlines come from {@code app.rate-limit}.
|
||||
* Provider activation is a separate composition-root decision; an enabled bridge requires exactly
|
||||
* one semantic port and never installs a local fallback.
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnProperty(prefix = "app.rate-limit", name = "enabled", havingValue = "true")
|
||||
@@ -30,7 +31,16 @@ public class RateLimitWebConfig implements WebMvcConfigurer {
|
||||
ObjectMapper objectMapper,
|
||||
ObjectProvider<Clock> clockProvider,
|
||||
ObjectProvider<EdgeRateLimitPort> portProvider,
|
||||
ObjectProvider<UserPrincipalPseudonymizerPort> pseudonymizerProvider) {
|
||||
ObjectProvider<UserPrincipalPseudonymizerPort> pseudonymizerProvider,
|
||||
@Value("${server.forward-headers-strategy:none}") String forwardHeadersStrategy) {
|
||||
// The unauthenticated key is getRemoteAddr(). `framework` installs ForwardedHeaderFilter, which
|
||||
// rewrites it from X-Forwarded-For for every peer, so any caller picks its own bucket.
|
||||
if ("framework".equalsIgnoreCase(forwardHeadersStrategy.trim())) {
|
||||
throw new IllegalStateException(
|
||||
"server.forward-headers-strategy=framework (APP_SERVER_FORWARD_HEADERS_STRATEGY) lets"
|
||||
+ " any caller choose its rate-limit key through X-Forwarded-For; use native with"
|
||||
+ " server.tomcat.remoteip.internal-proxies naming the proxies to trust");
|
||||
}
|
||||
EdgeRateLimitPort port = requiredUnique(portProvider, "EdgeRateLimitPort");
|
||||
UserPrincipalPseudonymizerPort secretBackedPseudonymizer =
|
||||
requiredUnique(pseudonymizerProvider, "UserPrincipalPseudonymizerPort");
|
||||
@@ -39,8 +49,7 @@ public class RateLimitWebConfig implements WebMvcConfigurer {
|
||||
port,
|
||||
new VersionedEdgeSubjectPseudonymizer(
|
||||
secretBackedPseudonymizer, transportSettings.hashKeyVersion()),
|
||||
new RateLimitKeyResolver(
|
||||
ClientIpResolverFactory.create(transportSettings.clientIpMode())),
|
||||
new RateLimitKeyResolver(),
|
||||
clockProvider.getIfAvailable(Clock::systemUTC),
|
||||
transportSettings.defaultPolicyId(),
|
||||
transportSettings.callerDeadlineBudget(),
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
final class RemoteAddrClientIpResolver implements ClientIpResolver {
|
||||
|
||||
@Override
|
||||
public String resolve(HttpServletRequest request) {
|
||||
return request.getRemoteAddr();
|
||||
}
|
||||
}
|
||||
+39
@@ -1,6 +1,8 @@
|
||||
package dev.caskeleton.adapter.inbound.web.settings;
|
||||
|
||||
import jakarta.validation.constraints.PositiveOrZero;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -39,6 +41,7 @@ public record CorsSettings(
|
||||
allowedOrigins = List.of();
|
||||
} else {
|
||||
allowedOrigins = List.copyOf(allowedOrigins);
|
||||
allowedOrigins.forEach(CorsSettings::requireExactOrigin);
|
||||
}
|
||||
if (allowedMethods == null || allowedMethods.isEmpty()) {
|
||||
allowedMethods = List.of("GET", "POST", "PATCH", "PUT", "DELETE", "OPTIONS");
|
||||
@@ -51,4 +54,40 @@ public record CorsSettings(
|
||||
allowedHeaders = List.copyOf(allowedHeaders);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An origin is {@code scheme://host[:port]} and nothing else. A browser sends exactly that, so a
|
||||
* trailing slash, a path, a wildcard host or the literal {@code null} origin (sandboxed frames,
|
||||
* {@code file:} pages) either never matches or matches far more than intended — and neither shows
|
||||
* up in a test of the API itself. {@code *} alone stays allowed; credentials already exclude it.
|
||||
*/
|
||||
private static void requireExactOrigin(String origin) {
|
||||
if ("*".equals(origin)) {
|
||||
return;
|
||||
}
|
||||
URI uri;
|
||||
try {
|
||||
uri = new URI(origin);
|
||||
} catch (URISyntaxException malformed) {
|
||||
throw notAnOrigin(origin);
|
||||
}
|
||||
boolean exact =
|
||||
("http".equals(uri.getScheme()) || "https".equals(uri.getScheme()))
|
||||
&& uri.getHost() != null
|
||||
&& uri.getRawUserInfo() == null
|
||||
&& uri.getRawPath().isEmpty()
|
||||
&& uri.getRawQuery() == null
|
||||
&& uri.getRawFragment() == null;
|
||||
if (!exact) {
|
||||
throw notAnOrigin(origin);
|
||||
}
|
||||
}
|
||||
|
||||
private static IllegalArgumentException notAnOrigin(String origin) {
|
||||
return new IllegalArgumentException(
|
||||
"APP_SECURITY_CORS_ORIGINS (ca-skeleton.cors.allowed-origins) entry \""
|
||||
+ origin
|
||||
+ "\" must be exactly scheme://host[:port] with http or https: no path, trailing"
|
||||
+ " slash, query, fragment, user info, wildcard host or \"null\"");
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -34,6 +34,8 @@ import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.mock.http.MockHttpInputMessage;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
@@ -43,6 +45,7 @@ import org.springframework.validation.FieldError;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.context.request.ServletWebRequest;
|
||||
import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
||||
|
||||
class GlobalExceptionHandlerTest {
|
||||
@@ -195,6 +198,27 @@ class GlobalExceptionHandlerTest {
|
||||
.doesNotContain(secret, "rejectedValue", "rejected interpolated value", "[7]");
|
||||
}
|
||||
|
||||
@Test
|
||||
void unreadableBodyCausedByTheSizeCeilingIsPayloadTooLarge() {
|
||||
// given: the parser wraps the ceiling's exception when it fires inside a bean property
|
||||
HttpMessageNotReadableException unreadable =
|
||||
new HttpMessageNotReadableException(
|
||||
"JSON parse error",
|
||||
new IllegalStateException(new MaxUploadSizeExceededException(64)),
|
||||
new MockHttpInputMessage(new byte[0]));
|
||||
|
||||
// when
|
||||
ResponseEntity<Object> response =
|
||||
handler.handleHttpMessageNotReadable(
|
||||
unreadable,
|
||||
new HttpHeaders(),
|
||||
HttpStatus.BAD_REQUEST,
|
||||
new ServletWebRequest(new MockHttpServletRequest()));
|
||||
|
||||
// then
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.CONTENT_TOO_LARGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void constraintValidationUsesFixedReasonAndStripsRequestControlledMapKey() {
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package dev.caskeleton.adapter.inbound.web.mvc.autoconfigure;
|
||||
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.ResultActions;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* The request boundary the platform auto-configuration puts in front of every JSON body: a size
|
||||
* ceiling and a parser that refuses duplicate keys, both answered as the error envelope.
|
||||
*/
|
||||
@WebMvcTest(
|
||||
controllers = RequestBodyBoundaryTest.Probe.class,
|
||||
excludeAutoConfiguration = SecurityAutoConfiguration.class)
|
||||
@ImportAutoConfiguration(WebMvcPlatformAutoConfiguration.class)
|
||||
@Import(RequestBodyBoundaryTest.Probe.class)
|
||||
@TestPropertySource(properties = "backend.web.mvc.max-json-body-size=64B")
|
||||
class RequestBodyBoundaryTest {
|
||||
|
||||
@Autowired MockMvc mvc;
|
||||
|
||||
@Test
|
||||
void duplicateJsonKeyIsRejectedAsValidationFailure() throws Exception {
|
||||
// when
|
||||
ResultActions result = send("{\"role\":\"user\",\"role\":\"admin\"}");
|
||||
|
||||
// then
|
||||
result
|
||||
.andExpect(status().isBadRequest())
|
||||
.andExpect(jsonPath("$.error.code").value("VALIDATION_FAILED"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jsonBodyOverTheCeilingIsRejectedAsPayloadTooLarge() throws Exception {
|
||||
// when
|
||||
ResultActions result = send("{\"note\":\"" + "x".repeat(100) + "\"}");
|
||||
|
||||
// then
|
||||
result
|
||||
.andExpect(status().is(413))
|
||||
.andExpect(jsonPath("$.error.code").value("PAYLOAD_TOO_LARGE"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void jsonBodyWithinTheCeilingReachesTheController() throws Exception {
|
||||
// when
|
||||
ResultActions result = send("{\"note\":\"ok\"}");
|
||||
|
||||
// then
|
||||
result.andExpect(status().isOk()).andExpect(jsonPath("$.note").value("ok"));
|
||||
}
|
||||
|
||||
private ResultActions send(String json) throws Exception {
|
||||
return mvc.perform(post("/probe").contentType(MediaType.APPLICATION_JSON).content(json));
|
||||
}
|
||||
|
||||
@RestController
|
||||
static class Probe {
|
||||
@PostMapping("/probe")
|
||||
Map<String, Object> echo(@RequestBody Map<String, Object> body) {
|
||||
return body;
|
||||
}
|
||||
}
|
||||
|
||||
@SpringBootConfiguration
|
||||
@EnableAutoConfiguration(exclude = SecurityAutoConfiguration.class)
|
||||
static class TestBootstrap {}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package dev.caskeleton.adapter.inbound.web.mvc.filter;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import jakarta.servlet.FilterChain;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||
|
||||
class JsonBodyLimitFilterTest {
|
||||
|
||||
private final JsonBodyLimitFilter filter = new JsonBodyLimitFilter(16);
|
||||
|
||||
@Test
|
||||
void undeclaredJsonBodyFailsTheReadThatCrossesTheCeiling() {
|
||||
// given: a chunked body carries no Content-Length
|
||||
MockHttpServletRequest request =
|
||||
new MockHttpServletRequest("POST", "/probe") {
|
||||
@Override
|
||||
public long getContentLengthLong() {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
request.setContentType("application/json");
|
||||
request.setContent(new byte[64]);
|
||||
FilterChain readsEverything = (req, res) -> req.getInputStream().readAllBytes();
|
||||
|
||||
// when
|
||||
Throwable thrown =
|
||||
catchThrowable(
|
||||
() -> filter.doFilter(request, new MockHttpServletResponse(), readsEverything));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(MaxUploadSizeExceededException.class)
|
||||
.hasMessageContaining("16");
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonJsonBodyReachesTheChainUnwrapped() throws Exception {
|
||||
// given
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("PATCH", "/upload");
|
||||
request.setContentType("application/offset+octet-stream");
|
||||
request.setContent(new byte[64]);
|
||||
AtomicReference<Object> seen = new AtomicReference<>();
|
||||
|
||||
// when
|
||||
filter.doFilter(request, new MockHttpServletResponse(), (req, res) -> seen.set(req));
|
||||
|
||||
// then
|
||||
assertThat(seen.get()).isSameAs(request);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -57,7 +57,7 @@ class EdgeRateLimitTransportBridgeTest {
|
||||
capture.rawSubject = subject;
|
||||
return new RateLimitSubjectDigest(DIGEST);
|
||||
},
|
||||
new RateLimitKeyResolver(new RemoteAddrClientIpResolver()),
|
||||
new RateLimitKeyResolver(),
|
||||
CLOCK,
|
||||
"api-default",
|
||||
Duration.ofMillis(750),
|
||||
|
||||
+4
-6
@@ -11,13 +11,12 @@ class EdgeRateLimitTransportSettingsTest {
|
||||
@Test
|
||||
void defaultsPolicyAndCallerBudgetWithoutSelectingALocalProvider() {
|
||||
EdgeRateLimitTransportSettings settings =
|
||||
new EdgeRateLimitTransportSettings(true, null, null, 0, null);
|
||||
new EdgeRateLimitTransportSettings(true, null, null, 0);
|
||||
|
||||
assertThat(settings.enabled()).isTrue();
|
||||
assertThat(settings.defaultPolicyId()).isEqualTo("api-default");
|
||||
assertThat(settings.callerDeadlineBudget()).isEqualTo(Duration.ofSeconds(2));
|
||||
assertThat(settings.hashKeyVersion()).isEqualTo(1);
|
||||
assertThat(settings.clientIpMode()).isEqualTo(RateLimitClientIpMode.REMOTE_ADDR_ONLY);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -25,19 +24,18 @@ class EdgeRateLimitTransportSettingsTest {
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
new EdgeRateLimitTransportSettings(
|
||||
true, "INVALID POLICY", Duration.ofSeconds(1), 1, null))
|
||||
true, "INVALID POLICY", Duration.ofSeconds(1), 1))
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("defaultPolicyId");
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
new EdgeRateLimitTransportSettings(
|
||||
true, "api-default", Duration.ofSeconds(31), 1, null))
|
||||
new EdgeRateLimitTransportSettings(true, "api-default", Duration.ofSeconds(31), 1))
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("callerDeadlineBudget");
|
||||
assertThatThrownBy(
|
||||
() ->
|
||||
new EdgeRateLimitTransportSettings(
|
||||
true, "api-default", Duration.ofSeconds(1), 10_000, null))
|
||||
true, "api-default", Duration.ofSeconds(1), 10_000))
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("hashKeyVersion");
|
||||
}
|
||||
|
||||
+3
-7
@@ -106,7 +106,7 @@ class RateLimitInterceptorTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void disabledModeHasNoProviderPseudonymizerOrResolverSideEffects() throws Exception {
|
||||
void disabledModeHasNoProviderOrPseudonymizerSideEffects() throws Exception {
|
||||
AtomicInteger calls = new AtomicInteger();
|
||||
EdgeRateLimitPort port =
|
||||
request -> {
|
||||
@@ -122,11 +122,7 @@ class RateLimitInterceptorTest {
|
||||
new EdgeRateLimitTransportBridge(
|
||||
port,
|
||||
pseudonymizer,
|
||||
new RateLimitKeyResolver(
|
||||
request -> {
|
||||
calls.incrementAndGet();
|
||||
return request.getRemoteAddr();
|
||||
}),
|
||||
new RateLimitKeyResolver(),
|
||||
CLOCK,
|
||||
"api-default",
|
||||
Duration.ofSeconds(1),
|
||||
@@ -146,7 +142,7 @@ class RateLimitInterceptorTest {
|
||||
new EdgeRateLimitTransportBridge(
|
||||
request -> outcome,
|
||||
subject -> new RateLimitSubjectDigest(SUBJECT_DIGEST),
|
||||
new RateLimitKeyResolver(new RemoteAddrClientIpResolver()),
|
||||
new RateLimitKeyResolver(),
|
||||
CLOCK,
|
||||
"api-default",
|
||||
Duration.ofSeconds(1),
|
||||
|
||||
+7
-25
@@ -14,8 +14,7 @@ import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
class RateLimitKeyResolverTest {
|
||||
|
||||
private final RateLimitKeyResolver resolver =
|
||||
new RateLimitKeyResolver(new RemoteAddrClientIpResolver());
|
||||
private final RateLimitKeyResolver resolver = new RateLimitKeyResolver();
|
||||
|
||||
@AfterEach
|
||||
void clearContext() {
|
||||
@@ -67,33 +66,16 @@ class RateLimitKeyResolverTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void remoteAddrModeIgnoresForwardedClientIpWhenPresent() {
|
||||
void clientIpIgnoresForwardedForAndUsesTheRemoteAddress() {
|
||||
// given
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/v1/ping");
|
||||
req.setRemoteAddr("10.0.0.1");
|
||||
req.addHeader("X-Forwarded-For", "203.0.113.9, 10.0.0.1");
|
||||
|
||||
assertThat(resolver.resolve(req).canonicalIdentity()).isEqualTo("10.0.0.1");
|
||||
}
|
||||
// when
|
||||
String identity = resolver.resolve(req).canonicalIdentity();
|
||||
|
||||
@Test
|
||||
void forwardedHeadersTrustedModeUsesFirstForwardedClientIp() {
|
||||
RateLimitKeyResolver forwardedResolver =
|
||||
new RateLimitKeyResolver(new ForwardedHeaderClientIpResolver());
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/v1/ping");
|
||||
req.setRemoteAddr("10.0.0.1");
|
||||
req.addHeader("X-Forwarded-For", "203.0.113.9, 10.0.0.1");
|
||||
|
||||
assertThat(forwardedResolver.resolve(req).canonicalIdentity()).isEqualTo("203.0.113.9");
|
||||
}
|
||||
|
||||
@Test
|
||||
void forwardedHeadersTrustedModeFallsBackToRemoteAddrWhenHeaderIsBlank() {
|
||||
RateLimitKeyResolver forwardedResolver =
|
||||
new RateLimitKeyResolver(new ForwardedHeaderClientIpResolver());
|
||||
MockHttpServletRequest req = new MockHttpServletRequest("GET", "/v1/ping");
|
||||
req.setRemoteAddr("198.51.100.4");
|
||||
req.addHeader("X-Forwarded-For", " ");
|
||||
|
||||
assertThat(forwardedResolver.resolve(req).canonicalIdentity()).isEqualTo("198.51.100.4");
|
||||
// then
|
||||
assertThat(identity).isEqualTo("10.0.0.1");
|
||||
}
|
||||
}
|
||||
|
||||
+98
@@ -2,14 +2,45 @@ package dev.caskeleton.adapter.inbound.web.ratelimit;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.application.observability.UserPrincipalPseudonymizerPort;
|
||||
import dev.caskeleton.shared.ratelimit.EdgeRateLimitPort;
|
||||
import dev.caskeleton.shared.ratelimit.RateLimitDecision;
|
||||
import dev.caskeleton.shared.ratelimit.RateLimitOutcome;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
|
||||
class RateLimitWebConfigTest {
|
||||
|
||||
private static final String PEER = "203.0.113.7";
|
||||
|
||||
private final List<String> pseudonymized = new ArrayList<>();
|
||||
|
||||
private final WebApplicationContextRunner runner =
|
||||
new WebApplicationContextRunner().withUserConfiguration(RateLimitWebConfig.class);
|
||||
|
||||
private final WebApplicationContextRunner enabled =
|
||||
runner
|
||||
.withPropertyValues("app.rate-limit.enabled=true")
|
||||
.withBean(ObjectMapper.class, ObjectMapper::new)
|
||||
.withBean(EdgeRateLimitPort.class, () -> request -> allowed())
|
||||
.withBean(
|
||||
UserPrincipalPseudonymizerPort.class,
|
||||
() ->
|
||||
raw -> {
|
||||
pseudonymized.add(raw);
|
||||
return "a".repeat(64);
|
||||
});
|
||||
|
||||
@Test
|
||||
void disabledCapabilityRegistersNoInterceptorConfiguration() {
|
||||
runner.run(
|
||||
@@ -19,4 +50,71 @@ class RateLimitWebConfigTest {
|
||||
.doesNotHaveBean(RateLimitWebConfig.class)
|
||||
.doesNotHaveBean(RateLimitInterceptor.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void spoofedForwardedForDoesNotChangeTheUnauthenticatedKey() {
|
||||
// given: the forwarded-header opt-in an older deployment may still carry
|
||||
enabled
|
||||
.withPropertyValues("app.rate-limit.client-ip-mode=forwarded-headers-trusted")
|
||||
.run(
|
||||
context -> {
|
||||
HandlerInterceptor interceptor =
|
||||
interceptorOf(context.getBean(RateLimitWebConfig.class));
|
||||
|
||||
// when
|
||||
for (String spoofed : List.of("198.51.100.1", "198.51.100.2")) {
|
||||
interceptor.preHandle(
|
||||
unauthenticated(spoofed), new MockHttpServletResponse(), new Object());
|
||||
}
|
||||
|
||||
// then
|
||||
String peerKey = "9:CLIENT_IP|11:" + PEER + "|12:GET /v1/ping";
|
||||
assertThat(pseudonymized).containsExactly(peerKey, peerKey);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void frameworkForwardHeadersStrategyIsRefusedWhileRateLimiting() {
|
||||
enabled
|
||||
.withPropertyValues("server.forward-headers-strategy=framework")
|
||||
.run(
|
||||
context ->
|
||||
assertThat(context)
|
||||
.hasFailed()
|
||||
.getFailure()
|
||||
.hasStackTraceContaining("server.forward-headers-strategy=framework"));
|
||||
}
|
||||
|
||||
private static HandlerInterceptor interceptorOf(RateLimitWebConfig config) {
|
||||
var registry =
|
||||
new InterceptorRegistry() {
|
||||
List<Object> registered() {
|
||||
return getInterceptors();
|
||||
}
|
||||
};
|
||||
config.addInterceptors(registry);
|
||||
return (HandlerInterceptor) registry.registered().getFirst();
|
||||
}
|
||||
|
||||
private static MockHttpServletRequest unauthenticated(String forwardedFor) {
|
||||
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/v1/ping");
|
||||
request.setRemoteAddr(PEER);
|
||||
request.addHeader("X-Forwarded-For", forwardedFor);
|
||||
request.setAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE, "/v1/ping");
|
||||
return request;
|
||||
}
|
||||
|
||||
private static RateLimitOutcome allowed() {
|
||||
return new RateLimitOutcome.Evaluated(
|
||||
new RateLimitDecision(
|
||||
true,
|
||||
10,
|
||||
9,
|
||||
Duration.ZERO,
|
||||
Instant.parse("2026-09-25T00:00:01Z"),
|
||||
"api-default",
|
||||
"v1",
|
||||
RateLimitDecision.DecisionSource.GLOBAL_SHARED_STORE,
|
||||
RateLimitDecision.DecisionCertainty.CERTAIN));
|
||||
}
|
||||
}
|
||||
|
||||
+38
@@ -1,10 +1,13 @@
|
||||
package dev.caskeleton.adapter.inbound.web.settings;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
@@ -117,6 +120,41 @@ class CorsSettingsTest {
|
||||
});
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(
|
||||
strings = {
|
||||
"https://app.example.com/",
|
||||
"https://app.example.com/path",
|
||||
"https://app.example.com?x=1",
|
||||
"https://app.example.com#top",
|
||||
"https://user@app.example.com",
|
||||
"https://*.example.com",
|
||||
"ftp://app.example.com",
|
||||
"app.example.com",
|
||||
"null",
|
||||
" "
|
||||
})
|
||||
void originThatIsNotExactlySchemeHostPortFailsWithTheEnvKeyName(String origin) {
|
||||
// when
|
||||
Throwable thrown =
|
||||
catchThrowable(() -> new CorsSettings(true, List.of(origin), null, null, false, 0));
|
||||
|
||||
// then
|
||||
assertThat(thrown)
|
||||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.hasMessageContaining("APP_SECURITY_CORS_ORIGINS");
|
||||
}
|
||||
|
||||
@Test
|
||||
void exactOriginWithPortIsAccepted() {
|
||||
// when
|
||||
CorsSettings settings =
|
||||
new CorsSettings(true, List.of("https://app.example.com:8443"), null, null, true, 0);
|
||||
|
||||
// then
|
||||
assertThat(settings.allowedOrigins()).containsExactly("https://app.example.com:8443");
|
||||
}
|
||||
|
||||
@Test
|
||||
void collectionSettingsAreSnapshotsAndImmutable() {
|
||||
List<String> origins = new ArrayList<>(List.of("https://example.test"));
|
||||
|
||||
@@ -62,6 +62,7 @@ values matter only in a composition that adopts it.
|
||||
| `app.websocket.endpoint` | `APP_WEBSOCKET_ENDPOINT` | `/ws` |
|
||||
| `app.websocket.allowed-origins` | `APP_WEBSOCKET_ALLOWED_ORIGINS` | `http://localhost:3000`; explicit origins only |
|
||||
| `app.websocket.broadcast-destination` | `APP_WEBSOCKET_BROADCAST_DESTINATION` | `/topic/events` |
|
||||
| `app.websocket.channel-queue-capacity` | `APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY` | `10000`; messages each STOMP client channel (inbound, outbound) queues before rejecting |
|
||||
|
||||
`WebSocketSettings` is `@Validated`. Invalid enabled settings fail context startup.
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ runtimeOnly project(':adapter:inbound:websocket') // WebSocket (STOMP push)
|
||||
| `APP_WEBSOCKET_ENDPOINT` | `/ws` | handshake 경로 |
|
||||
| `APP_WEBSOCKET_ALLOWED_ORIGINS` | `http://localhost:3000` | 쉼표 구분 origin 목록. wildcard 금지 |
|
||||
| `APP_WEBSOCKET_BROADCAST_DESTINATION` | `/topic/events` | 서버 push 대상. `/topic/` 아래 경로 하나 |
|
||||
| `APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY` | `10000` | STOMP 인바운드·아웃바운드 채널 executor 큐 상한. 가득 차면 메시지를 거부한다(스레드 수는 CPU×2 고정) |
|
||||
|
||||
켠 상태에서 값이 잘못되면(wildcard origin, 정규화되지 않은 경로) 기동이 실패한다.
|
||||
|
||||
|
||||
+22
-1
@@ -41,6 +41,8 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
|
||||
matchIfMissing = true)
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
private static final int CHANNEL_THREADS = Runtime.getRuntime().availableProcessors() * 2;
|
||||
|
||||
private final WebSocketSettings properties;
|
||||
private final AuthenticatedHandshakeInterceptor handshakeInterceptor =
|
||||
new AuthenticatedHandshakeInterceptor();
|
||||
@@ -65,7 +67,26 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureClientInboundChannel(ChannelRegistration registration) {
|
||||
registration.interceptors(inboundAuthorization);
|
||||
bounded(registration).interceptors(inboundAuthorization);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureClientOutboundChannel(ChannelRegistration registration) {
|
||||
bounded(registration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Spring's channel executor defaults to an {@code Integer.MAX_VALUE} queue and pool, so a slow
|
||||
* consumer grows the heap without limit. Here the pool keeps Spring's core size and the queue is
|
||||
* {@code app.websocket.channel-queue-capacity}; a full queue rejects the message instead.
|
||||
*/
|
||||
private ChannelRegistration bounded(ChannelRegistration registration) {
|
||||
registration
|
||||
.taskExecutor()
|
||||
.corePoolSize(CHANNEL_THREADS)
|
||||
.maxPoolSize(CHANNEL_THREADS)
|
||||
.queueCapacity(properties.getChannelQueueCapacity());
|
||||
return registration;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
@@ -1,6 +1,7 @@
|
||||
package dev.caskeleton.adapter.inbound.websocket.stomp;
|
||||
|
||||
import jakarta.validation.constraints.AssertTrue;
|
||||
import jakarta.validation.constraints.Positive;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Arrays;
|
||||
@@ -27,6 +28,9 @@ public class WebSocketSettings {
|
||||
/** Destination that domain-event notifications are broadcast to. */
|
||||
private String broadcastDestination = "/topic/events";
|
||||
|
||||
/** Messages each STOMP client channel (inbound, outbound) may queue before rejecting. */
|
||||
@Positive private int channelQueueCapacity = 10_000;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
@@ -59,6 +63,14 @@ public class WebSocketSettings {
|
||||
this.broadcastDestination = broadcastDestination;
|
||||
}
|
||||
|
||||
public int getChannelQueueCapacity() {
|
||||
return channelQueueCapacity;
|
||||
}
|
||||
|
||||
public void setChannelQueueCapacity(int channelQueueCapacity) {
|
||||
this.channelQueueCapacity = channelQueueCapacity;
|
||||
}
|
||||
|
||||
/** Split the comma-separated {@link #allowedOrigins} into patterns for the handshake registry. */
|
||||
public String[] allowedOriginPatterns() {
|
||||
return Arrays.stream(allowedOrigins.split(",", -1)).map(String::trim).toArray(String[]::new);
|
||||
|
||||
+23
@@ -1,13 +1,16 @@
|
||||
package dev.caskeleton.adapter.inbound.websocket.stomp;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.tuple;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
/** The STOMP channel reaches an application through this module's own auto-configuration entry. */
|
||||
class WebSocketAutoConfigurationTest {
|
||||
@@ -38,6 +41,26 @@ class WebSocketAutoConfigurationTest {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void clientChannelExecutorsAreBoundedByTheConfiguredQueueCapacity() {
|
||||
// given
|
||||
WebApplicationContextRunner configured =
|
||||
runner.withPropertyValues("app.websocket.channel-queue-capacity=64");
|
||||
|
||||
// when
|
||||
configured.run(
|
||||
context -> {
|
||||
// then
|
||||
assertThat(
|
||||
Stream.of("clientInboundChannelExecutor", "clientOutboundChannelExecutor")
|
||||
.map(name -> context.getBean(name, ThreadPoolTaskExecutor.class)))
|
||||
.extracting(
|
||||
ThreadPoolTaskExecutor::getQueueCapacity,
|
||||
executor -> executor.getMaxPoolSize() == executor.getCorePoolSize())
|
||||
.containsExactly(tuple(64, true), tuple(64, true));
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void switchedOffHoldsNothing() {
|
||||
runner
|
||||
|
||||
+5
-3
@@ -24,7 +24,8 @@ class WebSocketEnvironmentBindingTest {
|
||||
"APP_WEBSOCKET_ENABLED", "true",
|
||||
"APP_WEBSOCKET_ENDPOINT", "/live/ws",
|
||||
"APP_WEBSOCKET_ALLOWED_ORIGINS", "https://client.example",
|
||||
"APP_WEBSOCKET_BROADCAST_DESTINATION", "/topic/live")));
|
||||
"APP_WEBSOCKET_BROADCAST_DESTINATION", "/topic/live",
|
||||
"APP_WEBSOCKET_CHANNEL_QUEUE_CAPACITY", "512")));
|
||||
|
||||
// when
|
||||
WebSocketSettings stomp =
|
||||
@@ -38,7 +39,8 @@ class WebSocketEnvironmentBindingTest {
|
||||
WebSocketSettings::isEnabled,
|
||||
WebSocketSettings::getEndpoint,
|
||||
WebSocketSettings::getAllowedOrigins,
|
||||
WebSocketSettings::getBroadcastDestination)
|
||||
.containsExactly(true, "/live/ws", "https://client.example", "/topic/live");
|
||||
WebSocketSettings::getBroadcastDestination,
|
||||
WebSocketSettings::getChannelQueueCapacity)
|
||||
.containsExactly(true, "/live/ws", "https://client.example", "/topic/live", 512);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -57,7 +57,8 @@ class WebSocketSettingsTest {
|
||||
"app.websocket.endpoint=/ws?token=raw",
|
||||
"app.websocket.broadcast-destination=/queue/events",
|
||||
"app.websocket.broadcast-destination=/topic/",
|
||||
"app.websocket.broadcast-destination=/topic/events?raw=true"
|
||||
"app.websocket.broadcast-destination=/topic/events?raw=true",
|
||||
"app.websocket.channel-queue-capacity=0"
|
||||
})
|
||||
void enabledUnsafeSettingFailsBinding(String invalidSetting) {
|
||||
runner
|
||||
|
||||
@@ -119,7 +119,7 @@ of `RedisCommandGateway`. R1/R2 promotion requires a separate real Redis service
|
||||
be silently skipped when selected.
|
||||
|
||||
`redisTopologyTest` is the only real-server lane, declared through `ca.redis-topology-lane`. This
|
||||
leaf declares `standalone` and `cluster` (`LiveRedisSemanticPortsTest`); `redis-runtime` and
|
||||
leaf declares `standalone` and `cluster` (`LiveRedisSemanticPortsTest`, `LiveRedisSemanticScriptAclProbeTest`); `redis-runtime` and
|
||||
`redis-sdk` declare their own lanes for their own classes. It is opt-in and fail-closed: the mode
|
||||
must be one of `standalone`, `sentinel`, `cluster`, `tls` and one this leaf declares; the endpoint
|
||||
properties must be present (`sentinel` additionally needs `redis.topology.master`, `tls` needs
|
||||
|
||||
@@ -49,6 +49,6 @@ dependencies {
|
||||
// validation, tag selection, TLS mapping and no-skip enforcement. The leaf names the classes each
|
||||
// of its lanes exists to run. Sentinel and TLS are qualified by redis-runtime and redis-sdk.
|
||||
redisTopologyLane {
|
||||
requiredClasses 'standalone', 'LiveRedisSemanticPortsTest'
|
||||
requiredClasses 'cluster', 'LiveRedisSemanticPortsTest'
|
||||
requiredClasses 'standalone', 'LiveRedisSemanticPortsTest', 'LiveRedisSemanticScriptAclProbeTest'
|
||||
requiredClasses 'cluster', 'LiveRedisSemanticPortsTest', 'LiveRedisSemanticScriptAclProbeTest'
|
||||
}
|
||||
|
||||
+17
-4
@@ -14,10 +14,22 @@ import org.springframework.beans.factory.SmartInitializingSingleton;
|
||||
/**
|
||||
* Fails startup when a selected semantic capability needs the SCRIPT lane but its effective Redis
|
||||
* account cannot actually execute registered programs.
|
||||
*
|
||||
* <p>Redis checks the commands inside a script against the caller's ACL only when they run, so a
|
||||
* probe that loads and runs {@code return {1}} proves {@code SCRIPT LOAD}/{@code EVALSHA} and
|
||||
* nothing about the commands the semantic scripts call. {@code TIME} belongs to no data category
|
||||
* ({@code @read}/{@code @write}), so an account granted by category alone lacked it and every
|
||||
* rate-limit and idempotency request failed with {@code NOPERM} after a clean start. The probe runs
|
||||
* the commands the scripts depend on.
|
||||
*/
|
||||
final class RedisSemanticScriptAclProbe implements SmartInitializingSingleton {
|
||||
|
||||
private static final byte[] PROBE_SCRIPT = "return {1}".getBytes(StandardCharsets.UTF_8);
|
||||
private static final byte[] PROBE_SCRIPT =
|
||||
"""
|
||||
redis.call('TIME')
|
||||
return {1}
|
||||
"""
|
||||
.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
private final RedisRuntimeOwner owner;
|
||||
private final RedisCapabilitySettings capabilities;
|
||||
@@ -66,9 +78,10 @@ final class RedisSemanticScriptAclProbe implements SmartInitializingSingleton {
|
||||
"Redis SCRIPT ACL probe was interrupted", interrupted);
|
||||
} catch (Exception failure) {
|
||||
throw new CapabilityStartupValidationException(
|
||||
"Redis semantic SCRIPT capability is selected but SCRIPT LOAD/EVALSHA is unavailable; "
|
||||
+ "configure the ADVANCED Redis credential role or grant the effective account the "
|
||||
+ "required script permissions",
|
||||
"Redis semantic SCRIPT capability is selected but SCRIPT LOAD/EVALSHA is unavailable "
|
||||
+ "or the account is denied a command the scripts call (TIME); configure the "
|
||||
+ "ADVANCED Redis credential role or grant the effective account the required "
|
||||
+ "script permissions",
|
||||
failure);
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -18,8 +18,6 @@ app:
|
||||
default-policy-id: ${APP_RATE_LIMIT_DEFAULT_POLICY_ID:api-default}
|
||||
hash-key-version: ${APP_RATE_LIMIT_HASH_KEY_VERSION:1}
|
||||
caller-deadline-budget: 2s
|
||||
# remote-addr-only | forwarded-headers-trusted (trusted ingress only)
|
||||
client-ip-mode: ${APP_RATE_LIMIT_CLIENT_IP_MODE:remote-addr-only}
|
||||
|
||||
ca-skeleton:
|
||||
capabilities:
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package dev.caskeleton.adapter.outbound.cache.redis;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.RedisTopologyEndpoint;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisNamespace;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.config.RedisCredentialResolver.RedisCredentials;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.config.RedisSdkSettings;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisConnectionKind;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisCredentialRole;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisRuntimeOwner;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisTopologyClientFactory;
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Builds, against the topology lane's endpoint, the runtime the composition root builds: one
|
||||
* namespace from {@code app.redis.namespace}, the application account for data and — when asked —
|
||||
* the advanced account for the script lane.
|
||||
*/
|
||||
public final class LiveRedisRuntime {
|
||||
|
||||
private LiveRedisRuntime() {}
|
||||
|
||||
/**
|
||||
* Opens a runtime owner the caller must close.
|
||||
*
|
||||
* @param namespace the deployment namespace
|
||||
* @param separateScriptAccount whether the script lane gets the advanced account of its own
|
||||
* @return the owner
|
||||
*/
|
||||
public static RedisRuntimeOwner open(RedisNamespace namespace, boolean separateScriptAccount) {
|
||||
RedisTopologyEndpoint endpoint = RedisTopologyEndpoint.fromSystemProperties();
|
||||
RedisSdkSettings settings = new RedisSdkSettings();
|
||||
settings.setEnabled(true);
|
||||
settings.setMode(endpoint.mode());
|
||||
settings.setNodes(new ArrayList<>(List.of(endpoint.host() + ":" + endpoint.port())));
|
||||
settings.getNamespace().setEnvironment(namespace.environment());
|
||||
settings.getNamespace().setService(namespace.service());
|
||||
settings.getNamespace().setDomain(namespace.domain());
|
||||
|
||||
Map<RedisCredentialRole, RedisCredentials> accounts = new EnumMap<>(RedisCredentialRole.class);
|
||||
accounts.put(
|
||||
RedisCredentialRole.APPLICATION,
|
||||
new RedisCredentials(
|
||||
endpoint.username(),
|
||||
endpoint.password().isBlank() ? "fixture-application" : endpoint.password()));
|
||||
if (separateScriptAccount) {
|
||||
accounts.put(
|
||||
RedisCredentialRole.ADVANCED,
|
||||
new RedisCredentials("ca-skeleton-application-advanced", "fixture-advanced"));
|
||||
}
|
||||
Map<RedisConnectionKind, Integer> limits = new EnumMap<>(RedisConnectionKind.class);
|
||||
for (RedisConnectionKind kind : RedisConnectionKind.values()) {
|
||||
limits.put(kind, 4);
|
||||
}
|
||||
return new RedisRuntimeOwner(
|
||||
new RedisTopologyClientFactory(
|
||||
settings,
|
||||
accounts,
|
||||
Optional.empty(),
|
||||
location -> {
|
||||
throw new IOException("this lane configures no TLS material");
|
||||
})
|
||||
.create(),
|
||||
limits,
|
||||
Duration.ofSeconds(2),
|
||||
Duration.ofSeconds(2));
|
||||
}
|
||||
}
|
||||
+1
-46
@@ -13,12 +13,7 @@ import dev.caskeleton.adapter.outbound.cache.redis.ratelimit.RedisEdgeRateLimitA
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.RedisTopologyEndpoint;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.RedisDeploymentMode;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisNamespace;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.config.RedisCredentialResolver.RedisCredentials;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.config.RedisSdkSettings;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisConnectionKind;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisCredentialRole;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisRuntimeOwner;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisTopologyClientFactory;
|
||||
import dev.caskeleton.application.cache.CacheLookup;
|
||||
import dev.caskeleton.application.cache.CacheRecordIntent;
|
||||
import dev.caskeleton.application.cache.CacheRecordMetadata;
|
||||
@@ -42,9 +37,7 @@ import dev.caskeleton.shared.ratelimit.RateParameters;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Clock;
|
||||
import java.time.Duration;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
@@ -90,48 +83,10 @@ class LiveRedisSemanticPortsTest {
|
||||
* @param separateScriptAccount whether the script lane gets the advanced account of its own
|
||||
*/
|
||||
private RedisRuntimeOwner runtime(boolean separateScriptAccount) {
|
||||
RedisSdkSettings settings = new RedisSdkSettings();
|
||||
settings.setEnabled(true);
|
||||
settings.setMode(endpoint.mode());
|
||||
settings.setNodes(
|
||||
new java.util.ArrayList<>(java.util.List.of(endpoint.host() + ":" + endpoint.port())));
|
||||
settings.getNamespace().setEnvironment(NAMESPACE.environment());
|
||||
settings.getNamespace().setService(NAMESPACE.service());
|
||||
settings.getNamespace().setDomain(NAMESPACE.domain());
|
||||
|
||||
Map<RedisCredentialRole, RedisCredentials> accounts = new EnumMap<>(RedisCredentialRole.class);
|
||||
accounts.put(
|
||||
RedisCredentialRole.APPLICATION,
|
||||
new RedisCredentials(endpoint.username(), password(endpoint.password())));
|
||||
if (separateScriptAccount) {
|
||||
accounts.put(
|
||||
RedisCredentialRole.ADVANCED,
|
||||
new RedisCredentials("ca-skeleton-application-advanced", "fixture-advanced"));
|
||||
}
|
||||
Map<RedisConnectionKind, Integer> limits = new EnumMap<>(RedisConnectionKind.class);
|
||||
for (RedisConnectionKind kind : RedisConnectionKind.values()) {
|
||||
limits.put(kind, 4);
|
||||
}
|
||||
owner =
|
||||
new RedisRuntimeOwner(
|
||||
new RedisTopologyClientFactory(
|
||||
settings,
|
||||
accounts,
|
||||
Optional.empty(),
|
||||
location -> {
|
||||
throw new java.io.IOException("this lane configures no TLS material");
|
||||
})
|
||||
.create(),
|
||||
limits,
|
||||
Duration.ofSeconds(2),
|
||||
Duration.ofSeconds(2));
|
||||
owner = LiveRedisRuntime.open(NAMESPACE, separateScriptAccount);
|
||||
return owner;
|
||||
}
|
||||
|
||||
private static String password(String configured) {
|
||||
return configured.isBlank() ? "fixture-application" : configured;
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Cache: the application account, plain data commands, one namespace
|
||||
// =========================================================================
|
||||
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package dev.caskeleton.adapter.outbound.cache.redis.capability;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.LiveRedisRuntime;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.key.RedisNamespace;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisRuntimeOwner;
|
||||
import dev.caskeleton.adapter.outbound.support.CapabilityStartupValidationException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* The startup SCRIPT probe against a real server and the deployment's ACL accounts.
|
||||
*
|
||||
* <p>The unit test proves the probe reacts to a refusal; only a real server proves the probe asks
|
||||
* the question Redis actually answers. With the advanced account's template missing {@code +time},
|
||||
* this class is what failed at startup instead of on the first rate-limit request.
|
||||
*/
|
||||
@Tag("redis-topology")
|
||||
@Tag("lane-standalone")
|
||||
@Tag("lane-cluster")
|
||||
class LiveRedisSemanticScriptAclProbeTest {
|
||||
|
||||
private static final RedisNamespace NAMESPACE = new RedisNamespace("prod", "order", "shared");
|
||||
|
||||
private RedisRuntimeOwner owner;
|
||||
|
||||
@AfterEach
|
||||
void closeOwner() {
|
||||
if (owner != null) {
|
||||
owner.close();
|
||||
owner = null;
|
||||
}
|
||||
}
|
||||
|
||||
private RedisSemanticScriptAclProbe probe(boolean separateScriptAccount) {
|
||||
owner = LiveRedisRuntime.open(NAMESPACE, separateScriptAccount);
|
||||
RedisCapabilitySettings capabilities = new RedisCapabilitySettings();
|
||||
capabilities.getIdempotency().setProvider("redis");
|
||||
return new RedisSemanticScriptAclProbe(
|
||||
owner,
|
||||
capabilities,
|
||||
(NAMESPACE.prefix() + ":probe:{semantic-script}:acl").getBytes(StandardCharsets.UTF_8),
|
||||
Duration.ofSeconds(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("advanced 계정은 스크립트가 부르는 명령까지 실제 서버에서 통과한다")
|
||||
void theAdvancedAccountPassesTheStartupProbe() {
|
||||
RedisSemanticScriptAclProbe probe = probe(true);
|
||||
|
||||
assertThatCode(probe::afterSingletonsInstantiated).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("application 계정만으로는 기동 probe가 실패한다")
|
||||
void theApplicationAccountAloneFailsTheStartupProbe() {
|
||||
// given
|
||||
RedisSemanticScriptAclProbe probe = probe(false);
|
||||
|
||||
// when
|
||||
Throwable failure = catchThrowable(probe::afterSingletonsInstantiated);
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(CapabilityStartupValidationException.class)
|
||||
.hasMessageContaining("SCRIPT LOAD/EVALSHA is unavailable");
|
||||
}
|
||||
}
|
||||
+58
@@ -3,6 +3,7 @@ package dev.caskeleton.adapter.outbound.cache.redis.capability;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.api.RedisDeploymentMode;
|
||||
import dev.caskeleton.adapter.outbound.cache.redis.sdk.lettuce.connection.RedisConnectionKind;
|
||||
@@ -18,7 +19,11 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
class RedisSemanticScriptAclProbeTest {
|
||||
|
||||
@@ -76,6 +81,29 @@ class RedisSemanticScriptAclProbeTest {
|
||||
.hasRootCauseInstanceOf(RuntimeException.class);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"TIME"})
|
||||
@DisplayName("스크립트가 부르는 명령 하나라도 계정에 없으면 첫 요청이 아니라 기동에서 실패한다")
|
||||
void anAccountDeniedACommandTheScriptsCallFailsStartup(String command) {
|
||||
// given
|
||||
RedisCapabilitySettings capabilities = new RedisCapabilitySettings();
|
||||
capabilities.getIdempotency().setProvider("redis");
|
||||
RedisSemanticScriptAclProbe probe =
|
||||
new RedisSemanticScriptAclProbe(
|
||||
owner(gatewayDenying(command), new AtomicInteger()),
|
||||
capabilities,
|
||||
"prod:svc:shared:probe".getBytes(StandardCharsets.UTF_8),
|
||||
Duration.ofSeconds(1));
|
||||
|
||||
// when
|
||||
Throwable failure = catchThrowable(probe::afterSingletonsInstantiated);
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(CapabilityStartupValidationException.class)
|
||||
.hasMessageContaining("SCRIPT LOAD/EVALSHA is unavailable");
|
||||
}
|
||||
|
||||
private static RedisRuntimeOwner owner(RedisCommandGateway gateway, AtomicInteger opened) {
|
||||
RedisRuntimeClient client =
|
||||
new RedisRuntimeClient() {
|
||||
@@ -134,4 +162,34 @@ class RedisSemanticScriptAclProbeTest {
|
||||
"unexpected gateway method: " + method.getName());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* A gateway whose account may load and run scripts but is denied one command.
|
||||
*
|
||||
* <p>Redis checks a script's inner commands against the caller's ACL when they run, so a program
|
||||
* that calls the denied command fails with {@code NOPERM} and one that does not call it succeeds.
|
||||
*/
|
||||
private static RedisCommandGateway gatewayDenying(String command) {
|
||||
AtomicReference<String> loaded = new AtomicReference<>("");
|
||||
return (RedisCommandGateway)
|
||||
Proxy.newProxyInstance(
|
||||
RedisCommandGateway.class.getClassLoader(),
|
||||
new Class<?>[] {RedisCommandGateway.class},
|
||||
(proxy, method, arguments) ->
|
||||
switch (method.getName()) {
|
||||
case "loadScript" -> {
|
||||
loaded.set(new String((byte[]) arguments[0], StandardCharsets.UTF_8));
|
||||
yield CompletableFuture.completedFuture("probe-digest");
|
||||
}
|
||||
case "evaluateRegisteredForList" ->
|
||||
loaded.get().contains("redis.call('" + command + "'")
|
||||
? CompletableFuture.failedFuture(
|
||||
new RuntimeException("NOPERM this user has no permissions"))
|
||||
: CompletableFuture.completedFuture(List.of(1L));
|
||||
case "toString" -> "RedisSemanticScriptAclProbeTestGateway";
|
||||
default ->
|
||||
throw new UnsupportedOperationException(
|
||||
"unexpected gateway method: " + method.getName());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+27
-4
@@ -11,9 +11,9 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Role-tiered authorization over the ten file operations.
|
||||
* Role-tiered, owner-checked authorization over the file operations.
|
||||
*
|
||||
* <p>The ten operations collapse into three tiers because that is the granularity a role model can
|
||||
* <p>The operations collapse into three tiers because that is the granularity a role model can
|
||||
* actually express: reading a file, changing one, and acting on the management plane. A per-
|
||||
* operation role map would let a deployment grant {@code COPY} without {@code CREATE}, which reads
|
||||
* as a restriction but is not one — a copy creates a file.
|
||||
@@ -22,7 +22,12 @@ import java.util.Set;
|
||||
* could delete would make the audited management plane reachable through the ordinary data plane.
|
||||
*
|
||||
* <p>Anonymous download is opt-in and deliberately narrow: it grants exactly the read tier and
|
||||
* never write or admin, so switching it on cannot widen anything else.
|
||||
* never write or admin, so switching it on cannot widen anything else. It is also the one case that
|
||||
* skips the owner check, because a public-read deployment has chosen to publish every file.
|
||||
*
|
||||
* <p>The role decides what kind of operation a caller may perform; ownership decides on which
|
||||
* files. Every operation on an existing file also requires that the caller created it, in the same
|
||||
* tenant — two callers holding the same role no longer see each other's files.
|
||||
*/
|
||||
public final class RoleBasedFileAccessPolicy implements FileAccessPolicy {
|
||||
|
||||
@@ -66,6 +71,24 @@ public final class RoleBasedFileAccessPolicy implements FileAccessPolicy {
|
||||
if (permitted.stream().noneMatch(subject.roles()::contains)) {
|
||||
throw denied(FileserverErrorCode.ACCESS_DENIED, "subject does not hold a permitted role");
|
||||
}
|
||||
if (descriptor.isPresent() && !isOwnedBy(descriptor.get(), subject)) {
|
||||
throw denied(FileserverErrorCode.ACCESS_DENIED, "subject does not own the file");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the file was created by this caller, in this caller's tenant.
|
||||
*
|
||||
* <p>A file without a recorded owner predates ownership and belongs to nobody on the data plane.
|
||||
* An admin role does not bypass this: acting on somebody else's file is what the audited
|
||||
* management plane is for, and its operations carry no descriptor.
|
||||
*/
|
||||
private static boolean isOwnedBy(FileDescriptor descriptor, FileAccessSubject subject) {
|
||||
return descriptor
|
||||
.owner()
|
||||
.filter(owner -> owner.principalId().equals(subject.principalId()))
|
||||
.filter(owner -> owner.tenantId().equals(subject.tenant()))
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
private static boolean isAnonymous(FileAccessSubject subject) {
|
||||
@@ -76,7 +99,7 @@ public final class RoleBasedFileAccessPolicy implements FileAccessPolicy {
|
||||
return switch (operation) {
|
||||
case READ_METADATA, DOWNLOAD -> Tier.READ;
|
||||
case CREATE, APPEND, FINALIZE, DELETE, COPY, MOVE -> Tier.WRITE;
|
||||
case ADMIN_REVERIFY, ADMIN_FORCE_DELETE -> Tier.ADMIN;
|
||||
case ADMIN_READ, ADMIN_REVERIFY, ADMIN_FORCE_DELETE -> Tier.ADMIN;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+113
@@ -3,13 +3,21 @@ package dev.caskeleton.adapter.outbound.fileserver.platform.security;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.catchThrowable;
|
||||
|
||||
import dev.caskeleton.application.fileserver.api.FileId;
|
||||
import dev.caskeleton.application.fileserver.api.FileState;
|
||||
import dev.caskeleton.application.fileserver.api.StorageNamespace;
|
||||
import dev.caskeleton.application.fileserver.api.error.FileAccessDeniedException;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileDescriptor;
|
||||
import dev.caskeleton.application.fileserver.api.metadata.FileOwner;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileAccessSubject;
|
||||
import dev.caskeleton.application.fileserver.api.security.FileOperation;
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.EnumSource;
|
||||
@@ -26,6 +34,7 @@ class RoleBasedFileAccessPolicyTest {
|
||||
private static final String READ = "ROLE_FILE_READ";
|
||||
private static final String WRITE = "ROLE_FILE_WRITE";
|
||||
private static final String ADMIN = "ROLE_FILE_ADMIN";
|
||||
private static final Optional<String> NO_TENANT = Optional.empty();
|
||||
|
||||
private final RoleBasedFileAccessPolicy policy =
|
||||
new RoleBasedFileAccessPolicy(Set.of(READ), Set.of(WRITE), Set.of(ADMIN), false);
|
||||
@@ -116,6 +125,92 @@ class RoleBasedFileAccessPolicyTest {
|
||||
});
|
||||
}
|
||||
|
||||
/** Holding the same role tier as the owner is not ownership. */
|
||||
@ParameterizedTest
|
||||
@EnumSource(
|
||||
value = FileOperation.class,
|
||||
names = {"READ_METADATA", "DOWNLOAD", "APPEND", "FINALIZE", "DELETE", "COPY", "MOVE"})
|
||||
void aCallerWithTheSameRolesIsDeniedAFileSomebodyElseOwns(FileOperation operation) {
|
||||
// given
|
||||
FileAccessSubject stranger = FileAccessSubject.of("user-2", Set.of(READ, WRITE));
|
||||
|
||||
// when
|
||||
Throwable failure =
|
||||
catchThrowable(() -> policy.authorize(operation, stranger, ownedBy("user-1", NO_TENANT)));
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(FileAccessDeniedException.class)
|
||||
.hasMessage("subject does not own the file");
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@EnumSource(
|
||||
value = FileOperation.class,
|
||||
names = {"READ_METADATA", "DOWNLOAD", "APPEND", "FINALIZE", "DELETE", "COPY", "MOVE"})
|
||||
void theOwnerIsGrantedEveryDataOperationWithoutAnException(FileOperation operation) {
|
||||
// given
|
||||
FileAccessSubject owner = FileAccessSubject.of("user-1", Set.of(READ, WRITE));
|
||||
|
||||
// when
|
||||
Throwable failure =
|
||||
catchThrowable(() -> policy.authorize(operation, owner, ownedBy("user-1", NO_TENANT)));
|
||||
|
||||
// then
|
||||
assertThat(failure).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void theSamePrincipalInAnotherTenantIsDeniedTheFile() {
|
||||
// given
|
||||
FileAccessSubject otherTenant =
|
||||
new FileAccessSubject(
|
||||
"user-1", Set.of(READ), Map.of(FileAccessSubject.TENANT_ATTRIBUTE, "tenant-b"));
|
||||
|
||||
// when
|
||||
Throwable failure =
|
||||
catchThrowable(
|
||||
() ->
|
||||
policy.authorize(
|
||||
FileOperation.DOWNLOAD,
|
||||
otherTenant,
|
||||
ownedBy("user-1", Optional.of("tenant-a"))));
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(FileAccessDeniedException.class)
|
||||
.hasMessage("subject does not own the file");
|
||||
}
|
||||
|
||||
/** A row that predates ownership is reachable through the management plane only. */
|
||||
@Test
|
||||
void aFileWithNoRecordedOwnerIsDeniedToEveryDataPlaneCaller() {
|
||||
// given
|
||||
Optional<FileDescriptor> ownerless = Optional.of(descriptor(Optional.empty()));
|
||||
|
||||
// when
|
||||
Throwable failure =
|
||||
catchThrowable(
|
||||
() -> policy.authorize(FileOperation.DOWNLOAD, subject(READ, WRITE), ownerless));
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(FileAccessDeniedException.class)
|
||||
.hasMessage("subject does not own the file");
|
||||
}
|
||||
|
||||
@Test
|
||||
void adminReadsNeedTheAdminRoleRatherThanTheReadRole() {
|
||||
// when
|
||||
Throwable failure =
|
||||
catchThrowable(() -> policy.authorize(FileOperation.ADMIN_READ, subject(READ), none()));
|
||||
|
||||
// then
|
||||
assertThat(failure)
|
||||
.isInstanceOf(FileAccessDeniedException.class)
|
||||
.hasMessage("subject does not hold a permitted role");
|
||||
}
|
||||
|
||||
@Test
|
||||
void anEmptyAdminRoleSetIsRejectedAtConstruction() {
|
||||
assertThatThrownBy(
|
||||
@@ -130,4 +225,22 @@ class RoleBasedFileAccessPolicyTest {
|
||||
private static Optional<FileDescriptor> none() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
private static Optional<FileDescriptor> ownedBy(String principal, Optional<String> tenant) {
|
||||
return Optional.of(descriptor(Optional.of(new FileOwner(principal, tenant))));
|
||||
}
|
||||
|
||||
private static FileDescriptor descriptor(Optional<FileOwner> owner) {
|
||||
return new FileDescriptor(
|
||||
FileId.of(UUID.randomUUID()),
|
||||
StorageNamespace.of("files"),
|
||||
FileState.READY,
|
||||
"report.bin",
|
||||
"application/octet-stream",
|
||||
10,
|
||||
"a".repeat(64),
|
||||
Instant.parse("2026-08-07T10:00:00Z"),
|
||||
owner,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@ moving a type between packages.
|
||||
## Responsibility
|
||||
|
||||
- Own the public call surfaces: H1 typed service clients (default), H2 generic exchange, H3 dynamic
|
||||
target. H4 native engine access stays internal to `apache`, `jdk`, `reactor`, and `http3`.
|
||||
target. H4 native engine access stays internal to `apache`, `jdk`, and `http3`.
|
||||
- Blocking only: calls run on the caller's (virtual) thread through `RestClient`. The reactive stack
|
||||
(`WebClient`, Reactor Netty) was removed by decision 9 (2026-09-25); do not add it back.
|
||||
- Own Named Client Profiles, runtime generations, transport SPI, deadlines, evidence-based retry,
|
||||
resilience, authentication, TLS, SSRF defence, streaming lifecycle, and observability.
|
||||
- Adapt external HTTP calls behind application/domain ports.
|
||||
@@ -32,8 +34,8 @@ moving a type between packages.
|
||||
|
||||
`HttpClientModuleBoundaryTest` and `PublicApiArchitectureTest` enforce the design's module table:
|
||||
|
||||
- `api` depends on nothing else in the platform, and on no Spring, Apache, Netty, Jetty, or
|
||||
Resilience4j type.
|
||||
- `api` depends on nothing else in the platform, and on no Spring, Apache, Jetty, or Resilience4j
|
||||
type.
|
||||
- `profile` depends publicly only on `api`.
|
||||
- transport packages never reach back into the gateways.
|
||||
- `resilience` never depends on a transport — retry eligibility is transport-neutral.
|
||||
@@ -70,7 +72,7 @@ Default lane: `./gradlew :adapter:outbound:httpclient:test`. Additional lanes, a
|
||||
|
||||
| Lane | Purpose |
|
||||
|---|---|
|
||||
| `httpClientStableContractTest` | one semantic contract across Apache, JDK, Reactor |
|
||||
| `httpClientStableContractTest` | one semantic contract across Apache and JDK |
|
||||
| `httpClientSecurityTest` | SSRF matrix, credential stripping, tag cardinality |
|
||||
| `httpClientFailureInjectionTest` | Toxiproxy faults; **requires Docker and fails without it** |
|
||||
| `httpClientPerformanceTest` | pool, streaming, retry, rotation resource bounds |
|
||||
|
||||
@@ -12,8 +12,8 @@ Adaptation to this repository: `docs/httpclient/repository-adaptation.md`
|
||||
|
||||
| Surface | Use it when | What it fixes for you |
|
||||
|---|---|---|
|
||||
| **H1 typed client** (`HttpServiceRegistry`, `ReactiveHttpServiceRegistry`) | almost always | URL, timeout, auth, retry, limits, metrics |
|
||||
| **H2 generic exchange** (`GenericHttpGateway`, `ReactiveHttpGateway`) | method, path, or body must vary at runtime | scheme, host, port, TLS, credentials, hard limits |
|
||||
| **H1 typed client** (`HttpServiceRegistry`) | almost always | URL, timeout, auth, retry, limits, metrics |
|
||||
| **H2 generic exchange** (`GenericHttpGateway`, `BlockingStreamingGateway`) | method, path, or body must vary at runtime | scheme, host, port, TLS, credentials, hard limits |
|
||||
| **H3 dynamic target** (`DynamicTargetGateway`) | the URL comes from a user | full SSRF validation; inherits no credential |
|
||||
| **H4 native engine** | never, from application code | — |
|
||||
|
||||
@@ -29,8 +29,10 @@ public interface UsersClient {
|
||||
```
|
||||
|
||||
The interface fails startup unless it names a profile, gives every method a stable operation name,
|
||||
declares idempotency explicitly, supplies a key parameter when the operation requires one, and keeps
|
||||
a single execution model.
|
||||
declares idempotency explicitly, and supplies a key parameter when the operation requires one.
|
||||
|
||||
Every call is blocking and runs on the caller's thread — a virtual thread in this template. There is
|
||||
no reactive (`WebClient`/Reactor Netty) surface; it was removed on 2026-09-25 (decision 9).
|
||||
|
||||
## What the platform decides for you
|
||||
|
||||
|
||||
@@ -27,14 +27,12 @@ dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-actuator'
|
||||
implementation 'org.springframework.boot:spring-boot-actuator-autoconfigure'
|
||||
implementation 'org.springframework:spring-web'
|
||||
implementation 'org.springframework:spring-webflux'
|
||||
implementation 'io.projectreactor:reactor-core'
|
||||
|
||||
// Transport providers. Apache HC5 is the blocking default, JDK HttpClient is the lightweight
|
||||
// alternative (JDK built-in), Reactor Netty is the reactive default, Jetty carries the
|
||||
// Experimental HTTP/3 transport that the Stable starter never auto-configures.
|
||||
// Transport providers. Apache HC5 is the default, JDK HttpClient is the lightweight
|
||||
// alternative (JDK built-in), Jetty carries the Experimental HTTP/3 transport that the Stable
|
||||
// starter never auto-configures. The platform is blocking only: calls run on the caller's
|
||||
// (virtual) thread, and there is no reactive execution path (decision 9, 2026-09-25).
|
||||
implementation 'org.apache.httpcomponents.client5:httpclient5'
|
||||
implementation 'io.projectreactor.netty:reactor-netty-http'
|
||||
compileOnly 'org.eclipse.jetty:jetty-client'
|
||||
testImplementation 'org.eclipse.jetty:jetty-client'
|
||||
// HTTP/3 is Experimental and off by default, so its transport is compileOnly plus a test
|
||||
@@ -74,9 +72,7 @@ dependencies {
|
||||
// testFixturesImplementation below so production and unrelated test lanes do not inherit them.
|
||||
testImplementation libs.mockwebserver
|
||||
testImplementation libs.okhttp.tls
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation libs.archunit.junit5
|
||||
testImplementation libs.blockhound
|
||||
}
|
||||
|
||||
// Reusable test support lives in Gradle testFixtures. Integration/performance lanes and JMH opt
|
||||
@@ -105,19 +101,12 @@ dependencies {
|
||||
// testFixtures makes that surface explicit (ADR-BUILD-001). These six were invisible before.
|
||||
testFixturesImplementation 'io.micrometer:micrometer-core'
|
||||
testFixturesImplementation 'org.springframework:spring-web'
|
||||
testFixturesImplementation 'io.projectreactor:reactor-core'
|
||||
testFixturesImplementation 'org.assertj:assertj-core'
|
||||
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api'
|
||||
testFixturesImplementation 'org.slf4j:slf4j-api'
|
||||
// The Netty leak detector reads logback's own event types to catch a LEAK record.
|
||||
testFixturesImplementation 'io.netty:netty-common'
|
||||
testFixturesImplementation 'ch.qos.logback:logback-classic'
|
||||
testFixturesImplementation libs.mockwebserver
|
||||
testFixturesImplementation libs.okhttp.tls
|
||||
testFixturesImplementation 'io.projectreactor:reactor-test'
|
||||
testFixturesImplementation libs.archunit.junit5
|
||||
testFixturesImplementation libs.blockhound
|
||||
|
||||
}
|
||||
|
||||
// UTF-8 is pinned for every JavaCompile task in the root build; this leaf no longer repeats it.
|
||||
@@ -134,19 +123,16 @@ dependencies {
|
||||
|
||||
tasks.named('test', Test) {
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
// Two lanes are excluded from the default run for opposite reasons: the fault lane needs Docker
|
||||
// and fails closed without it, and the BlockHound lane rewrites core JDK bytecode, which must
|
||||
// not be imposed on every unit run.
|
||||
// The tagged suites run in their own lanes below, so the default run does not repeat them.
|
||||
useJUnitPlatform {
|
||||
excludeTags 'httpclient-blockhound', 'httpclient-contract', 'httpclient-security', 'httpclient-spring62-surface'
|
||||
excludeTags 'httpclient-contract', 'httpclient-security', 'httpclient-spring62-surface'
|
||||
}
|
||||
}
|
||||
|
||||
// Four tag-selected lanes, declared rather than assembled.
|
||||
// Tag-selected lanes, declared rather than assembled.
|
||||
//
|
||||
// Two of them — the stable contract suite and the security suite — did not carry
|
||||
// failOnNoDiscoveredTests at all. Five lanes were written by copying the block above, and the
|
||||
@@ -154,23 +140,11 @@ tasks.named('test', Test) {
|
||||
// contract suite and the SSRF/credential-leak suite would each have reported success on discovering
|
||||
// nothing. Declaring the lanes removes the opportunity: the convention has no opt-out.
|
||||
strictTestLanes {
|
||||
lane('httpClientBlockHoundTest') {
|
||||
tag = 'httpclient-blockhound'
|
||||
description = 'Proves no platform code blocks a Reactor event loop (design §18.2, §28.6).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
// BlockHound instruments already-loaded JDK classes; Java 13+ needs this to redefine them.
|
||||
jvmArgs '-XX:+AllowRedefinitionToAddDeleteMethods'
|
||||
}
|
||||
lane('httpClientStableContractTest') {
|
||||
tag = 'httpclient-contract'
|
||||
description = 'Runs the cross-transport stable contract suite (design §28.2, §33).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
}
|
||||
@@ -184,8 +158,7 @@ strictTestLanes {
|
||||
tag = 'httpclient-contract'
|
||||
description = 'Runs the contract suite on the repository Spring 7 baseline (design §29).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
}
|
||||
@@ -193,8 +166,7 @@ strictTestLanes {
|
||||
tag = 'httpclient-security'
|
||||
description = 'Runs the SSRF, credential-leak, and cardinality suite (design §28.5, §28.7).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
}
|
||||
@@ -212,8 +184,7 @@ strictTestLanes {
|
||||
sourceSet = 'httpClientPerformanceTest'
|
||||
description = 'Certifies pool, streaming, retry, and rotation resource bounds (design §28.8).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
systemProperty 'performance.assertions.enabled',
|
||||
@@ -226,8 +197,7 @@ strictTestLanes {
|
||||
description = 'Runs the Toxiproxy fault-injection suite; fails closed without Docker ' +
|
||||
'(design §28.3).'
|
||||
systemProperty 'httpclient.contract.transports',
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk,reactor').get()
|
||||
systemProperty 'io.netty.leakDetection.level', 'paranoid'
|
||||
providers.gradleProperty('httpclient.contract.transports').orElse('apache,jdk').get()
|
||||
systemProperty 'httpclient.http3.tests.enabled',
|
||||
providers.gradleProperty('http3.tests.enabled').orElse('false').get()
|
||||
// The upstream image is mutable by default. A digest here is what makes a red fault run
|
||||
@@ -243,10 +213,10 @@ strictTestLanes {
|
||||
// Which lanes gate an ordinary build, and which do not.
|
||||
//
|
||||
// The specialised lanes existed but hung off nothing: `check` ran only `test`, so the SSRF suite,
|
||||
// the BlockHound lane, the cross-transport contract and the Spring 6.2 surface scan were green in
|
||||
// CI only because a workflow happened to name them, and green locally because nobody ran them.
|
||||
// The four below are hermetic and fast — no Docker, no network, no machine-dependent thresholds —
|
||||
// so they belong in `check`.
|
||||
// the cross-transport contract and the Spring 6.2 surface scan were green in CI only because a
|
||||
// workflow happened to name them, and green locally because nobody ran them. The three below are
|
||||
// hermetic and fast — no Docker, no network, no machine-dependent thresholds — so they belong in
|
||||
// `check`.
|
||||
//
|
||||
// httpClientFailureInjectionTest (needs Docker), httpClientPerformanceTest (machine-dependent
|
||||
// bounds) and jmh (minutes) stay out deliberately. Attaching them would make `check` fail on a
|
||||
@@ -254,6 +224,5 @@ strictTestLanes {
|
||||
tasks.named('check') {
|
||||
dependsOn 'httpClientStableContractTest',
|
||||
'httpClientSecurityTest',
|
||||
'httpClientBlockHoundTest',
|
||||
'spring62ApiSurfaceScan'
|
||||
}
|
||||
|
||||
@@ -1,257 +1,228 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testkitCompileClasspath
|
||||
ch.qos.logback:logback-classic:1.5.38=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
ch.qos.logback:logback-core:1.5.38=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-annotations:2.21=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-core:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-databind:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.fasterxml.jackson:jackson-bom:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.github.ben-manes.caffeine:caffeine:3.2.4=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.github.docker-java:docker-java-api:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.github.docker-java:docker-java-transport-zerodep:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.github.docker-java:docker-java-transport:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath
|
||||
ch.qos.logback:logback-classic:1.5.38=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
ch.qos.logback:logback-core:1.5.38=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-annotations:2.21=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-core:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.fasterxml.jackson.core:jackson-databind:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.fasterxml.jackson:jackson-bom:2.21.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.github.ben-manes.caffeine:caffeine:3.2.4=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.github.docker-java:docker-java-api:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
com.github.docker-java:docker-java-transport-zerodep:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
com.github.docker-java:docker-java-transport:3.7.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.github.spotbugs:spotbugs-annotations:4.10.2=spotbugs
|
||||
com.github.spotbugs:spotbugs:4.10.2=spotbugs
|
||||
com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.auto.value:auto-value-annotations:1.9=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.auto:auto-common:1.2.2=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.auto.value:auto-value-annotations:1.9=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.auto:auto-common:1.2.2=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.code.findbugs:jsr305:3.0.2=checkstyle,spotbugs
|
||||
com.google.code.gson:gson:2.13.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.google.errorprone:error_prone_annotation:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.code.gson:gson:2.13.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs
|
||||
com.google.errorprone:error_prone_annotation:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.errorprone:error_prone_annotations:2.38.0=httpClientPerformanceTestCompileClasspath,testCompileClasspath
|
||||
com.google.errorprone:error_prone_annotations:2.41.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.google.errorprone:error_prone_annotations:2.41.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs
|
||||
com.google.errorprone:error_prone_annotations:2.47.0=checkstyle
|
||||
com.google.errorprone:error_prone_annotations:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.errorprone:error_prone_check_api:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.errorprone:error_prone_core:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.googlejavaformat:google-java-format:1.35.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.guava:failureaccess:1.0.3=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.guava:guava:33.5.0-jre=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.errorprone:error_prone_annotations:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.errorprone:error_prone_check_api:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.errorprone:error_prone_core:2.49.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.googlejavaformat:google-java-format:1.35.0=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.guava:failureaccess:1.0.3=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.guava:guava:33.5.0-jre=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.guava:guava:33.6.0-jre=checkstyle
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.protobuf:protobuf-java:4.33.2=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,checkstyle,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.google.protobuf:protobuf-java:4.33.2=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0=spotbugsPlugins
|
||||
com.jayway.jsonpath:json-path:2.10.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.nimbusds:content-type:2.3=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.nimbusds:lang-tag:1.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.nimbusds:nimbus-jose-jwt:10.4=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.nimbusds:oauth2-oidc-sdk:11.26.1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.jayway.jsonpath:json-path:2.10.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
com.nimbusds:content-type:2.3=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.nimbusds:lang-tag:1.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.nimbusds:nimbus-jose-jwt:10.4=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.nimbusds:oauth2-oidc-sdk:11.26.1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.puppycrawl.tools:checkstyle:13.5.0=checkstyle
|
||||
com.squareup.okhttp3:mockwebserver:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.squareup.okhttp3:okhttp-tls:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.squareup.okhttp3:okhttp:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.squareup.okio:okio-jvm:3.6.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.squareup.okio:okio:3.6.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-api:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-engine-api:1.3.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-engine:1.3.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.tngtech.archunit:archunit:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.vaadin.external.google:android-json:0.0.20131108.vaadin1=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
com.squareup.okhttp3:mockwebserver:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.squareup.okhttp3:okhttp-tls:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.squareup.okhttp3:okhttp:4.12.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.squareup.okio:okio-jvm:3.6.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.squareup.okio:okio:3.6.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-api:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-engine-api:1.3.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5-engine:1.3.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.tngtech.archunit:archunit-junit5:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.tngtech.archunit:archunit:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
com.vaadin.external.google:android-json:0.0.20131108.vaadin1=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
commons-beanutils:commons-beanutils:1.11.0=checkstyle
|
||||
commons-codec:commons-codec:1.19.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
commons-codec:commons-codec:1.19.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
commons-collections:commons-collections:3.2.2=checkstyle
|
||||
commons-io:commons-io:2.20.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
commons-io:commons-io:2.20.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
commons-io:commons-io:2.21.0=spotbugs
|
||||
commons-logging:commons-logging:1.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
eu.rekawek.toxiproxy:toxiproxy-java:2.1.11=testkitCompileClasspath,testkitRuntimeClasspath
|
||||
commons-logging:commons-logging:1.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
eu.rekawek.toxiproxy:toxiproxy-java:2.1.7=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
info.picocli:picocli:4.7.7=checkstyle
|
||||
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
io.github.resilience4j:resilience4j-bulkhead:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-circuitbreaker:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-core:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-micrometer:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-ratelimiter:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-retry:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-timelimiter:2.2.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
io.micrometer:micrometer-commons:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.micrometer:micrometer-core:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.micrometer:micrometer-observation:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-buffer:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-base:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-classes-quic:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-compression:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-dns:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-http2:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-http3:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-http:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-native-quic:4.2.17.Final=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-codec-socks:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-common:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-handler-proxy:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-handler:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-resolver-dns-classes-macos:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-resolver-dns-native-macos:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-resolver-dns:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-resolver:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-transport-classes-epoll:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-transport-native-epoll:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-transport-native-unix-common:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.netty:netty-transport:4.2.17.Final=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.projectreactor.netty:reactor-netty-core:1.3.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.projectreactor.netty:reactor-netty-http:1.3.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.projectreactor.tools:blockhound:1.0.17.RELEASE=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.projectreactor:reactor-core:3.8.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
io.projectreactor:reactor-test:3.8.7=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
jakarta.activation:jakarta.activation-api:2.1.4=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
jakarta.annotation:jakarta.annotation-api:3.0.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
javax.inject:javax.inject:1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
io.github.resilience4j:resilience4j-bulkhead:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-circuitbreaker:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-core:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-micrometer:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-ratelimiter:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-retry:2.2.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.github.resilience4j:resilience4j-timelimiter:2.2.0=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.micrometer:micrometer-commons:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.micrometer:micrometer-core:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
io.micrometer:micrometer-observation:1.16.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
jakarta.activation:jakarta.activation-api:2.1.4=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
jakarta.annotation:jakarta.annotation-api:3.0.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
javax.inject:javax.inject:1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
jaxen:jaxen:2.0.6=spotbugs
|
||||
junit:junit:4.13.2=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
net.bytebuddy:byte-buddy-agent:1.17.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
net.bytebuddy:byte-buddy:1.17.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
net.java.dev.jna:jna:5.18.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
net.minidev:accessors-smart:2.6.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
net.minidev:json-smart:2.6.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
junit:junit:4.13.2=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
net.bytebuddy:byte-buddy-agent:1.17.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
net.bytebuddy:byte-buddy:1.17.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
net.java.dev.jna:jna:5.18.1=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
net.minidev:accessors-smart:2.6.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
net.minidev:json-smart:2.6.0=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
net.sf.saxon:Saxon-HE:12.9=checkstyle,spotbugs
|
||||
org.antlr:antlr4-runtime:4.13.2=checkstyle
|
||||
org.apache.bcel:bcel:6.12.0=spotbugs
|
||||
org.apache.commons:commons-compress:1.28.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.commons:commons-lang3:3.20.0=checkstyle,integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.commons:commons-compress:1.28.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.apache.commons:commons-lang3:3.20.0=checkstyle,integrationTestCompileClasspath,integrationTestRuntimeClasspath,spotbugs
|
||||
org.apache.commons:commons-math3:3.6.1=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
org.apache.commons:commons-text:1.15.0=spotbugs
|
||||
org.apache.commons:commons-text:1.3=checkstyle
|
||||
org.apache.httpcomponents.client5:httpclient5:5.5.2=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.httpcomponents.core5:httpcore5-h2:5.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.httpcomponents.core5:httpcore5:5.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.httpcomponents.client5:httpclient5:5.5.2=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.apache.httpcomponents.core5:httpcore5-h2:5.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.apache.httpcomponents.core5:httpcore5:5.3.6=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.apache.httpcomponents:httpclient:4.5.13=checkstyle
|
||||
org.apache.httpcomponents:httpcore:4.4.16=checkstyle
|
||||
org.apache.logging.log4j:log4j-api:2.25.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.logging.log4j:log4j-api:2.25.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
|
||||
org.apache.logging.log4j:log4j-core:2.25.5=spotbugs
|
||||
org.apache.logging.log4j:log4j-to-slf4j:2.25.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.logging.log4j:log4j-to-slf4j:2.25.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.apache.maven.doxia:doxia-core:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle
|
||||
org.apache.maven.doxia:doxia-sink-api:1.12.0=checkstyle
|
||||
org.apache.tomcat.embed:tomcat-embed-core:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.tomcat.embed:tomcat-embed-el:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.tomcat.embed:tomcat-embed-websocket:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apache.tomcat.embed:tomcat-embed-core:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.apache.tomcat.embed:tomcat-embed-el:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.apache.tomcat.embed:tomcat-embed-websocket:11.0.24=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.apache.xbean:xbean-reflect:3.7=checkstyle
|
||||
org.apiguardian:apiguardian-api:1.1.2=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testFixturesCompileClasspath,testkitCompileClasspath
|
||||
org.assertj:assertj-core:3.27.7=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.awaitility:awaitility:4.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.apiguardian:apiguardian-api:1.1.2=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testFixturesCompileClasspath
|
||||
org.assertj:assertj-core:3.27.7=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.awaitility:awaitility:4.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.codehaus.plexus:plexus-classworlds:2.6.0=checkstyle
|
||||
org.codehaus.plexus:plexus-component-annotations:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-container-default:2.1.0=checkstyle
|
||||
org.codehaus.plexus:plexus-utils:3.3.0=checkstyle
|
||||
org.dom4j:dom4j:2.2.0=spotbugs
|
||||
org.eclipse.jetty.compression:jetty-compression-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.compression:jetty-compression-gzip:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-client-transport:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-qpack:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-api:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-util:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-alpn-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-http:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-io:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-util:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.hamcrest:hamcrest-core:3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.hamcrest:hamcrest:3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.hdrhistogram:HdrHistogram:2.2.2=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.eclipse.jetty.compression:jetty-compression-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.compression:jetty-compression-gzip:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-client-transport:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.http3:jetty-http3-qpack:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-api:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-common:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty.quic:jetty-quic-util:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-alpn-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-client:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-http:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-io:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-util:12.1.12=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.hamcrest:hamcrest-core:3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.hamcrest:hamcrest:3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.hdrhistogram:HdrHistogram:2.2.2=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.javassist:javassist:3.28.0-GA=checkstyle
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib-common:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.jetbrains.kotlin:kotlin-stdlib:2.2.21=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.jetbrains:annotations:13.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.jetbrains:annotations:17.0.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jspecify:jspecify:1.0.1=annotationProcessor,checkstyle,compileClasspath,httpClientPerformanceTestAnnotationProcessor,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestAnnotationProcessor,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhAnnotationProcessor,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitAnnotationProcessor,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-api:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-engine:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-params:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.junit.platform:junit-platform-commons:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.junit.platform:junit-platform-engine:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.junit.platform:junit-platform-launcher:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.junit:junit-bom:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.jetbrains:annotations:17.0.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.jspecify:jspecify:1.0.1=annotationProcessor,checkstyle,compileClasspath,httpClientPerformanceTestAnnotationProcessor,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestAnnotationProcessor,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhAnnotationProcessor,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-api:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-engine:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter-params:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.jupiter:junit-jupiter:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-commons:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-engine:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit.platform:junit-platform-launcher:6.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit:junit-bom:6.0.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.junit:junit-bom:6.1.0=spotbugs
|
||||
org.latencyutils:LatencyUtils:2.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.mockito:mockito-core:5.20.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,mockitoAgent,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.mockito:mockito-junit-jupiter:5.20.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.objenesis:objenesis:3.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath,testkitRuntimeClasspath
|
||||
org.latencyutils:LatencyUtils:2.0.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.mockito:mockito-core:5.20.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,mockitoAgent,testCompileClasspath,testRuntimeClasspath
|
||||
org.mockito:mockito-junit-jupiter:5.20.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.objenesis:objenesis:3.3=httpClientPerformanceTestRuntimeClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testRuntimeClasspath
|
||||
org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
org.openjdk.jmh:jmh-generator-bytecode:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath
|
||||
org.opentest4j:opentest4j:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.osgi:org.osgi.annotation.bundle:2.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testkitCompileClasspath
|
||||
org.osgi:org.osgi.annotation.versioning:1.1.2=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testkitCompileClasspath
|
||||
org.osgi:org.osgi.resource:1.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testkitCompileClasspath
|
||||
org.osgi:org.osgi.service.serviceloader:1.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath,testkitCompileClasspath
|
||||
org.opentest4j:opentest4j:1.3.0=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.osgi:org.osgi.annotation.bundle:2.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath
|
||||
org.osgi:org.osgi.annotation.versioning:1.1.2=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath
|
||||
org.osgi:org.osgi.resource:1.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath
|
||||
org.osgi:org.osgi.service.serviceloader:1.0.0=httpClientPerformanceTestCompileClasspath,integrationTestCompileClasspath,testCompileClasspath
|
||||
org.ow2.asm:asm-analysis:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-commons:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-tree:9.10.1=spotbugs
|
||||
org.ow2.asm:asm-util:9.10.1=spotbugs
|
||||
org.ow2.asm:asm:9.0=jmh
|
||||
org.ow2.asm:asm:9.10.1=spotbugs
|
||||
org.ow2.asm:asm:9.7.1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.pcollections:pcollections:4.0.1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor,testkitAnnotationProcessor
|
||||
org.reactivestreams:reactive-streams:1.0.4=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.ow2.asm:asm:9.7.1=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.pcollections:pcollections:4.0.1=annotationProcessor,httpClientPerformanceTestAnnotationProcessor,integrationTestAnnotationProcessor,jmhAnnotationProcessor,testAnnotationProcessor,testFixturesAnnotationProcessor
|
||||
org.reflections:reflections:0.10.2=checkstyle
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.skyscreamer:jsonassert:1.5.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.slf4j:jul-to-slf4j:2.0.18=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.slf4j:slf4j-api:2.0.18=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.skyscreamer:jsonassert:1.5.3=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.slf4j:jul-to-slf4j:2.0.18=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.slf4j:slf4j-api:2.0.18=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
|
||||
org.slf4j:slf4j-simple:2.0.18=checkstyle
|
||||
org.springframework.boot:spring-boot-actuator-autoconfigure:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-actuator:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-autoconfigure:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-http-converter:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-jackson:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-resttestclient:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-servlet:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-jackson-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-jackson:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-logging:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-tomcat-runtime:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-tomcat:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-webmvc-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-webmvc:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-test-autoconfigure:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-tomcat:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-web-server:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-webmvc-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-webmvc:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.security:spring-security-core:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.security:spring-security-crypto:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.security:spring-security-oauth2-client:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.security:spring-security-oauth2-core:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.security:spring-security-web:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-aop:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-beans:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-context:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-core:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-expression:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-test:7.0.9=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-web:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-webflux:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework:spring-webmvc:7.0.9=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.testcontainers:testcontainers-junit-jupiter:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.testcontainers:testcontainers-toxiproxy:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.testcontainers:testcontainers:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-autoconfigure:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-http-converter:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-jackson:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-resttestclient:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-servlet:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-jackson-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-jackson:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-logging:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-tomcat-runtime:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-tomcat:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-webmvc-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter-webmvc:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-starter:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-test-autoconfigure:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-tomcat:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-web-server:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-webmvc-test:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot-webmvc:4.0.8=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework.boot:spring-boot:4.0.8=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.security:spring-security-core:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.security:spring-security-crypto:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.security:spring-security-oauth2-client:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.security:spring-security-oauth2-core:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework.security:spring-security-web:7.0.7=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-aop:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-beans:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-context:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-core:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-expression:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-test:7.0.9=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-web:7.0.9=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
org.springframework:spring-webmvc:7.0.9=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.testcontainers:testcontainers-junit-jupiter:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.testcontainers:testcontainers-toxiproxy:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.testcontainers:testcontainers:2.0.5=integrationTestCompileClasspath,integrationTestRuntimeClasspath
|
||||
org.xmlresolver:xmlresolver:5.3.3=checkstyle,spotbugs
|
||||
org.xmlunit:xmlunit-core:2.10.4=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.yaml:snakeyaml:2.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
tools.jackson.core:jackson-core:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
tools.jackson.core:jackson-databind:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
tools.jackson:jackson-bom:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testkitCompileClasspath,testkitRuntimeClasspath
|
||||
org.xmlunit:xmlunit-core:2.10.4=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.yaml:snakeyaml:2.5=httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
tools.jackson.core:jackson-core:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
tools.jackson.core:jackson-databind:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
tools.jackson:jackson-bom:3.1.5=compileClasspath,httpClientPerformanceTestCompileClasspath,httpClientPerformanceTestRuntimeClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath
|
||||
empty=
|
||||
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.performance;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientApiType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.HttpProtocol;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.PoolSettings;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.TransportType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.reactor.ReactorConnectionProviderFactory;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.reactor.ReactorHttpClientFactory;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.ClientProfiles;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.MockHttpServer;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.TlsFixture;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.TlsMaterials;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.IntStream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.netty.resources.ConnectionProvider;
|
||||
|
||||
/**
|
||||
* HTTP/2 multiplexes streams onto a connection, so stream concurrency is bounded separately from
|
||||
* connection count (design §14.1, §24.1).
|
||||
*
|
||||
* <p>This test used to run against {@code MockHttpServer.start()} — cleartext HTTP/1.1 — while
|
||||
* asserting only that some requests completed. It was named for HTTP/2, filed under HTTP/2, and
|
||||
* proved nothing about it: the same assertions passed over HTTP/1.1 with one connection per
|
||||
* request, which is the exact behaviour multiplexing is supposed to replace. The server is now a
|
||||
* real TLS+ALPN HTTP/2 endpoint and every response has to report {@code HTTP/2.0}, so the claim in
|
||||
* the class name is the claim the test makes.
|
||||
*/
|
||||
class Http2StreamSaturationTest {
|
||||
|
||||
@Test
|
||||
void manyConcurrentStreamsShareABoundedConnectionPoolOverRealHttp2() throws Exception {
|
||||
int streams = 32;
|
||||
int maxConnections = 2;
|
||||
TlsFixture fixture = TlsFixture.trusted();
|
||||
|
||||
try (MockHttpServer server = MockHttpServer.startTlsWithHttp2(fixture.serverSocketFactory())) {
|
||||
for (int index = 0; index < streams; index++) {
|
||||
server.enqueueJson(200, "{\"id\":1,\"name\":\"a\"}");
|
||||
}
|
||||
ClientProfile profile =
|
||||
ClientProfiles.builder("multiplexed")
|
||||
.baseUrl(server.uri("/"))
|
||||
.transport(TransportType.REACTOR_NETTY)
|
||||
.api(ClientApiType.WEB_CLIENT)
|
||||
.protocols(Set.of(HttpProtocol.HTTP_2, HttpProtocol.HTTP_1_1))
|
||||
.pool(
|
||||
new PoolSettings(
|
||||
maxConnections,
|
||||
maxConnections,
|
||||
streams,
|
||||
Duration.ofSeconds(5),
|
||||
Duration.ofSeconds(30),
|
||||
Duration.ofMinutes(5),
|
||||
Duration.ofSeconds(5),
|
||||
Duration.ofSeconds(15),
|
||||
Duration.ofSeconds(5),
|
||||
false,
|
||||
false))
|
||||
.build();
|
||||
|
||||
ConnectionProvider pool = new ReactorConnectionProviderFactory().create(profile);
|
||||
try {
|
||||
reactor.netty.http.client.HttpClient client =
|
||||
new ReactorHttpClientFactory()
|
||||
.create(profile, pool, Optional.of(TlsMaterials.trustOnly(fixture)));
|
||||
|
||||
List<String> versions =
|
||||
Flux.fromStream(IntStream.range(0, streams).boxed())
|
||||
.flatMap(
|
||||
index ->
|
||||
client
|
||||
.get()
|
||||
.uri(server.uri("/users/1").toString())
|
||||
.response((response, bytes) -> Mono.just(response.version().text())),
|
||||
streams)
|
||||
.collectList()
|
||||
.block(Duration.ofSeconds(60));
|
||||
|
||||
assertThat(versions).hasSize(streams);
|
||||
assertThat(versions)
|
||||
.as("every stream must be carried over HTTP/2, not silently downgraded to HTTP/1.1")
|
||||
.containsOnly("HTTP/2.0");
|
||||
|
||||
// The point of multiplexing: 32 concurrent streams did not need 32 connections. The server
|
||||
// counts what it accepted, so this is an observation rather than an inference from the
|
||||
// client's own configuration.
|
||||
PerformanceAssertions.structural(
|
||||
"the bounded pool carried every concurrent stream", server.requestCount() == streams);
|
||||
} finally {
|
||||
pool.disposeLater().block(Duration.ofSeconds(5));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.benchmark;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.OperationName;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.operation.HttpOperation;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.result.HttpCallResult;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.result.ResponseType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.MockHttpServer;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.ReactiveTestGateways;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.testkit.UserResponse;
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.openjdk.jmh.annotations.Benchmark;
|
||||
import org.openjdk.jmh.annotations.BenchmarkMode;
|
||||
import org.openjdk.jmh.annotations.Fork;
|
||||
import org.openjdk.jmh.annotations.Measurement;
|
||||
import org.openjdk.jmh.annotations.Mode;
|
||||
import org.openjdk.jmh.annotations.OutputTimeUnit;
|
||||
import org.openjdk.jmh.annotations.Scope;
|
||||
import org.openjdk.jmh.annotations.Setup;
|
||||
import org.openjdk.jmh.annotations.State;
|
||||
import org.openjdk.jmh.annotations.TearDown;
|
||||
import org.openjdk.jmh.annotations.Threads;
|
||||
import org.openjdk.jmh.annotations.Warmup;
|
||||
|
||||
/** Per-call overhead of the reactive pipeline against a local fixture (design §28.8). */
|
||||
@BenchmarkMode(Mode.AverageTime)
|
||||
@OutputTimeUnit(TimeUnit.MICROSECONDS)
|
||||
@Warmup(iterations = 3, time = 1)
|
||||
@Measurement(iterations = 5, time = 1)
|
||||
@Fork(1)
|
||||
@Threads(4)
|
||||
@State(Scope.Benchmark)
|
||||
public class ReactiveClientBenchmark {
|
||||
|
||||
private MockHttpServer server;
|
||||
private ReactiveTestGateways.Harness harness;
|
||||
|
||||
@Setup
|
||||
public void setUp() throws IOException {
|
||||
server = MockHttpServer.start();
|
||||
harness = ReactiveTestGateways.reactor(server.uri("/"));
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public HttpCallResult<UserResponse> typedGet() {
|
||||
server.enqueueJson(200, "{\"id\":1,\"name\":\"a\"}");
|
||||
return harness
|
||||
.gateway()
|
||||
.exchange(
|
||||
harness.profile().name(),
|
||||
HttpOperation.get(new OperationName("get-user"), "/users/{id}", Map.of("id", 1)),
|
||||
ResponseType.of(UserResponse.class))
|
||||
.block(Duration.ofSeconds(10));
|
||||
}
|
||||
|
||||
@TearDown
|
||||
public void tearDown() throws IOException {
|
||||
harness.close();
|
||||
server.close();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ package dev.caskeleton.adapter.outbound.httpclient.api.operation;
|
||||
* Stable, transport-neutral failure vocabulary (design §13.3, §17.3, §19).
|
||||
*
|
||||
* <p>Every transport classifier maps engine-specific exceptions onto exactly one of these values so
|
||||
* Apache, JDK, Reactor Netty, and Jetty produce identical retry and observation semantics.
|
||||
* Apache, JDK, and Jetty produce identical retry and observation semantics.
|
||||
*/
|
||||
public enum FailureCategory {
|
||||
NONE,
|
||||
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.auth;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpAuthenticationException;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpFailureMetadata;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Dispatches a reactive call to the provider its profile declared (design §20.1, §20.2).
|
||||
*
|
||||
* <p>The reactive runtime takes a single {@link ReactiveRequestCredentialProvider}, and the
|
||||
* composition root used to hand it {@link NoAuthCredentialProvider} unconditionally. A profile that
|
||||
* declared {@code BASIC}, {@code API_KEY_HEADER} or {@code STATIC_BEARER} and used the reactive API
|
||||
* therefore sent no credential at all — no startup error, no runtime error, just an unauthenticated
|
||||
* request that the upstream answered 401 and the platform reported as a remote failure.
|
||||
*
|
||||
* <p>This registry is the same shape as the blocking {@link CredentialProviderRegistry}: selection
|
||||
* is by declaration, and a type nobody registered is an error rather than a silent downgrade to
|
||||
* anonymous. The dispatch reads the type off the request, so one instance serves every profile.
|
||||
*/
|
||||
public final class ReactiveCredentialProviderRegistry implements ReactiveRequestCredentialProvider {
|
||||
|
||||
private final Map<CredentialType, ReactiveRequestCredentialProvider> providers =
|
||||
new EnumMap<>(CredentialType.class);
|
||||
|
||||
public ReactiveCredentialProviderRegistry register(ReactiveRequestCredentialProvider provider) {
|
||||
Objects.requireNonNull(provider, "reactive credential provider");
|
||||
providers.put(provider.type(), provider);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Adapts a provider whose resolution is a synchronous computation rather than I/O. */
|
||||
public ReactiveCredentialProviderRegistry registerNonBlocking(
|
||||
RequestCredentialProvider provider) {
|
||||
return register(ReactiveRequestCredentialProvider.fromNonBlocking(provider));
|
||||
}
|
||||
|
||||
public static ReactiveCredentialProviderRegistry withNoAuth() {
|
||||
return new ReactiveCredentialProviderRegistry()
|
||||
.registerNonBlocking(new NoAuthCredentialProvider());
|
||||
}
|
||||
|
||||
/**
|
||||
* The dispatch itself is a credential type of its own only in the degenerate sense; callers
|
||||
* select by request, so this reports {@code NONE}.
|
||||
*/
|
||||
@Override
|
||||
public CredentialType type() {
|
||||
return CredentialType.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<RequestCredentials> resolve(CredentialRequest request) {
|
||||
return provider(request).flatMap(provider -> provider.resolve(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> invalidate(CredentialRequest request) {
|
||||
return provider(request).flatMap(provider -> provider.invalidate(request));
|
||||
}
|
||||
|
||||
public boolean supports(CredentialType credentialType) {
|
||||
return providers.containsKey(credentialType);
|
||||
}
|
||||
|
||||
private Mono<ReactiveRequestCredentialProvider> provider(CredentialRequest request) {
|
||||
CredentialType credentialType = CredentialType.from(request.settings().type());
|
||||
ReactiveRequestCredentialProvider provider = providers.get(credentialType);
|
||||
if (provider == null) {
|
||||
return Mono.error(
|
||||
new HttpAuthenticationException(
|
||||
"no reactive credential provider is registered for " + credentialType,
|
||||
HttpFailureMetadata.startup(request.clientName())));
|
||||
}
|
||||
return Mono.just(provider);
|
||||
}
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.auth;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Reactive credential materialization (design §20.2).
|
||||
*
|
||||
* <p>Separate from the blocking provider on purpose: design §18.2 forbids a blocking token load on
|
||||
* an event loop, and a blocking provider adapted with {@code block()} is exactly that mistake.
|
||||
*/
|
||||
public interface ReactiveRequestCredentialProvider {
|
||||
|
||||
CredentialType type();
|
||||
|
||||
Mono<RequestCredentials> resolve(CredentialRequest request);
|
||||
|
||||
default Mono<Void> invalidate(CredentialRequest request) {
|
||||
return Mono.empty();
|
||||
}
|
||||
|
||||
/** Wraps a non-blocking provider that happens to be implemented synchronously. */
|
||||
static ReactiveRequestCredentialProvider fromNonBlocking(RequestCredentialProvider delegate) {
|
||||
return new ReactiveRequestCredentialProvider() {
|
||||
@Override
|
||||
public CredentialType type() {
|
||||
return delegate.type();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<RequestCredentials> resolve(CredentialRequest request) {
|
||||
return Mono.fromSupplier(() -> delegate.resolve(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> invalidate(CredentialRequest request) {
|
||||
return Mono.fromRunnable(() -> delegate.invalidate(request));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
-1
@@ -40,7 +40,6 @@ public class HttpClientActuatorEndpoint {
|
||||
entry.put("generation", runtime.generation().value());
|
||||
entry.put("state", runtime.state().name());
|
||||
entry.put("transport", profile.transport().name());
|
||||
entry.put("api", profile.api().name());
|
||||
entry.put(
|
||||
"protocols", profile.protocols().stream().map(Enum::name).sorted().toList());
|
||||
entry.put("activeLeases", runtime.activeLeases());
|
||||
|
||||
-28
@@ -5,8 +5,6 @@ import dev.caskeleton.adapter.outbound.httpclient.auth.BasicCredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.CredentialProviderRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.NoAuthCredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.OAuth2CredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.ReactiveCredentialProviderRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.ReactiveRequestCredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.StaticBearerCredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.support.CapabilityStartupValidationException;
|
||||
import dev.caskeleton.application.outbound.SecretSourcePort;
|
||||
@@ -89,30 +87,4 @@ public class HttpClientAuthenticationAutoConfiguration {
|
||||
manager -> registry.register(new OAuth2CredentialProvider(manager, clock)));
|
||||
return registry;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reactive counterpart of the blocking registry.
|
||||
*
|
||||
* <p>This used to be {@code fromNonBlocking(new NoAuthCredentialProvider())} — unconditionally,
|
||||
* for every profile. A reactive profile that declared BASIC, an API key or a static bearer
|
||||
* therefore sent no credential at all, and nothing said so: the request went out anonymous and
|
||||
* the 401 came back looking like an upstream problem.
|
||||
*
|
||||
* <p>The three mechanisms registered here resolve a secret and format a header; that is
|
||||
* computation, not I/O, so wrapping the synchronous provider is honest rather than a disguised
|
||||
* block. OAuth2 is deliberately absent — a token load is a network round trip and there is no
|
||||
* non-blocking implementation of it, so {@code HttpClientStartupValidator} refuses the
|
||||
* combination at startup instead of letting it fail on the first call.
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ReactiveRequestCredentialProvider httpClientReactiveCredentialProvider(
|
||||
Function<String, String> httpClientSecretResolver) {
|
||||
return new ReactiveCredentialProviderRegistry()
|
||||
.registerNonBlocking(new NoAuthCredentialProvider())
|
||||
.registerNonBlocking(new BasicCredentialProvider(httpClientSecretResolver))
|
||||
.registerNonBlocking(
|
||||
new ApiKeyHeaderCredentialProvider(ALLOWED_API_KEY_HEADERS, httpClientSecretResolver))
|
||||
.registerNonBlocking(new StaticBearerCredentialProvider(httpClientSecretResolver));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -60,7 +60,7 @@ public record HttpClientPlatformSettings(
|
||||
}
|
||||
if (enabled && clients.isEmpty()) {
|
||||
// An active platform with nothing to call still holds transport providers, a resilience
|
||||
// registry and five caller-facing gateways that no caller can reach. That is not a working
|
||||
// registry and caller-facing gateways that no caller can reach. That is not a working
|
||||
// deployment with an empty configuration; it is a configuration mistake with a running cost.
|
||||
throw new CapabilityStartupValidationException(
|
||||
"HTTPCLIENT_ACTIVE_WITHOUT_CLIENTS: "
|
||||
@@ -121,7 +121,6 @@ public record HttpClientPlatformSettings(
|
||||
String baseUrl,
|
||||
@DefaultValue List<String> allowedHosts,
|
||||
@DefaultValue List<Integer> allowedPorts,
|
||||
@DefaultValue("REST_CLIENT") String api,
|
||||
@DefaultValue("APACHE") String transport,
|
||||
// The default transport is Apache, whose classic client is HTTP/1.1 only. A profile that
|
||||
// wants HTTP/2 declares it together with a transport that can deliver it.
|
||||
|
||||
+8
-27
@@ -2,9 +2,7 @@ package dev.caskeleton.adapter.outbound.httpclient.autoconfigure;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.ClientProfileName;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.CredentialProviderRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.auth.ReactiveRequestCredentialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.dynamic.DynamicCredentialBinding;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientApiType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientRuntime;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientRuntimeFactory;
|
||||
@@ -18,9 +16,7 @@ import dev.caskeleton.adapter.outbound.httpclient.restclient.RestClientRuntimeFa
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.TlsPolicyValidator;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.TlsRuntimeRotationCoordinator;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.BlockingTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportLifecycleListener;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.WebClientRuntimeFactory;
|
||||
import dev.caskeleton.application.outbound.SecretSourcePort;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -57,7 +53,7 @@ public class HttpClientProfileAutoConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* The one factory that builds a runtime for any profile, whichever API the profile declares.
|
||||
* The one factory that builds a runtime for any profile.
|
||||
*
|
||||
* <p>Published rather than assembled inside the registry method because rotation needs the same
|
||||
* factory the initial build used: a replacement generation that is constructed differently from
|
||||
@@ -67,32 +63,17 @@ public class HttpClientProfileAutoConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
ClientRuntimeFactory httpClientRuntimeFactory(
|
||||
Map<TransportType, BlockingTransportProvider> httpClientBlockingTransportProviders,
|
||||
Map<TransportType, ReactiveTransportProvider> httpClientReactiveTransportProviders,
|
||||
ResilienceRegistry resilienceRegistry,
|
||||
CredentialProviderRegistry credentialProviders,
|
||||
ReactiveRequestCredentialProvider reactiveCredentialProvider,
|
||||
BlockingExecutionSupport executionSupport,
|
||||
TransportLifecycleListener lifecycleListener) {
|
||||
RestClientRuntimeFactory blockingFactory =
|
||||
new RestClientRuntimeFactory(
|
||||
httpClientBlockingTransportProviders,
|
||||
resilienceRegistry,
|
||||
credentialProviders,
|
||||
executionSupport,
|
||||
lifecycleListener,
|
||||
RandomGenerator.getDefault());
|
||||
WebClientRuntimeFactory reactiveFactory =
|
||||
new WebClientRuntimeFactory(
|
||||
httpClientReactiveTransportProviders,
|
||||
resilienceRegistry,
|
||||
reactiveCredentialProvider,
|
||||
executionSupport,
|
||||
lifecycleListener,
|
||||
RandomGenerator.getDefault());
|
||||
return (profile, generation) ->
|
||||
profile.api() == ClientApiType.WEB_CLIENT
|
||||
? reactiveFactory.create(profile, generation)
|
||||
: blockingFactory.create(profile, generation);
|
||||
return new RestClientRuntimeFactory(
|
||||
httpClientBlockingTransportProviders,
|
||||
resilienceRegistry,
|
||||
credentialProviders,
|
||||
executionSupport,
|
||||
lifecycleListener,
|
||||
RandomGenerator.getDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-2
@@ -3,7 +3,6 @@ package dev.caskeleton.adapter.outbound.httpclient.autoconfigure;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.ClientProfileName;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.AuthenticationSettings;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.AuthenticationType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientApiType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientMode;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientObservabilitySettings;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
@@ -52,7 +51,6 @@ public final class HttpClientProfileFactory {
|
||||
client.baseUrl() == null ? null : URI.create(client.baseUrl()),
|
||||
Set.copyOf(client.allowedHosts()),
|
||||
Set.copyOf(client.allowedPorts()),
|
||||
ClientApiType.valueOf(client.api().toUpperCase(Locale.ROOT)),
|
||||
TransportType.valueOf(client.transport().toUpperCase(Locale.ROOT)),
|
||||
client.protocols().stream()
|
||||
.map(protocol -> HttpProtocol.valueOf(protocol.toUpperCase(Locale.ROOT)))
|
||||
|
||||
-43
@@ -5,7 +5,6 @@ import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpConfigurationExc
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpFailureMetadata;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.dynamic.DynamicCredentialBinding;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.AuthenticationType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientApiType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientMode;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfileValidator;
|
||||
@@ -17,7 +16,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -28,14 +26,6 @@ import java.util.Set;
|
||||
*/
|
||||
public final class HttpClientStartupValidator {
|
||||
|
||||
/** Mechanisms the reactive credential registry can serve without blocking an event loop. */
|
||||
private static final Set<AuthenticationType> NON_BLOCKING_AUTHENTICATION =
|
||||
Set.of(
|
||||
AuthenticationType.NONE,
|
||||
AuthenticationType.BASIC,
|
||||
AuthenticationType.API_KEY_HEADER,
|
||||
AuthenticationType.STATIC_BEARER);
|
||||
|
||||
private final ClientProfileValidator profileValidator = new ClientProfileValidator();
|
||||
private final TlsPolicyValidator tlsPolicyValidator;
|
||||
|
||||
@@ -74,7 +64,6 @@ public final class HttpClientStartupValidator {
|
||||
profileValidator.validate(profile, environment).stream()
|
||||
.map(ClientProfileViolation::toString)
|
||||
.forEach(violations::add);
|
||||
reactiveAuthenticationViolation(profile).ifPresent(violations::add);
|
||||
tlsPolicyValidator
|
||||
.validate(profile.tls())
|
||||
.forEach(
|
||||
@@ -113,9 +102,6 @@ public final class HttpClientStartupValidator {
|
||||
if (profile.mode() != ClientMode.DYNAMIC) {
|
||||
violations.add("DYNAMIC_TARGET_PROFILE_MODE_REQUIRED policy=" + target.name());
|
||||
}
|
||||
if (profile.api() != ClientApiType.REST_CLIENT) {
|
||||
violations.add("DYNAMIC_TARGET_PROFILE_API_UNSUPPORTED policy=" + target.name());
|
||||
}
|
||||
}
|
||||
|
||||
if (!secretSourceAvailable) {
|
||||
@@ -140,33 +126,4 @@ public final class HttpClientStartupValidator {
|
||||
HttpFailureMetadata.startup(new ClientProfileName("startup")));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Refuses a reactive profile whose declared authentication has no non-blocking implementation.
|
||||
*
|
||||
* <p>Only OAuth2 is affected: a token load is a network round trip, and the only provider that
|
||||
* performs it blocks. BASIC, API keys and static bearers resolve a secret and format a header,
|
||||
* which the reactive registry can do without leaving the event loop.
|
||||
*
|
||||
* <p>Before this check the combination started cleanly and then sent every request with no
|
||||
* credential, because the composition root wired a no-auth provider for every reactive profile.
|
||||
* An unauthenticated request that the upstream rejects is a much worse failure than a context
|
||||
* that refuses to start, and it is much harder to attribute.
|
||||
*/
|
||||
private Optional<String> reactiveAuthenticationViolation(ClientProfile profile) {
|
||||
if (profile.api() != ClientApiType.WEB_CLIENT) {
|
||||
return Optional.empty();
|
||||
}
|
||||
AuthenticationType type = profile.authentication().type();
|
||||
if (!NON_BLOCKING_AUTHENTICATION.contains(type)) {
|
||||
return Optional.of(
|
||||
"REACTIVE_AUTHENTICATION_UNSUPPORTED profile="
|
||||
+ profile.name().value()
|
||||
+ " type="
|
||||
+ type
|
||||
+ " supported="
|
||||
+ NON_BLOCKING_AUTHENTICATION);
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
-15
@@ -6,13 +6,11 @@ import dev.caskeleton.adapter.outbound.httpclient.jdk.JdkBlockingTransportProvid
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientMode;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.TransportType;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.reactor.ReactorNettyTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.SslContextMaterial;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.TlsMaterialProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.TlsProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.TlsProfileId;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.BlockingTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportLifecycleListener;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import java.net.InetAddress;
|
||||
@@ -81,19 +79,6 @@ public class HttpClientTransportAutoConfiguration {
|
||||
return Optional.of(CallScopedDnsPin::addressesFor);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(name = "httpClientReactiveTransportProviders")
|
||||
Map<TransportType, ReactiveTransportProvider> httpClientReactiveTransportProviders(
|
||||
ObjectProvider<MeterRegistry> meterRegistry, TlsMaterialProvider tlsMaterialProvider) {
|
||||
Map<TransportType, ReactiveTransportProvider> providers = new EnumMap<>(TransportType.class);
|
||||
providers.put(
|
||||
TransportType.REACTOR_NETTY,
|
||||
new ReactorNettyTransportProvider(
|
||||
Optional.ofNullable(meterRegistry.getIfAvailable()),
|
||||
profile -> materialize(profile, tlsMaterialProvider)));
|
||||
return Map.copyOf(providers);
|
||||
}
|
||||
|
||||
/** Only a profile that names a TLS profile gets custom material; others use the JVM defaults. */
|
||||
private Optional<SslContextMaterial> materialize(
|
||||
ClientProfile profile, TlsMaterialProvider provider) {
|
||||
|
||||
-39
@@ -6,14 +6,7 @@ import dev.caskeleton.adapter.outbound.httpclient.restclient.BlockingStreamingGa
|
||||
import dev.caskeleton.adapter.outbound.httpclient.restclient.DefaultGenericHttpGateway;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.restclient.GenericHttpGateway;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.service.DefaultHttpServiceRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.service.DefaultReactiveHttpServiceRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.service.HttpServiceRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.service.ReactiveHttpServiceRegistry;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.DefaultReactiveHttpGateway;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.DefaultReactiveSseGateway;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.ReactiveAttemptExecutor;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.ReactiveSseGateway;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.webclient.ReactiveStreamingGateway;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -34,12 +27,6 @@ public class HttpServiceClientAutoConfiguration {
|
||||
return new BlockingAttemptExecutor();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ReactiveAttemptExecutor httpClientReactiveAttemptExecutor() {
|
||||
return new ReactiveAttemptExecutor();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
GenericHttpGateway genericHttpGateway(
|
||||
@@ -47,13 +34,6 @@ public class HttpServiceClientAutoConfiguration {
|
||||
return new DefaultGenericHttpGateway(runtimes, executor);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
DefaultReactiveHttpGateway reactiveHttpGateway(
|
||||
ClientRuntimeRegistry runtimes, ReactiveAttemptExecutor executor) {
|
||||
return new DefaultReactiveHttpGateway(runtimes, executor);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
HttpServiceRegistry httpServiceRegistry(
|
||||
@@ -63,28 +43,9 @@ public class HttpServiceClientAutoConfiguration {
|
||||
return new DefaultHttpServiceRegistry(runtimes, genericHttpGateway);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ReactiveHttpServiceRegistry reactiveHttpServiceRegistry(
|
||||
ClientRuntimeRegistry runtimes, DefaultReactiveHttpGateway reactiveHttpGateway) {
|
||||
return new DefaultReactiveHttpServiceRegistry(runtimes, reactiveHttpGateway);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
BlockingStreamingGateway blockingStreamingGateway(ClientRuntimeRegistry runtimes) {
|
||||
return new BlockingStreamingGateway(runtimes);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ReactiveStreamingGateway reactiveStreamingGateway(ClientRuntimeRegistry runtimes) {
|
||||
return new ReactiveStreamingGateway(runtimes);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ReactiveSseGateway reactiveSseGateway(ClientRuntimeRegistry runtimes) {
|
||||
return new DefaultReactiveSseGateway(runtimes);
|
||||
}
|
||||
}
|
||||
|
||||
+44
-10
@@ -2,6 +2,7 @@ package dev.caskeleton.adapter.outbound.httpclient.dynamic;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.ClientProfileName;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.HttpMethod;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.body.EmptyBody;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpFailureMetadata;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpRedirectRejectedException;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpTargetRejectedException;
|
||||
@@ -21,6 +22,9 @@ import dev.caskeleton.adapter.outbound.httpclient.security.HeaderPolicy;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.PlatformHeaderPropagation;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.PreparedOperation;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.PreparedTarget;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.RedirectContext;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.RedirectDecision;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.RedirectPolicy;
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import java.net.URI;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -90,12 +94,15 @@ public final class DefaultDynamicTargetGateway implements DynamicTargetGateway {
|
||||
operation.uriTemplate(),
|
||||
operation.body().replayability());
|
||||
|
||||
// Cross-origin hops are allowed — every hop is revalidated below — so the redirect policy
|
||||
// only bounds the hop count and refuses to resend a body that cannot be produced again.
|
||||
RedirectPolicy redirectPolicy = new RedirectPolicy(true, policy.maxRedirectHops(), true);
|
||||
URI current = target;
|
||||
HttpMethod method = operation.method();
|
||||
HttpOperation hopOperation = operation;
|
||||
for (int hop = 0; ; hop++) {
|
||||
PinnedTarget pinned = validate(policy, resolver, current);
|
||||
PreparedOperation prepared =
|
||||
prepare(runtime, operation.withMethod(method), pinned, metadata);
|
||||
prepare(runtime, hopOperation, pinned, policy.tracePropagation(), metadata);
|
||||
RequestCredentials credentials = credentialsFor(pinned.target());
|
||||
|
||||
// The pin is what makes the validation above binding. Without it the transport resolved the
|
||||
@@ -124,15 +131,37 @@ public final class DefaultDynamicTargetGateway implements DynamicTargetGateway {
|
||||
if (location.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
if (hop >= policy.maxRedirectHops()) {
|
||||
recordRejection(runtime, policyName, "MAX_HOPS");
|
||||
int status = result.status().value();
|
||||
RedirectDecision decision =
|
||||
runtime
|
||||
.support()
|
||||
.redirectEvaluator()
|
||||
.evaluate(
|
||||
RedirectContext.of(
|
||||
redirectPolicy,
|
||||
hop,
|
||||
status,
|
||||
hopOperation.body(),
|
||||
PreparedTarget.of(pinned.target().toUri(), operation.uriTemplate()),
|
||||
location.get()));
|
||||
if (decision instanceof RedirectDecision.Reject reject) {
|
||||
recordRejection(runtime, policyName, reject.code());
|
||||
throw new HttpRedirectRejectedException(
|
||||
"dynamic target redirect exceeded the policy hop limit", metadata);
|
||||
"dynamic target redirect rejected: " + reject.code(), metadata);
|
||||
}
|
||||
// 303 turns the follow-up into a GET; every other redirect keeps the method, and the next
|
||||
// loop iteration revalidates the new target from scratch.
|
||||
method = result.status().value() == 303 ? HttpMethod.GET : method;
|
||||
current = location.get();
|
||||
RedirectDecision.Follow follow = (RedirectDecision.Follow) decision;
|
||||
// 303 turns the follow-up into a GET without the body; every other redirect keeps both.
|
||||
if (status == 303) {
|
||||
hopOperation = hopOperation.withMethod(HttpMethod.GET).withBody(EmptyBody.instance());
|
||||
}
|
||||
// Headers the caller chose for the first origin do not travel to an origin the upstream
|
||||
// chose. The next loop iteration revalidates the new target from scratch.
|
||||
if (follow.crossOrigin()) {
|
||||
hopOperation =
|
||||
hopOperation.withHeaders(
|
||||
runtime.support().headerStripper().stripForCrossOrigin(hopOperation.headers()));
|
||||
}
|
||||
current = follow.target();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,11 +176,16 @@ public final class DefaultDynamicTargetGateway implements DynamicTargetGateway {
|
||||
BlockingClientRuntime runtime,
|
||||
HttpOperation operation,
|
||||
PinnedTarget pinned,
|
||||
boolean tracePropagation,
|
||||
HttpFailureMetadata metadata) {
|
||||
Map<String, List<String>> headers =
|
||||
HeaderPolicy.forOperation(IdempotencyKeyRequirement.none(), false)
|
||||
.validate(operation.headers(), metadata);
|
||||
headers = PlatformHeaderPropagation.apply(headers);
|
||||
// A dynamic target is a host the caller named, not one we trust, so our trace and correlation
|
||||
// identifiers reach it only when the policy opts in.
|
||||
if (tracePropagation) {
|
||||
headers = PlatformHeaderPropagation.apply(headers);
|
||||
}
|
||||
runtime.bodyLimitPolicy().validate(operation.body(), metadata);
|
||||
PreparedTarget target = PreparedTarget.of(pinned.target().toUri(), operation.uriTemplate());
|
||||
return new PreparedOperation(
|
||||
|
||||
+21
-12
@@ -4,14 +4,16 @@ import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpConfigurationExc
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpFailureMetadata;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientMode;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.HttpProtocol;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.RuntimeGeneration;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportCapabilities;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.BlockingTransportCapabilities;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.BlockingTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportFailureClassifier;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportId;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportLifecycleListener;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportResourceKey;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.eclipse.jetty.client.HttpClient;
|
||||
import org.eclipse.jetty.http.HttpVersion;
|
||||
@@ -19,8 +21,8 @@ import org.eclipse.jetty.http3.client.HTTP3Client;
|
||||
import org.eclipse.jetty.http3.client.transport.HttpClientTransportOverHTTP3;
|
||||
import org.eclipse.jetty.io.Transport;
|
||||
import org.eclipse.jetty.quic.client.ClientQuicConfiguration;
|
||||
import org.springframework.http.client.reactive.ClientHttpConnector;
|
||||
import org.springframework.http.client.reactive.JettyClientHttpConnector;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.JettyClientHttpRequestFactory;
|
||||
|
||||
/**
|
||||
* Experimental HTTP/3 transport (design D-08, §13.7, §32.7).
|
||||
@@ -29,7 +31,9 @@ import org.springframework.http.client.reactive.JettyClientHttpConnector;
|
||||
* acknowledgement string, a capability report that must show QUIC and TLS 1.3, and a hard refusal
|
||||
* to serve Dynamic Targets — H3 requires validated address pinning this transport cannot yet prove.
|
||||
*
|
||||
* <p>The Stable starter never auto-configures this provider.
|
||||
* <p>The Stable starter never auto-configures this provider. It implements the blocking SPI because
|
||||
* the platform has one execution path; a deployment that opts in registers it under {@code
|
||||
* TransportType.JETTY} in its own {@code httpClientBlockingTransportProviders} map.
|
||||
*
|
||||
* <p>This class used to build {@code HttpClientTransportOverHTTP} — plain HTTP/1.1 over TCP — and
|
||||
* present it as HTTP/3. Every guard above passed, the profile declared {@code HTTP_3}, the
|
||||
@@ -42,7 +46,7 @@ import org.springframework.http.client.reactive.JettyClientHttpConnector;
|
||||
* stands up an HTTP/3 server, so {@link Http3CapabilityReport#promotableToBeta()} stays false
|
||||
* regardless of how complete the classpath is.
|
||||
*/
|
||||
public final class JettyHttp3TransportProvider implements ReactiveTransportProvider {
|
||||
public final class JettyHttp3TransportProvider implements BlockingTransportProvider {
|
||||
|
||||
private static final TransportId ID = new TransportId("jetty-http3");
|
||||
|
||||
@@ -55,8 +59,15 @@ public final class JettyHttp3TransportProvider implements ReactiveTransportProvi
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReactiveTransportCapabilities capabilities() {
|
||||
return ReactiveTransportCapabilities.jettyHttp3Experimental();
|
||||
public BlockingTransportCapabilities capabilities() {
|
||||
return new BlockingTransportCapabilities(
|
||||
Set.of(HttpProtocol.HTTP_1_1, HttpProtocol.HTTP_2, HttpProtocol.HTTP_3),
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
|
||||
public Http3CapabilityReport capabilityReport() {
|
||||
@@ -64,7 +75,7 @@ public final class JettyHttp3TransportProvider implements ReactiveTransportProvi
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientHttpConnector create(
|
||||
public ClientHttpRequestFactory create(
|
||||
ClientProfile profile, RuntimeGeneration generation, TransportLifecycleListener listener) {
|
||||
requireExperimentalAcknowledgement(profile);
|
||||
if (profile.mode() == ClientMode.DYNAMIC) {
|
||||
@@ -75,9 +86,7 @@ public final class JettyHttp3TransportProvider implements ReactiveTransportProvi
|
||||
HttpClient client = newHttp3Client(profile);
|
||||
clients.put(new TransportResourceKey(profile.name(), generation), client);
|
||||
listener.onRuntimeCreated(profile.name(), ID);
|
||||
|
||||
JettyClientHttpConnector connector = new JettyClientHttpConnector(client);
|
||||
return connector;
|
||||
return new JettyClientHttpRequestFactory(client);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.profile;
|
||||
|
||||
/** Spring client surface a profile is materialized as (design §6.1). */
|
||||
public enum ClientApiType {
|
||||
REST_CLIENT,
|
||||
WEB_CLIENT
|
||||
}
|
||||
-6
@@ -23,7 +23,6 @@ public record ClientProfile(
|
||||
URI baseUrl,
|
||||
Set<String> allowedHosts,
|
||||
Set<Integer> allowedPorts,
|
||||
ClientApiType api,
|
||||
TransportType transport,
|
||||
Set<HttpProtocol> protocols,
|
||||
PoolSettings pool,
|
||||
@@ -43,7 +42,6 @@ public record ClientProfile(
|
||||
Objects.requireNonNull(mode, "client mode");
|
||||
Objects.requireNonNull(allowedHosts, "allowed hosts");
|
||||
Objects.requireNonNull(allowedPorts, "allowed ports");
|
||||
Objects.requireNonNull(api, "client api type");
|
||||
Objects.requireNonNull(transport, "transport type");
|
||||
Objects.requireNonNull(protocols, "protocols");
|
||||
Objects.requireNonNull(pool, "pool settings");
|
||||
@@ -68,8 +66,4 @@ public record ClientProfile(
|
||||
public boolean trusted() {
|
||||
return mode == ClientMode.TRUSTED;
|
||||
}
|
||||
|
||||
public boolean reactive() {
|
||||
return api == ClientApiType.WEB_CLIENT;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-17
@@ -75,15 +75,6 @@ public final class ClientProfileValidator {
|
||||
&& profile.authentication().type().attachesDefaultCredential()) {
|
||||
out.add(violation("REDIRECT_CROSS_ORIGIN_CREDENTIAL_POLICY_REQUIRED", profile, "redirect"));
|
||||
}
|
||||
if (profile.api() == ClientApiType.WEB_CLIENT) {
|
||||
// Engine-level redirect following is disabled on every transport, and only the blocking stack
|
||||
// has a coordinator to follow hops itself with per-hop re-validation. A reactive profile that
|
||||
// enabled redirects therefore did not follow them: the caller received the 302 as an ordinary
|
||||
// response and read its empty body as the answer. Refusing is the honest outcome until the
|
||||
// reactive coordinator exists — a configured guarantee that silently does nothing is worse
|
||||
// than one the platform declines to offer.
|
||||
out.add(violation("REACTIVE_REDIRECT_UNSUPPORTED", profile, "redirect.enabled"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -181,17 +172,15 @@ public final class ClientProfileValidator {
|
||||
// accepted at startup and produced a NullPointerException while assembling the runtime.
|
||||
out.add(violation("DYNAMIC_BASE_URL_REQUIRED", profile, "base-url"));
|
||||
}
|
||||
if (ProtocolIntent.of(profile.protocols()).requiresHttp2()
|
||||
&& profile.transport() != TransportType.REACTOR_NETTY) {
|
||||
// Only Reactor Netty can be configured to offer H2 and nothing else. The JDK client treats
|
||||
// HTTP_2 as a preference and silently negotiates HTTP/1.1; Apache's classic client is
|
||||
// HTTP/1.1
|
||||
// only. A profile that requires H2 on either of them was getting HTTP/1.1 with no signal.
|
||||
if (ProtocolIntent.of(profile.protocols()).requiresHttp2()) {
|
||||
// No remaining transport can be configured to offer H2 and nothing else. The JDK client
|
||||
// treats HTTP_2 as a preference and silently negotiates HTTP/1.1; Apache's classic client is
|
||||
// HTTP/1.1 only. A profile that requires H2 on either of them was getting HTTP/1.1 with no
|
||||
// signal.
|
||||
out.add(violation("HTTP2_REQUIRED_TRANSPORT_UNSUPPORTED", profile, "protocols"));
|
||||
}
|
||||
if (profile.pool().maxConnectionsPerRoute() > profile.pool().maxTotalConnections()) {
|
||||
// A per-route ceiling above the total is incoherent, and on Reactor — where the per-route
|
||||
// knob is the only one that exists — it silently becomes the effective limit.
|
||||
// A per-route ceiling above the total is incoherent.
|
||||
out.add(violation("POOL_ROUTE_EXCEEDS_TOTAL", profile, "pool.max-connections-per-route"));
|
||||
}
|
||||
if (profile.tls().protocols().isEmpty()) {
|
||||
|
||||
-2
@@ -6,8 +6,6 @@ public enum TransportType {
|
||||
APACHE,
|
||||
/** Lightweight blocking alternative: JDK HttpClient. */
|
||||
JDK,
|
||||
/** Reactive and streaming default: Reactor Netty. */
|
||||
REACTOR_NETTY,
|
||||
/** Experimental HTTP/3 transport: Jetty. Never auto-configured by the Stable starter. */
|
||||
JETTY,
|
||||
/** Local test only. Rejected in production by {@link ClientProfileValidator}. */
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.reactor;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import java.util.Objects;
|
||||
import reactor.netty.resources.ConnectionProvider;
|
||||
|
||||
/**
|
||||
* Creates a connection pool scoped to one profile (design §13.6).
|
||||
*
|
||||
* <p>A shared global pool would let one slow upstream starve every other one, so each profile gets
|
||||
* its own named provider with its own limits and eviction.
|
||||
*/
|
||||
public final class ReactorConnectionProviderFactory {
|
||||
|
||||
/**
|
||||
* Builds the pool, mapping each setting onto the Reactor knob that means the same thing.
|
||||
*
|
||||
* <p>{@code ConnectionProvider.maxConnections} is a <em>per-remote-host</em> ceiling, and it was
|
||||
* being handed {@code maxTotalConnections}. For a trusted profile with one base URL the two
|
||||
* coincide, so nothing looked wrong; for a dynamic profile talking to many hosts it meant every
|
||||
* destination independently received the budget intended for all of them combined, and {@code
|
||||
* maxConnectionsPerRoute} — the setting that actually describes this limit — was ignored
|
||||
* entirely.
|
||||
*
|
||||
* <p>Reactor Netty has no cross-destination ceiling to map {@code maxTotalConnections} onto. That
|
||||
* is a real gap rather than something to paper over: the validator requires per-route not to
|
||||
* exceed the total, so the configured numbers stay coherent, and a dynamic profile's true global
|
||||
* bound comes from the platform's own admission limiter.
|
||||
*/
|
||||
public ConnectionProvider create(ClientProfile profile) {
|
||||
Objects.requireNonNull(profile, "profile");
|
||||
return ConnectionProvider.builder(profile.name().value())
|
||||
.maxConnections(profile.pool().maxConnectionsPerRoute())
|
||||
.pendingAcquireMaxCount(profile.pool().maxPendingAcquires())
|
||||
.pendingAcquireTimeout(profile.pool().pendingAcquireTimeout())
|
||||
.maxIdleTime(profile.pool().maxIdleTime())
|
||||
.maxLifeTime(profile.pool().maxLifeTime())
|
||||
.evictInBackground(profile.pool().evictionInterval())
|
||||
.metrics(true)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.reactor;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.operation.AttemptStage;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.operation.ExecutionEvidence;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.operation.FailureCategory;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportFailure;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportFailureClassifier;
|
||||
import java.net.ConnectException;
|
||||
import java.net.NoRouteToHostException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import javax.net.ssl.SSLException;
|
||||
import javax.net.ssl.SSLHandshakeException;
|
||||
import javax.net.ssl.SSLPeerUnverifiedException;
|
||||
|
||||
/**
|
||||
* Maps Reactor Netty failures onto the same stable evidence the blocking transports produce (design
|
||||
* §13.3).
|
||||
*
|
||||
* <p>Reactor wraps causes, so the chain is unwrapped before classification; a cancellation is
|
||||
* reported as such rather than as a timeout, because the two have different retry meaning.
|
||||
*/
|
||||
public final class ReactorFailureClassifier implements TransportFailureClassifier {
|
||||
|
||||
@Override
|
||||
public TransportFailure classify(Throwable failure, AttemptStage lastObservedStage) {
|
||||
// Reactor wraps causes several layers deep; the whole chain is inspected so a wrapped
|
||||
// ConnectException is still recognised as provably NOT_SENT.
|
||||
for (Throwable cause : chain(failure)) {
|
||||
TransportFailure recognized = recognize(cause, lastObservedStage);
|
||||
if (recognized != null) {
|
||||
return recognized;
|
||||
}
|
||||
}
|
||||
return fallback(lastObservedStage);
|
||||
}
|
||||
|
||||
private TransportFailure recognize(Throwable cause, AttemptStage lastObservedStage) {
|
||||
if (cause instanceof UnknownHostException) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.DNS, FailureCategory.DNS, "DNS_RESOLUTION_FAILED");
|
||||
}
|
||||
if (cause instanceof ConnectException || cause instanceof NoRouteToHostException) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.CONNECT, FailureCategory.CONNECT, "CONNECT_FAILED");
|
||||
}
|
||||
if (cause instanceof io.netty.handler.ssl.SslHandshakeTimeoutException) {
|
||||
// Checked before the SSLHandshakeException branch below, which it extends. Without this a
|
||||
// handshake that merely ran out of time was classified TLS_PERMANENT — the category that
|
||||
// forbids retry — so a momentarily slow peer produced a hard failure indistinguishable from
|
||||
// an untrusted certificate.
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.TLS_HANDSHAKE, FailureCategory.TLS_TRANSIENT, "TLS_HANDSHAKE_TIMEOUT");
|
||||
}
|
||||
if (cause instanceof SSLPeerUnverifiedException || cause instanceof CertificateException) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.TLS_HANDSHAKE, FailureCategory.TLS_PERMANENT, "TLS_TRUST_FAILED");
|
||||
}
|
||||
if (cause instanceof SSLHandshakeException) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.TLS_HANDSHAKE, FailureCategory.TLS_PERMANENT, "TLS_HANDSHAKE_FAILED");
|
||||
}
|
||||
if (cause instanceof SSLException
|
||||
&& !lastObservedStage.isAtLeast(AttemptStage.REQUEST_HEADERS)) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.TLS_HANDSHAKE, FailureCategory.TLS_TRANSIENT, "TLS_TRANSIENT_FAILURE");
|
||||
}
|
||||
if (isPoolAcquireTimeout(cause)) {
|
||||
return TransportFailure.notSent(
|
||||
AttemptStage.POOL_ACQUIRE, FailureCategory.POOL_ACQUIRE_TIMEOUT, "POOL_ACQUIRE_TIMEOUT");
|
||||
}
|
||||
if (cause instanceof java.util.concurrent.CancellationException) {
|
||||
return new TransportFailure(
|
||||
lastObservedStage,
|
||||
lastObservedStage.provesNotSent()
|
||||
? ExecutionEvidence.NOT_SENT
|
||||
: ExecutionEvidence.SENT_NO_RESPONSE,
|
||||
FailureCategory.CANCELLED,
|
||||
"CANCELLED");
|
||||
}
|
||||
if (cause instanceof io.netty.handler.timeout.WriteTimeoutException) {
|
||||
// Netty's timeout hierarchy does not extend java.util.concurrent.TimeoutException, so none of
|
||||
// these reached the branch below — every read or write timeout fell through to the generic
|
||||
// fallback and lost its stage and category.
|
||||
return TransportFailure.sentNoResponse(
|
||||
AttemptStage.REQUEST_BODY, FailureCategory.REQUEST_WRITE, "REQUEST_WRITE_TIMEOUT");
|
||||
}
|
||||
if (cause instanceof TimeoutException
|
||||
|| cause instanceof io.netty.handler.timeout.ReadTimeoutException) {
|
||||
if (lastObservedStage.isAtLeast(AttemptStage.RESPONSE_BODY)) {
|
||||
return new TransportFailure(
|
||||
lastObservedStage,
|
||||
ExecutionEvidence.PARTIAL_RESPONSE,
|
||||
FailureCategory.RESPONSE_TIMEOUT,
|
||||
"RESPONSE_BODY_TIMEOUT");
|
||||
}
|
||||
return TransportFailure.sentNoResponse(
|
||||
AttemptStage.RESPONSE_HEADERS,
|
||||
FailureCategory.RESPONSE_TIMEOUT,
|
||||
"RESPONSE_HEADER_TIMEOUT");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private TransportFailure fallback(AttemptStage lastObservedStage) {
|
||||
if (lastObservedStage.provesNotSent()) {
|
||||
return TransportFailure.notSent(
|
||||
lastObservedStage, FailureCategory.UNKNOWN, "TRANSPORT_FAILURE");
|
||||
}
|
||||
if (lastObservedStage.isAtLeast(AttemptStage.RESPONSE_BODY)) {
|
||||
return new TransportFailure(
|
||||
lastObservedStage,
|
||||
ExecutionEvidence.PARTIAL_RESPONSE,
|
||||
FailureCategory.RESPONSE_TRUNCATED,
|
||||
"TRANSPORT_FAILURE");
|
||||
}
|
||||
return TransportFailure.sentNoResponse(
|
||||
lastObservedStage, FailureCategory.UNKNOWN, "TRANSPORT_FAILURE");
|
||||
}
|
||||
|
||||
private boolean isPoolAcquireTimeout(Throwable cause) {
|
||||
String message = cause.getMessage();
|
||||
return cause.getClass().getName().contains("PoolAcquireTimeoutException")
|
||||
|| (message != null && message.contains("Pool#acquire(Duration)"));
|
||||
}
|
||||
|
||||
private java.util.List<Throwable> chain(Throwable failure) {
|
||||
java.util.List<Throwable> chain = new java.util.ArrayList<>();
|
||||
Throwable current = failure;
|
||||
while (current != null && !chain.contains(current)) {
|
||||
chain.add(current);
|
||||
current = current.getCause();
|
||||
}
|
||||
return chain;
|
||||
}
|
||||
}
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.reactor;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.SslContextMaterial;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.handler.ssl.SslContextBuilder;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import reactor.netty.http.Http11SslContextSpec;
|
||||
import reactor.netty.http.Http2SslContextSpec;
|
||||
import reactor.netty.http.HttpProtocol;
|
||||
import reactor.netty.http.client.HttpClient;
|
||||
import reactor.netty.resources.ConnectionProvider;
|
||||
import reactor.netty.tcp.SslProvider;
|
||||
import reactor.netty.transport.ProxyProvider;
|
||||
|
||||
/**
|
||||
* Builds the Reactor Netty client for one profile (design §13.6).
|
||||
*
|
||||
* <p>Redirect following is disabled here for the same reason as in the blocking transports: the
|
||||
* platform re-validates each hop and strips credentials across origins, and the engine's follower
|
||||
* does neither.
|
||||
*/
|
||||
public final class ReactorHttpClientFactory {
|
||||
|
||||
public HttpClient create(
|
||||
ClientProfile profile,
|
||||
ConnectionProvider connectionProvider,
|
||||
Optional<SslContextMaterial> tlsMaterial) {
|
||||
Objects.requireNonNull(profile, "profile");
|
||||
Objects.requireNonNull(connectionProvider, "connection provider");
|
||||
|
||||
HttpClient client =
|
||||
HttpClient.create(connectionProvider)
|
||||
.option(
|
||||
ChannelOption.CONNECT_TIMEOUT_MILLIS,
|
||||
Math.toIntExact(profile.timeout().connect().toMillis()))
|
||||
.responseTimeout(profile.timeout().responseHeader())
|
||||
.followRedirect(false)
|
||||
.compress(profile.request().compression())
|
||||
.protocol(protocols(profile))
|
||||
.metrics(true, Function.identity())
|
||||
// request-write-idle and read-idle were bound and then reached no transport at all, so
|
||||
// a request that stalled mid-write hung until the total-call budget expired instead of
|
||||
// failing at the stage that actually stopped. Netty's idle handlers are where those two
|
||||
// settings become real; they are installed per connection so a stall is attributed to
|
||||
// the write or the read rather than to "the call".
|
||||
.doOnConnected(
|
||||
connection ->
|
||||
connection
|
||||
.addHandlerLast(
|
||||
new io.netty.handler.timeout.WriteTimeoutHandler(
|
||||
profile.timeout().requestWriteIdle().toMillis(),
|
||||
java.util.concurrent.TimeUnit.MILLISECONDS))
|
||||
.addHandlerLast(
|
||||
new io.netty.handler.timeout.ReadTimeoutHandler(
|
||||
profile.timeout().readIdle().toMillis(),
|
||||
java.util.concurrent.TimeUnit.MILLISECONDS)));
|
||||
|
||||
// Configured whether or not custom material is supplied. It used to be inside this isPresent,
|
||||
// so a profile declaring `tls.protocols: [TLSv1.3]` against the JVM trust store — the common
|
||||
// case — configured no TLS parameters at all and accepted whatever the platform default
|
||||
// allowed, TLS 1.2 included. A declared floor that only applies alongside a custom truststore
|
||||
// is not a floor.
|
||||
SslProvider.GenericSslContextSpec<SslContextBuilder> contextSpec =
|
||||
sslContextSpec(profile, tlsMaterial.orElse(null));
|
||||
client = client.secure(spec -> spec.sslContext(contextSpec));
|
||||
if (profile.proxy().enabled()) {
|
||||
client =
|
||||
client.proxy(
|
||||
spec ->
|
||||
spec.type(
|
||||
profile.proxy().type()
|
||||
== dev.caskeleton.adapter.outbound.httpclient.profile.ProxyType
|
||||
.SOCKS
|
||||
? ProxyProvider.Proxy.SOCKS5
|
||||
: ProxyProvider.Proxy.HTTP)
|
||||
.host(profile.proxy().host())
|
||||
.port(profile.proxy().port())
|
||||
.connectTimeoutMillis(profile.proxy().connectTimeout().toMillis()));
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
/**
|
||||
* The TLS spec, with or without custom material.
|
||||
*
|
||||
* <p>{@code material} is nullable on purpose: a profile using the JVM trust store still declares
|
||||
* a protocol floor, and that floor has to reach the SSL context.
|
||||
*/
|
||||
private SslProvider.GenericSslContextSpec<SslContextBuilder> sslContextSpec(
|
||||
ClientProfile profile, SslContextMaterial material) {
|
||||
String[] tlsProtocols =
|
||||
material != null
|
||||
? material.protocolArray()
|
||||
: profile.tls().protocols().toArray(String[]::new);
|
||||
java.util.function.Consumer<SslContextBuilder> configurer =
|
||||
builder -> {
|
||||
if (material != null) {
|
||||
material.trustManagerFactory().ifPresent(builder::trustManager);
|
||||
material.keyManagerFactory().ifPresent(builder::keyManager);
|
||||
}
|
||||
builder.protocols(tlsProtocols);
|
||||
};
|
||||
return profile
|
||||
.protocols()
|
||||
.contains(dev.caskeleton.adapter.outbound.httpclient.profile.HttpProtocol.HTTP_2)
|
||||
? Http2SslContextSpec.forClient().configure(configurer)
|
||||
: Http11SslContextSpec.forClient().configure(configurer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures exactly the protocols the profile asked for.
|
||||
*
|
||||
* <p>{@code {H2, HTTP11}} used to be configured whenever HTTP/2 appeared in the set at all, so a
|
||||
* profile that declared only HTTP/2 — an operator stating a requirement — negotiated HTTP/1.1
|
||||
* against any peer that offered it, silently. An H2-required profile now gets H2 alone, and a
|
||||
* peer that cannot speak it fails the handshake instead of downgrading.
|
||||
*/
|
||||
private HttpProtocol[] protocols(ClientProfile profile) {
|
||||
return switch (dev.caskeleton.adapter.outbound.httpclient.profile.ProtocolIntent.of(
|
||||
profile.protocols())) {
|
||||
case H2_REQUIRED -> new HttpProtocol[] {HttpProtocol.H2};
|
||||
case NEGOTIATE_H2_H1 -> new HttpProtocol[] {HttpProtocol.H2, HttpProtocol.HTTP11};
|
||||
default -> new HttpProtocol[] {HttpProtocol.HTTP11};
|
||||
};
|
||||
}
|
||||
}
|
||||
-87
@@ -1,87 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.reactor;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.ClientProfile;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.profile.RuntimeGeneration;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.security.SslContextMaterial;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportCapabilities;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.ReactiveTransportProvider;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportFailureClassifier;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportId;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportLifecycleListener;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.transport.TransportResourceKey;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Function;
|
||||
import org.springframework.http.client.reactive.ClientHttpConnector;
|
||||
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
|
||||
import reactor.netty.resources.ConnectionProvider;
|
||||
|
||||
/**
|
||||
* Reactive default transport (design D-07, §13.6).
|
||||
*
|
||||
* <p>Returns a Spring {@code ClientHttpConnector}; the Reactor Netty {@code HttpClient} stays
|
||||
* inside this package so application code cannot bypass profile configuration.
|
||||
*/
|
||||
public final class ReactorNettyTransportProvider implements ReactiveTransportProvider {
|
||||
|
||||
private static final TransportId ID = new TransportId("reactor-netty");
|
||||
|
||||
private final ReactorConnectionProviderFactory poolFactory =
|
||||
new ReactorConnectionProviderFactory();
|
||||
private final ReactorHttpClientFactory clientFactory = new ReactorHttpClientFactory();
|
||||
private final ReactorFailureClassifier classifier = new ReactorFailureClassifier();
|
||||
private final Map<TransportResourceKey, ConnectionProvider> pools = new ConcurrentHashMap<>();
|
||||
private final Optional<MeterRegistry> meterRegistry;
|
||||
private final Function<ClientProfile, Optional<SslContextMaterial>> tlsMaterialResolver;
|
||||
|
||||
public ReactorNettyTransportProvider() {
|
||||
this(Optional.empty(), profile -> Optional.empty());
|
||||
}
|
||||
|
||||
public ReactorNettyTransportProvider(
|
||||
Optional<MeterRegistry> meterRegistry,
|
||||
Function<ClientProfile, Optional<SslContextMaterial>> tlsMaterialResolver) {
|
||||
this.meterRegistry = Objects.requireNonNull(meterRegistry, "meter registry");
|
||||
this.tlsMaterialResolver = Objects.requireNonNull(tlsMaterialResolver, "tls material resolver");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransportId id() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReactiveTransportCapabilities capabilities() {
|
||||
return ReactiveTransportCapabilities.reactorNetty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientHttpConnector create(
|
||||
ClientProfile profile, RuntimeGeneration generation, TransportLifecycleListener listener) {
|
||||
Objects.requireNonNull(profile, "profile");
|
||||
Objects.requireNonNull(listener, "lifecycle listener");
|
||||
ConnectionProvider pool = poolFactory.create(profile);
|
||||
pools.put(new TransportResourceKey(profile.name(), generation), pool);
|
||||
meterRegistry.ifPresent(
|
||||
registry -> ReactorPoolMetricsBinder.bind(registry, profile.name(), pool));
|
||||
listener.onRuntimeCreated(profile.name(), ID);
|
||||
return new ReactorClientHttpConnector(
|
||||
clientFactory.create(profile, pool, tlsMaterialResolver.apply(profile)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransportFailureClassifier failureClassifier() {
|
||||
return classifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close(ClientProfile profile, RuntimeGeneration generation) {
|
||||
ConnectionProvider pool = pools.remove(new TransportResourceKey(profile.name(), generation));
|
||||
if (pool != null) {
|
||||
pool.disposeLater().block(profile.pool().shutdownTimeout());
|
||||
}
|
||||
}
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.reactor;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.ClientProfileName;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.observation.HttpClientObservationNames;
|
||||
import io.micrometer.core.instrument.Gauge;
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import reactor.netty.resources.ConnectionProvider;
|
||||
|
||||
/**
|
||||
* Publishes Reactor Netty pool state under the platform's own metric names (design §25.1).
|
||||
*
|
||||
* <p>Reactor's built-in metrics use different names and tags; republishing here keeps one
|
||||
* vocabulary across transports so a dashboard does not have to know which engine is in use.
|
||||
*/
|
||||
public final class ReactorPoolMetricsBinder {
|
||||
|
||||
private ReactorPoolMetricsBinder() {}
|
||||
|
||||
public static void bind(
|
||||
MeterRegistry registry, ClientProfileName profileName, ConnectionProvider provider) {
|
||||
Objects.requireNonNull(registry, "meter registry");
|
||||
Objects.requireNonNull(provider, "connection provider");
|
||||
List<Tag> tags =
|
||||
List.of(Tag.of("clientName", profileName.value()), Tag.of("transport", "reactor-netty"));
|
||||
Gauge.builder(
|
||||
HttpClientObservationNames.POOL_CONNECTIONS,
|
||||
provider,
|
||||
candidate -> candidate.maxConnections())
|
||||
.tags(tags)
|
||||
.register(registry);
|
||||
}
|
||||
}
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.resilience;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpBulkheadRejectedException;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpCircuitOpenException;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpFailureMetadata;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpRateLimitRejectedException;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Reactive counterpart of {@link AttemptResiliencePipeline}.
|
||||
*
|
||||
* <p>The same circuit breaker, rate limiter and semaphore bulkhead are used, but their permits live
|
||||
* until the subscribed attempt terminates. Wrapping only the construction of a {@code Mono} would
|
||||
* release every permit before a socket operation starts and would make the guards observationally
|
||||
* present but operationally useless.
|
||||
*/
|
||||
public final class ReactiveAttemptResiliencePipeline {
|
||||
|
||||
private final AttemptCircuitBreaker circuitBreaker;
|
||||
private final AttemptRateLimiter rateLimiter;
|
||||
private final BlockingAttemptBulkhead bulkhead;
|
||||
private final Supplier<HttpFailureMetadata> metadataSupplier;
|
||||
private final ResilienceRejectionRecorder rejections;
|
||||
|
||||
public ReactiveAttemptResiliencePipeline(
|
||||
AttemptCircuitBreaker circuitBreaker,
|
||||
AttemptRateLimiter rateLimiter,
|
||||
BlockingAttemptBulkhead bulkhead,
|
||||
Supplier<HttpFailureMetadata> metadataSupplier,
|
||||
ResilienceRejectionRecorder rejections) {
|
||||
this.circuitBreaker = Objects.requireNonNull(circuitBreaker, "circuit breaker");
|
||||
this.rateLimiter = Objects.requireNonNull(rateLimiter, "rate limiter");
|
||||
this.bulkhead = Objects.requireNonNull(bulkhead, "bulkhead");
|
||||
this.metadataSupplier = Objects.requireNonNull(metadataSupplier, "failure metadata supplier");
|
||||
this.rejections = Objects.requireNonNull(rejections, "rejection recorder");
|
||||
}
|
||||
|
||||
public String circuitState() {
|
||||
return circuitBreaker.state();
|
||||
}
|
||||
|
||||
public <T> Mono<T> execute(
|
||||
Mono<T> attempt, Function<T, Optional<Throwable>> remoteFailureClassifier) {
|
||||
Objects.requireNonNull(attempt, "attempt");
|
||||
Objects.requireNonNull(remoteFailureClassifier, "remote failure classifier");
|
||||
|
||||
return Mono.defer(
|
||||
() -> {
|
||||
if (!circuitBreaker.tryAcquirePermission()) {
|
||||
rejections.circuitOpen();
|
||||
return Mono.error(
|
||||
new HttpCircuitOpenException(
|
||||
"upstream circuit breaker is open", metadataSupplier.get()));
|
||||
}
|
||||
if (!rateLimiter.tryAcquirePermission()) {
|
||||
rejections.rateLimited();
|
||||
return Mono.error(
|
||||
new HttpRateLimitRejectedException(
|
||||
"local attempt rate limit reached", metadataSupplier.get()));
|
||||
}
|
||||
if (!bulkhead.tryAcquire()) {
|
||||
rateLimiter.onCompleted();
|
||||
rejections.bulkheadRejected();
|
||||
return Mono.error(
|
||||
new HttpBulkheadRejectedException(
|
||||
"attempt bulkhead has no permit available", metadataSupplier.get()));
|
||||
}
|
||||
|
||||
long started = System.nanoTime();
|
||||
AtomicBoolean breakerRecorded = new AtomicBoolean();
|
||||
AtomicBoolean released = new AtomicBoolean();
|
||||
Runnable release =
|
||||
() -> {
|
||||
if (released.compareAndSet(false, true)) {
|
||||
bulkhead.release();
|
||||
rateLimiter.onCompleted();
|
||||
}
|
||||
};
|
||||
|
||||
return attempt
|
||||
.doOnSuccess(
|
||||
result -> {
|
||||
if (breakerRecorded.compareAndSet(false, true)) {
|
||||
Optional<Throwable> remoteFailure =
|
||||
result == null ? Optional.empty() : remoteFailureClassifier.apply(result);
|
||||
if (remoteFailure.isPresent()) {
|
||||
circuitBreaker.onError(
|
||||
System.nanoTime() - started, remoteFailure.orElseThrow());
|
||||
} else {
|
||||
circuitBreaker.onSuccess(System.nanoTime() - started);
|
||||
}
|
||||
}
|
||||
})
|
||||
.doOnError(
|
||||
failure -> {
|
||||
if (breakerRecorded.compareAndSet(false, true)) {
|
||||
circuitBreaker.onError(System.nanoTime() - started, failure);
|
||||
}
|
||||
})
|
||||
.doFinally(ignored -> release.run());
|
||||
});
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package dev.caskeleton.adapter.outbound.httpclient.resilience;
|
||||
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.error.HttpClientException;
|
||||
import dev.caskeleton.adapter.outbound.httpclient.api.result.HttpCallResult;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* The reactive counterpart of {@link BlockingLogicalCall} (design §18.2).
|
||||
*
|
||||
* <p>Same decision semantics, no blocking: nothing here may call {@code block()} or sleep, because
|
||||
* every one of these methods can run on an event loop.
|
||||
*/
|
||||
public interface ReactiveLogicalCall<T> {
|
||||
|
||||
Mono<AttemptOutcome<T>> attempt(int attemptNumber);
|
||||
|
||||
RetryContext context(AttemptOutcome<T> outcome, int attemptNumber);
|
||||
|
||||
Deadline deadline();
|
||||
|
||||
Mono<HttpCallResult<T>> finish(AttemptOutcome<T> outcome, int attemptNumber);
|
||||
|
||||
HttpClientException ambiguous(AttemptOutcome<T> outcome, int attemptNumber);
|
||||
|
||||
HttpClientException retryExhausted(int attemptNumber);
|
||||
|
||||
default void onRetryGranted(RetryAllowed allowed, int attemptNumber) {}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user