Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ scripts/dockerize/dockerfiles
/jdk_21_maven/cs/rest/testing-system/target/
/jdk_21_maven/em/external/rest/testing-system/target/
/jdk_21_maven/em/embedded/rest/testing-system/target/
/jdk_21_maven/cs/rest/flight-search-api/target/
/jdk_21_maven/em/external/rest/flight-search-api/target/
/jdk_21_maven/em/embedded/rest/flight-search-api/target/
/jdk_11_maven/em/embedded/rest/tracking-system/target/
/jdk_11_maven/em/external/rest/tracking-system/target/
/jdk_17_maven/em/embedded/rest/tiltaksgjennomforing/target/
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ How to setup authentication information, based on the current content of the ini
Auth configuration files can found in the [auth](auth) folder.


### REST: Java/Kotlin (52)
### REST: Java/Kotlin (53)

* **AdoptMe** (not-known license), [jdk_21_maven/cs/rest/adoptme](jdk_21_maven/cs/rest/adoptme), from [https://github.com/daanimelian/Programacion3-TPO](https://github.com/daanimelian/Programacion3-TPO)

Expand All @@ -109,6 +109,8 @@ Auth configuration files can found in the [auth](auth) folder.

* **Features-Service** (Apache), [jdk_8_maven/cs/rest/original/features-service](jdk_8_maven/cs/rest/original/features-service), from [https://github.com/JavierMF/features-service](https://github.com/JavierMF/features-service)

* **Flight Search API** (MIT), [jdk_21_maven/cs/rest/flight-search-api](jdk_21_maven/cs/rest/flight-search-api), from [https://github.com/Rapter1990/flightsearchapi](https://github.com/Rapter1990/flightsearchapi)

* **GDPR-KV** (not-known license), [jdk_21_gradle/cs/rest/gdpr-kv](jdk_21_gradle/cs/rest/gdpr-kv), from [https://github.com/jessicant/GDPR-KV](https://github.com/jessicant/GDPR-KV)

* **Genome Nexus** (MIT), [jdk_8_maven/cs/rest-gui/genome-nexus](jdk_8_maven/cs/rest-gui/genome-nexus), from [https://github.com/genome-nexus/genome-nexus](https://github.com/genome-nexus/genome-nexus)
Expand Down
25 changes: 25 additions & 0 deletions auth/flight-search-api-auth.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
auth:
- name: WfdAdmin1
loginEndpointAuth:
payloadRaw: "{\"email\": \"wfd_admin1@wfd.invalid\", \"password\": \"Wfd-Admin-Pass1\"}"
- name: WfdAdmin2
loginEndpointAuth:
payloadRaw: "{\"email\": \"wfd_admin2@wfd.invalid\", \"password\": \"Wfd-Admin-Pass2\"}"
- name: WfdUser1
loginEndpointAuth:
payloadRaw: "{\"email\": \"wfd_user1@wfd.invalid\", \"password\": \"Wfd-User-Pass1\"}"
- name: WfdUser2
loginEndpointAuth:
payloadRaw: "{\"email\": \"wfd_user2@wfd.invalid\", \"password\": \"Wfd-User-Pass2\"}"

authTemplate:
loginEndpointAuth:
endpoint: /api/v1/authentication/user/login
verb: POST
contentType: application/json
token:
extractFrom: body
extractSelector: /response/accessToken
sendName: Authorization
sendIn: header
sendTemplate: "Bearer {token}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// MODIFIED (WFD-added, not part of the original SUT): the same four accounts the drivers seed.
// Airports and flights are left for the search to create (the SUT's own loader is never scheduled).
db = db.getSiblingDB('flightdatabase');

const user = function (id, hash, type) {
return {
"_id": id, "EMAIL": id + "@wfd.invalid", "PASSWORD": hash,
"FIRST_NAME": id, "LAST_NAME": id, "PHONE_NUMBER": "05550000000",
"USER_TYPE": type, "USER_STATUS": "ACTIVE",
"_class": "com.example.demo.auth.model.entity.UserEntity"
};
};

db.getCollection('user-collection').insertMany([
user("wfd_admin1", "$2a$10$2xOaY0XmjU8VrHnQ6ORmme.4pAD21fsnoM9dcf8Y8NYwmXZztsDsC", "ADMIN"), // Wfd-Admin-Pass1
user("wfd_admin2", "$2a$10$qKrL3SboXVhfaaevAMiU.eFAj1wD4.X2VVvI.XSmjVlTPf8.95Z9y", "ADMIN"), // Wfd-Admin-Pass2
user("wfd_user1", "$2a$10$t.OcuL3NBcdCtRCUtX4SiuG6RPgGxs0yQpdvVl11J0Mv249/vu9Za", "USER"), // Wfd-User-Pass1
user("wfd_user2", "$2a$10$1WlQAEEMP97IO1o8vLl3ROrLeF9hdKRjd0yxlOve.ZhF.HCW9rES.", "USER") // Wfd-User-Pass2
]);
13 changes: 13 additions & 0 deletions dockerfiles/flight-search-api.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM amazoncorretto:21-alpine-jdk

COPY ./dist/flight-search-api-sut.jar .
COPY ./dist/jacocoagent.jar .




ENTRYPOINT \
java \
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
-jar flight-search-api-sut.jar \
--server.port=8080 --spring.data.mongodb.host=db --spring.data.mongodb.port=27017 --spring.data.mongodb.database=flightdatabase
42 changes: 42 additions & 0 deletions dockerfiles/flight-search-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
mitmproxy:
image: mitmproxy/mitmproxy:10.2.4
user: "0:0"
environment:
MITM_LOG_DIR: /custom-logs
MITM_LOG_FILE: ${MITM_LOG_FILE:-minlog.csv}
command: >
mitmdump
--mode reverse:http://sut-flight-search-api:8080
--listen-host 0.0.0.0
--listen-port 8080
--set keep_host_header=true
-s /addons/minlog.py
volumes:
- ${HOST_LOG_DIR:-./mitm-logs}:/custom-logs
- ./addons:/addons:ro
ports:
- "${HOST_PORT:-8080}:8080"
depends_on:
- sut-flight-search-api
sut-flight-search-api:
image: webfuzzing/wfd-flight-search-api:FINAL
# build:
# dockerfile: ./dockerfiles/flight-search-api.dockerfile
# context: ..
environment:
AUTH_PORT: ${AUTH_PORT:-8081}
ports:
- "${JACOCO_PORT:-6300}:6300"
depends_on:
db:
condition: service_healthy
db:
image: mongo:7
volumes:
- ./additional_files/flight-search-api/flight-search-api-mongo-seed.js:/docker-entrypoint-initdb.d/flight-search-api-mongo-seed.js
healthcheck:
test: mongosh --quiet --eval "db.adminCommand('ping')"
interval: 30s
timeout: 30s
retries: 3
1 change: 1 addition & 0 deletions experiments/bb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def __init__(self, name, auth, sleep, schemaformat, classfiles):
Sut("erc20-rest-service",False,SLEEP,JSON,["jdk_8_gradle/cs/rest/erc20-rest-service/build/classes"]),
Sut("familie-ba-sak",True,SLEEP,JSON,["jdk_17_maven/cs/rest/familie-ba-sak/target/classes"]),
Sut("features-service",False,SLEEP,JSON,["jdk_8_maven/cs/rest/original/features-service/target/classes"]),
Sut("flight-search-api",True,SLEEP,JSON,["jdk_21_maven/cs/rest/flight-search-api/target/classes"]),
Sut("gdpr-kv",False,SLEEP,JSON,["jdk_21_gradle/cs/rest/gdpr-kv/build/classes"]),
Sut("traccar",True,SLEEP,JSON,["jdk_21_gradle/cs/rest/traccar/build/classes"]),
Sut("genome-nexus",False,SLEEP,JSON,["jdk_8_maven/cs/rest-gui/genome-nexus/component/target/classes",
Expand Down
1 change: 1 addition & 0 deletions experiments/wb-exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def __init__(self, name, platform):
Sut("erc20-rest-service", JDK_8),
Sut("familie-ba-sak",JDK_17),
Sut("features-service", JDK_8),
Sut("flight-search-api", JDK_21),
Sut("gdpr-kv", JDK_21),
Sut("traccar", JDK_21),
Sut("genome-nexus", JDK_8),
Expand Down
1 change: 1 addition & 0 deletions jacoco.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COPY jdk_11_maven/cs/rest/cwa-verification-server/target/classes ${CLASS_FILES}
COPY jdk_8_gradle/cs/rest/erc20-rest-service/build/classes ${CLASS_FILES}/jdk_8_gradle/cs/rest/erc20-rest-service/build/classes
COPY jdk_17_maven/cs/rest/familie-ba-sak/target/classes ${CLASS_FILES}/jdk_17_maven/cs/rest/familie-ba-sak/target/classes
COPY jdk_8_maven/cs/rest/original/features-service/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest/original/features-service/target/classes
COPY jdk_21_maven/cs/rest/flight-search-api/target/classes ${CLASS_FILES}/jdk_21_maven/cs/rest/flight-search-api/target/classes
COPY jdk_21_gradle/cs/rest/gdpr-kv/build/classes ${CLASS_FILES}/jdk_21_gradle/cs/rest/gdpr-kv/build/classes
COPY jdk_8_maven/cs/rest-gui/genome-nexus/component/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest-gui/genome-nexus/component/target/classes
COPY jdk_8_maven/cs/rest-gui/genome-nexus/model/target/classes ${CLASS_FILES}/jdk_8_maven/cs/rest-gui/genome-nexus/model/target/classes
Expand Down
13 changes: 11 additions & 2 deletions jdk_21_maven/cs/rest/flight-search-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
<jsonwebtoken.version>0.12.3</jsonwebtoken.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<openapi.version>2.1.0</openapi.version>
<springdoc-openapi.version>2.1.0</springdoc-openapi.version>
<!-- MODIFIED-->
<!-- springdoc 2.1.0 breaks on Spring Boot 3.4 (/v3/api-docs: NoSuchMethodError ControllerAdviceBean) -->
<openapi.version>2.7.0</openapi.version>
<springdoc-openapi.version>2.7.0</springdoc-openapi.version>
<!-- MODIFIED-->
<jacoco-version>0.8.12</jacoco-version>
<maven-surefire-plugin-version>3.5.2</maven-surefire-plugin-version>
<maven-failsafe-plugin-version>3.5.2</maven-failsafe-plugin-version>
Expand Down Expand Up @@ -189,6 +192,12 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- MODIFIED-->
<!-- WFD expects a single self-contained "flight-search-api-sut.jar". The classifier keeps
the plain jar as the main artifact, which the embedded driver depends on. -->
<finalName>flight-search-api</finalName>
<classifier>sut</classifier>
<!-- MODIFIED-->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
Expand Down
1 change: 1 addition & 0 deletions jdk_21_maven/cs/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<module>lovemining</module>
<module>movies-xml</module>
<module>testing-system</module>
<module>flight-search-api</module>
</modules>


Expand Down
48 changes: 48 additions & 0 deletions jdk_21_maven/em/embedded/rest/flight-search-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>evomaster-benchmark-jdk21-em-embedded-rest-flight-search-api</artifactId>
<packaging>jar</packaging>

<parent>
<groupId>org.evomaster</groupId>
<artifactId>evomaster-benchmark-jdk21-em-embedded-rest</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>3.4.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- The SUT as a library -->
<dependency>
<groupId>com.case</groupId>
<artifactId>flightsearchapi</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
</dependency>
</dependencies>

</project>
Loading
Loading