Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview
- **OAG** The OWASP Application Gateway.
- **Tech-Stack:** SpringCloudGateway · Java 17 · Gradle 8 · docker · vitepress (for documentation)
- **Tech-Stack:** SpringCloudGateway · Java 17 · Gradle 9 · docker · vitepress (for documentation)

## Build & Run Commands

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Build stage
#
FROM gradle:8.14-jdk17 AS build
FROM gradle:9.6.1-jdk17 AS build

# Copy build files and download dependencies -> allows faster build because this step can be cached
COPY oag/build.gradle oag/settings.gradle /home/app/
Expand Down

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions oag/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

plugins {
id 'java'
id 'org.springframework.boot' version '4.0.1'
id 'org.springframework.boot' version '4.1.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.danilopianini.publish-on-central' version '9.1.9'
id 'org.danilopianini.publish-on-central' version '9.2.8'
id 'maven-publish'
id 'signing'
}
Expand All @@ -44,23 +44,23 @@ repositories {
}

ext {
springCloudVersion = '2025.1.0'
springCloudVersion = '2025.1.2'
}

dependencies {
// Security fixes section

// Main dependencies
implementation 'com.google.guava:guava:33.5.0-jre'
implementation 'org.yaml:snakeyaml:2.5'
implementation 'com.nimbusds:oauth2-oidc-sdk:11.30.1'
implementation 'com.nimbusds:nimbus-jose-jwt:10.6'
implementation 'com.google.guava:guava:33.6.0-jre'
implementation 'org.yaml:snakeyaml:2.6'
implementation 'com.nimbusds:oauth2-oidc-sdk:11.38.1'
implementation 'com.nimbusds:nimbus-jose-jwt:10.9.1'
implementation 'io.github.artsok:rerunner-jupiter:2.1.6'
implementation 'org.jspecify:jspecify'
implementation 'org.apache.commons:commons-lang3:3.20.0'
implementation 'commons-codec:commons-codec:1.20.0'
implementation 'commons-codec:commons-codec:1.22.0'
implementation 'org.antlr:ST4:4.3.4'
implementation 'com.github.ben-manes.caffeine:caffeine:3.2.3'
implementation 'com.github.ben-manes.caffeine:caffeine:3.2.4'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'

// Spring Cloud dependencies
Expand All @@ -72,7 +72,7 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
testImplementation 'org.wiremock.integrations:wiremock-spring-boot:4.0.8'
testImplementation 'org.wiremock.integrations:wiremock-spring-boot:4.2.2'
}

dependencyManagement {
Expand Down Expand Up @@ -192,4 +192,4 @@ signing {
def signingPassword = System.env.SIGNING_PASSWORD
useInMemoryPgpKeys(signingKey, signingPassword)
// sign publishing.publications.OSSRH is called by plugin publish-on-central
}
}
Binary file modified oag/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 4 additions & 1 deletion oag/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
11 changes: 4 additions & 7 deletions oag/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

176 changes: 82 additions & 94 deletions oag/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain, G
var factory = new ModifyRequestBodyGatewayFilterFactory();
var config = new ModifyRequestBodyGatewayFilterFactory.Config();
config.setContentType(null);
config.setInClass(String.class);
config.setOutClass(String.class);
config.setRewriteFunction((e, s) -> rewrite(e, s, routeContext));
// Use the typed 3-arg overload (which also sets inClass/outClass) instead of the
// single-arg setRewriteFunction(RewriteFunction): as of spring-cloud-gateway-server-webflux
// 5.0.2, RewriteFunction declares its generic apply(ServerWebExchange, T) alongside a
// default erasure bridge apply(Object, Object), so assigning a lambda to the raw
// RewriteFunction parameter of the single-arg overload fails with
// "cannot infer functional interface descriptor for RewriteFunction". Passing explicit
// Class witnesses gives the lambda a properly parameterized RewriteFunction<String, String>
// target type.
config.setRewriteFunction(String.class, String.class, (e, s) -> rewrite(e, s, routeContext));

return factory.apply(config).filter(exchange, chain);
}
Expand Down Expand Up @@ -81,9 +87,9 @@ public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain, G
* @param routeContext the context for the current gateway route
* @return a Mono containing the original body
*/
private Mono<Object> rewrite(Object e, Object s, GatewayRouteContext routeContext) {
private Mono<String> rewrite(ServerWebExchange e, String s, GatewayRouteContext routeContext) {

consumeBody((ServerWebExchange) e, (String) s, routeContext);
consumeBody(e, s, routeContext);
return Mono.justOrEmpty(s);
}
}
Loading