Skip to content

Commit ae1a593

Browse files
authored
Merge pull request #144 from WebFuzzing/petstore-modifications
petstore modifications and drivers
2 parents 950c209 + a3aeb8c commit ae1a593

File tree

24 files changed

+725
-69
lines changed

24 files changed

+725
-69
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,3 +360,7 @@ jdk_8_maven/em/external/rest/spring-batch-rest/target
360360
/jdk_21_maven/cs/rest-gui/webgoat/tmp
361361
/jdk_21_maven/em/embedded/rest-gui/webgoat/target
362362
/jdk_21_maven/em/external/rest-gui/webgoat/target
363+
364+
/jdk_8_maven/cs/rest/original/swagger-petstore/target
365+
/jdk_8_maven/em/embedded/rest/swagger-petstore/target
366+
/jdk_8_maven/em/external/rest/swagger-petstore/target

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ For simplicity, all schemas are also available as JSON/YML files under the folde
7070
> **IMPORTANT**: More details (e.g., #LOCs and used databases) on these APIs can be found [in this table](statistics/table_emb.md).
7171
7272

73-
### REST: Java/Kotlin (31)
73+
### REST: Java/Kotlin (32)
7474

7575
* **Bibliothek** (MIT), [jdk_17_gradle/cs/rest/bibliothek](jdk_17_gradle/cs/rest/bibliothek), from [https://github.com/PaperMC/bibliothek](https://github.com/PaperMC/bibliothek)
7676

@@ -126,6 +126,8 @@ For simplicity, all schemas are also available as JSON/YML files under the folde
126126

127127
* **Spring Boot Restful API Example** (MIT), [jdk_17_maven/cs/rest/spring-rest-example](jdk_17_maven/cs/rest/spring-rest-example), from [https://github.com/phantasmicmeans/spring-boot-restful-api-example](https://github.com/phantasmicmeans/spring-boot-restful-api-example)
128128

129+
* **Swagger Petstore** (Apache), [jdk_8_maven/cs/rest/original/swagger-petstore](jdk_8_maven/cs/rest/original/swagger-petstore), from [https://github.com/swagger-api/swagger-petstore](https://github.com/swagger-api/swagger-petstore)
130+
129131
* **Tiltaksgjennomføring** (MIT), [jdk_17_maven/cs/rest/tiltaksgjennomforing](jdk_17_maven/cs/rest/tiltaksgjennomforing), from [https://github.com/navikt/tiltaksgjennomforing-api](https://github.com/navikt/tiltaksgjennomforing-api)
130132

131133
* **User Management** (MIT), [jdk_8_maven/cs/rest/original/user-management](jdk_8_maven/cs/rest/original/user-management), from [https://github.com/andreagiassi/microservice-rbac-user-management](https://github.com/andreagiassi/microservice-rbac-user-management)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM amazoncorretto:8-alpine-jdk
2+
3+
COPY ./dist/swagger-petstore-sut.jar .
4+
COPY ./dist/jacocoagent.jar .
5+
6+
7+
8+
9+
COPY ./scripts/dockerize/data/additional_files/swagger-petstore/inflector.yaml .
10+
11+
12+
13+
#ENV TOOL="undefined"
14+
#ENV RUN="0"
15+
16+
ENTRYPOINT \
17+
java \
18+
# unfortunately dumponexit is completely unreliable in Docker :(
19+
# -javaagent:jacocoagent.jar=destfile=./jacoco/swagger-petstore__${TOOL}__${RUN}__jacoco.exec,append=false,dumponexit=true \
20+
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
21+
-jar swagger-petstore-sut.jar \
22+
8080

dockerfiles/swagger-petstore.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
services:
2+
sut-swagger-petstore:
3+
build:
4+
dockerfile: ./dockerfiles/swagger-petstore.dockerfile
5+
context: ..
6+
# environment:
7+
# TOOL: ${TOOL:-undefined}
8+
# RUN: ${RUN:-0}
9+
ports:
10+
- "${HOST_PORT:-8080}:8080"
11+
- "${JACOCO_PORT:-6300}:6300"
12+
# volumes:
13+
# default env does not work on volumes
14+
# - ${JACOCODIR}:/jacoco
15+

jdk_8_maven/cs/rest/original/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<module>blogapi</module>
2626
<module>spring-batch-rest</module>
2727
<module>spring-actuator-demo</module>
28+
<module>swagger-petstore</module>
2829
</modules>
2930

3031

jdk_8_maven/cs/rest/original/swagger-petstore/inflector.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
controllerPackage: io.swagger.petstore.controller
22
modelPackage: io.swagger.petstore.model
3-
swaggerUrl: openapi.yaml
3+
swaggerUrl: webapp/openapi.yaml
44

55
exposedSpecOptions:
66
useOriginalNotParsed: true

jdk_8_maven/cs/rest/original/swagger-petstore/pom.xml

Lines changed: 134 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>io.swagger</groupId>
44
<artifactId>swagger-petstore</artifactId>
5-
<packaging>war</packaging>
5+
<!-- <packaging>war</packaging>-->
6+
<packaging>jar</packaging>
67
<name>swagger-petstore</name>
78
<description>swagger-petstore</description>
89
<url>https://github.com/swagger-api/swagger-petstore</url>
@@ -37,8 +38,57 @@
3738
<build>
3839
<defaultGoal>install</defaultGoal>
3940
<directory>target</directory>
40-
<finalName>${project.artifactId}-${project.version}</finalName>
41+
<finalName>${project.artifactId}-sut</finalName>
42+
<!-- MODIFIED-->
43+
<resources>
44+
<resource>
45+
<directory>src/main/webapp</directory>
46+
<targetPath>webapp</targetPath>
47+
<includes>
48+
<include>**/*</include>
49+
</includes>
50+
</resource>
51+
<resource>
52+
<directory>${project.basedir}</directory>
53+
<includes>
54+
<include>webapp/openapi.yaml</include>
55+
<include>inflector.yaml</include>
56+
</includes>
57+
</resource>
58+
</resources>
59+
<!-- MODIFIED-->
60+
4161
<plugins>
62+
<!-- MODIFIED-->
63+
<plugin>
64+
<groupId>org.apache.maven.plugins</groupId>
65+
<artifactId>maven-shade-plugin</artifactId>
66+
<version>3.5.1</version>
67+
<executions>
68+
<execution>
69+
<phase>package</phase>
70+
<goals><goal>shade</goal></goals>
71+
<configuration>
72+
<filters>
73+
<filter>
74+
<artifact>*:*</artifact>
75+
<excludes>
76+
<exclude>META-INF/*.SF</exclude>
77+
<exclude>META-INF/*.DSA</exclude>
78+
<exclude>META-INF/*.RSA</exclude>
79+
</excludes>
80+
</filter>
81+
</filters>
82+
<transformers>
83+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
84+
<mainClass>io.swagger.petstore.Main</mainClass>
85+
</transformer>
86+
</transformers>
87+
</configuration>
88+
</execution>
89+
</executions>
90+
</plugin>
91+
<!-- MODIFIED-->
4292
<plugin>
4393
<artifactId>maven-compiler-plugin</artifactId>
4494
<version>3.11.0</version>
@@ -66,29 +116,29 @@
66116
</execution>
67117
</executions>
68118
</plugin>
69-
<plugin>
70-
<artifactId>maven-dependency-plugin</artifactId>
71-
<executions>
72-
<execution>
73-
<phase>package</phase>
74-
<goals>
75-
<goal>copy-dependencies</goal>
76-
<goal>copy</goal>
77-
</goals>
78-
<configuration>
79-
<outputDirectory>${project.build.directory}/lib</outputDirectory>
80-
<artifactItems>
81-
<artifactItem>
82-
<groupId>org.eclipse.jetty</groupId>
83-
<artifactId>jetty-runner</artifactId>
84-
<version>${jetty-version}</version>
85-
<destFileName>jetty-runner.jar</destFileName>
86-
</artifactItem>
87-
</artifactItems>
88-
</configuration>
89-
</execution>
90-
</executions>
91-
</plugin>
119+
<!-- <plugin>-->
120+
<!-- <artifactId>maven-dependency-plugin</artifactId>-->
121+
<!-- <executions>-->
122+
<!-- <execution>-->
123+
<!-- <phase>package</phase>-->
124+
<!-- <goals>-->
125+
<!-- <goal>copy-dependencies</goal>-->
126+
<!-- <goal>copy</goal>-->
127+
<!-- </goals>-->
128+
<!-- <configuration>-->
129+
<!-- <outputDirectory>${project.build.directory}/lib</outputDirectory>-->
130+
<!-- <artifactItems>-->
131+
<!-- <artifactItem>-->
132+
<!-- <groupId>org.eclipse.jetty</groupId>-->
133+
<!-- <artifactId>jetty-runner</artifactId>-->
134+
<!-- <version>${jetty-version}</version>-->
135+
<!-- <destFileName>jetty-runner.jar</destFileName>-->
136+
<!-- </artifactItem>-->
137+
<!-- </artifactItems>-->
138+
<!-- </configuration>-->
139+
<!-- </execution>-->
140+
<!-- </executions>-->
141+
<!-- </plugin>-->
92142
<plugin>
93143
<groupId>org.apache.maven.plugins</groupId>
94144
<artifactId>maven-jar-plugin</artifactId>
@@ -107,26 +157,27 @@
107157
</archive>
108158
</configuration>
109159
</plugin>
110-
<plugin>
111-
<groupId>org.eclipse.jetty</groupId>
112-
<artifactId>jetty-maven-plugin</artifactId>
113-
<version>${jetty-version}</version>
114-
<configuration>
115-
<monitoredDirName>.</monitoredDirName>
116-
<scanTargets>
117-
<scanTarget>inflector.yaml</scanTarget>
118-
</scanTargets>
119-
<scanIntervalSeconds>1</scanIntervalSeconds>
120-
<webApp>
121-
<contextPath>/</contextPath>
122-
</webApp>
123-
<webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
124-
<httpConnector>
125-
<port>8080</port>
126-
<idleTimeout>60000</idleTimeout>
127-
</httpConnector>
128-
</configuration>
129-
</plugin>
160+
<!-- MODIFIED-->
161+
<!-- <plugin>-->
162+
<!-- <groupId>org.eclipse.jetty</groupId>-->
163+
<!-- <artifactId>jetty-maven-plugin</artifactId>-->
164+
<!-- <version>${jetty-version}</version>-->
165+
<!-- <configuration>-->
166+
<!-- <monitoredDirName>.</monitoredDirName>-->
167+
<!-- <scanTargets>-->
168+
<!-- <scanTarget>inflector.yaml</scanTarget>-->
169+
<!-- </scanTargets>-->
170+
<!-- <scanIntervalSeconds>1</scanIntervalSeconds>-->
171+
<!-- <webApp>-->
172+
<!-- <contextPath>/</contextPath>-->
173+
<!-- </webApp>-->
174+
<!-- <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>-->
175+
<!-- <httpConnector>-->
176+
<!-- <port>8080</port>-->
177+
<!-- <idleTimeout>60000</idleTimeout>-->
178+
<!-- </httpConnector>-->
179+
<!-- </configuration>-->
180+
<!-- </plugin>-->
130181
<plugin>
131182
<groupId>com.googlecode.maven-download-plugin</groupId>
132183
<artifactId>download-maven-plugin</artifactId>
@@ -175,7 +226,28 @@
175226
</plugins>
176227
</build>
177228
<dependencies>
178-
229+
<!--MODIFIED-->
230+
<dependency>
231+
<groupId>org.glassfish.jersey.containers</groupId>
232+
<artifactId>jersey-container-servlet</artifactId>
233+
<version>2.41</version>
234+
</dependency>
235+
<dependency>
236+
<groupId>org.apache.tomcat.embed</groupId>
237+
<artifactId>tomcat-embed-core</artifactId>
238+
<version>9.0.89</version>
239+
</dependency>
240+
<dependency>
241+
<groupId>org.apache.tomcat.embed</groupId>
242+
<artifactId>tomcat-embed-jasper</artifactId>
243+
<version>9.0.89</version>
244+
</dependency>
245+
<dependency>
246+
<groupId>javax.servlet</groupId>
247+
<artifactId>javax.servlet-api</artifactId>
248+
<version>4.0.1</version>
249+
</dependency>
250+
<!-- MODIFIED-->
179251
<dependency>
180252
<groupId>com.fasterxml.jackson.core</groupId>
181253
<artifactId>jackson-databind</artifactId>
@@ -219,22 +291,23 @@
219291
<artifactId>swagger-parser</artifactId>
220292
<version>${swagger-parser-version}</version>
221293
</dependency>
294+
<!--MODIFIED-->
222295

223-
<dependency>
224-
<groupId>javax.xml.bind</groupId>
225-
<artifactId>jaxb-api</artifactId>
226-
<version>2.3.1</version>
227-
</dependency>
228-
<dependency>
229-
<groupId>com.sun.xml.bind</groupId>
230-
<artifactId>jaxb-core</artifactId>
231-
<version>2.3.0.1</version>
232-
</dependency>
233-
<dependency>
234-
<groupId>com.sun.xml.bind</groupId>
235-
<artifactId>jaxb-impl</artifactId>
236-
<version>2.3.1</version>
237-
</dependency>
296+
<!-- <dependency>-->
297+
<!-- <groupId>javax.xml.bind</groupId>-->
298+
<!-- <artifactId>jaxb-api</artifactId>-->
299+
<!-- <version>2.3.1</version>-->
300+
<!-- </dependency>-->
301+
<!-- <dependency>-->
302+
<!-- <groupId>com.sun.xml.bind</groupId>-->
303+
<!-- <artifactId>jaxb-core</artifactId>-->
304+
<!-- <version>2.3.0.1</version>-->
305+
<!-- </dependency>-->
306+
<!-- <dependency>-->
307+
<!-- <groupId>com.sun.xml.bind</groupId>-->
308+
<!-- <artifactId>jaxb-impl</artifactId>-->
309+
<!-- <version>2.3.1</version>-->
310+
<!-- </dependency>-->
238311
<dependency>
239312
<groupId>com.bugsnag</groupId>
240313
<version>[3.0,4.0)</version>

0 commit comments

Comments
 (0)