Skip to content

Commit f57b43b

Browse files
authored
Merge pull request #155 from WebFuzzing/microcks-drivers
Microcks drivers
2 parents c4cb131 + 74b5be2 commit f57b43b

File tree

23 files changed

+1381
-30
lines changed

23 files changed

+1381
-30
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,18 @@ jdk_8_maven/em/external/rest/spring-batch-rest/target
376376
/jdk_8_maven/cs/rest/original/spring-ecommerce/target
377377
/jdk_8_maven/em/embedded/rest/spring-ecommerce/target
378378
/jdk_8_maven/em/external/rest/spring-ecommerce/target
379+
380+
/jdk_21_maven/cs/rest-gui/microcks/target
381+
/jdk_21_maven/cs/rest-gui/microcks/commons/model/target
382+
/jdk_21_maven/cs/rest-gui/microcks/commons/util/target
383+
/jdk_21_maven/cs/rest-gui/microcks/commons/util-el/target
384+
/jdk_21_maven/cs/rest-gui/microcks/distro/uber/target
385+
/jdk_21_maven/cs/rest-gui/microcks/distro/uber-async-minion/target
386+
/jdk_21_maven/cs/rest-gui/microcks/webapp/target
387+
/jdk_21_maven/cs/rest-gui/microcks/minions/async/target
388+
/jdk_21_maven/cs/rest-gui/microcks/webapp/src/main/webapp/.angular
389+
/jdk_21_maven/cs/rest-gui/microcks/webapp/src/main/webapp/dist
390+
/jdk_21_maven/cs/rest-gui/microcks/webapp/src/main/webapp/node_modules
391+
392+
/jdk_21_maven/em/embedded/rest-gui/microcks/target
393+
/jdk_21_maven/em/external/rest-gui/microcks/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 (35)
73+
### REST: Java/Kotlin (36)
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

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

9797
* **Market** (MIT), [jdk_11_maven/cs/rest-gui/market](jdk_11_maven/cs/rest-gui/market), from [https://github.com/aleksey-lukyanets/market](https://github.com/aleksey-lukyanets/market)
9898

99+
* **Microcks** (Apache), [jdk_21_maven/cs/rest-gui/microcks](jdk_21_maven/cs/rest-gui/microcks), from [https://github.com/microcks/microcks](https://github.com/microcks/microcks)
100+
99101
* **NCS**, [jdk_8_maven/cs/rest/artificial/ncs](jdk_8_maven/cs/rest/artificial/ncs), (not-known license, artificial numerical examples coming from different sources)
100102

101103
* **News** (LGPL), [jdk_8_maven/cs/rest/artificial/news](jdk_8_maven/cs/rest/artificial/news), from [https://github.com/arcuri82/testing_security_development_enterprise_systems](https://github.com/arcuri82/testing_security_development_enterprise_systems)

auth/microcks-auth.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
auth:
2+
- name: "ADMIN_1"
3+
loginEndpointAuth:
4+
payloadRaw: "username=admin&password=microcks123&grant_type=password&client_id=microcks-serviceaccount&client_secret=ab54d329-e435-41ae-a900-ec6b3fe15c54"
5+
- name: "ADMIN_2"
6+
loginEndpointAuth:
7+
payloadRaw: "username=admin2&password=microcks123&grant_type=password&client_id=microcks-serviceaccount&client_secret=ab54d329-e435-41ae-a900-ec6b3fe15c54"
8+
9+
authTemplate:
10+
loginEndpointAuth:
11+
verb: POST
12+
externalEndpointURL: "http://localhost:8081/realms/microcks/protocol/openid-connect/token"
13+
contentType: application/x-www-form-urlencoded
14+
token:
15+
extractFromField: /access_token
16+
httpHeaderName: Authorization
17+
headerPrefix: "Bearer "

dockerfiles/microcks.dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM amazoncorretto:21-alpine-jdk
2+
3+
COPY ./dist/microcks-sut.jar .
4+
COPY ./dist/jacocoagent.jar .
5+
6+
7+
8+
#ENV TOOL="undefined"
9+
#ENV RUN="0"
10+
11+
ENTRYPOINT \
12+
java \
13+
# unfortunately dumponexit is completely unreliable in Docker :(
14+
# -javaagent:jacocoagent.jar=destfile=./jacoco/microcks__${TOOL}__${RUN}__jacoco.exec,append=false,dumponexit=true \
15+
-javaagent:jacocoagent.jar=output=tcpserver,address=*,port=6300,append=false,dumponexit=false \
16+
-DPOSTMAN_RUNNER_URL=http://postman:3000 -DSERVICES_UPDATE_INTERVAL='0 0 0/2 * * *' -DKEYCLOAK_URL=http://keycloak:8080 -DKEYCLOAK_PUBLIC_URL=http://localhost:${HOST_PORT:-8081} -DENABLE_CORS_POLICY=false -DCORS_REST_ALLOW_CREDENTIALS=true -DTEST_CALLBACK_URL=http://localhost:${HOST_PORT:-8080} -jar microcks-sut.jar \
17+
--server.port=8080 --spring.profiles.active=prod --grpc.server.port=0 --spring.data.mongodb.uri=mongodb://mongodb:27017/test --spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:${HOST_PORT:-8081}/realms/microcks --spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://keycloak:${HOST_PORT:-8080}/realms/microcks/protocol/openid-connect/certs

dockerfiles/microcks.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
services:
2+
sut-microcks:
3+
build:
4+
dockerfile: ./dockerfiles/microcks.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+
16+
mongodb:
17+
image: mongo:7.0
18+
tmpfs:
19+
- '/data/db'
20+
21+
22+
environment:
23+
MONGODB_REPLICA_SET_MODE: primary
24+
ALLOW_EMPTY_PASSWORD: yes
25+
26+
27+
28+
29+
30+
31+
32+
33+
keycloak:
34+
image: quay.io/keycloak/keycloak:26.0.0
35+
36+
37+
environment:
38+
KEYCLOAK_ADMIN: 'admin'
39+
KEYCLOAK_ADMIN_PASSWORD: 'admin'
40+
KC_HEALTH_ENABLED: 'true'
41+
KC_METRICS_ENABLED: 'true'
42+
43+
44+
45+
volumes:
46+
- ../scripts/dockerize/data/additional_files/microcks/microcks-realm-sample.json:/opt/keycloak/data/import/microcks-realm.json
47+
48+
49+
50+
healthcheck:
51+
test: ['CMD', 'sh', '-c', "echo -e 'GET /health/live HTTP/1.1\r\nHost: localhost\r\n\r\n' > /dev/tcp/localhost/9000"]
52+
interval: 30s
53+
timeout: 30s
54+
retries: 3
55+
56+
57+
ports:
58+
- '${HOST_PORT:-8081}:8080'
59+
60+
61+
62+
command: ['start-dev', '--hostname=http://localhost:${HOST_PORT:-8081}', '--import-realm', '--health-enabled=true']
63+
64+
65+
postman:
66+
image: quay.io/microcks/microcks-postman-runtime:0.6.0
67+
68+
69+
70+
71+
healthcheck:
72+
test: ['CMD', 'curl', '-f', 'http://localhost:3000/health']
73+
interval: 30s
74+
timeout: 30s
75+
retries: 3
76+
77+
78+
79+
80+

jdk_21_maven/cs/rest-gui/microcks/pom.xml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,32 +102,34 @@
102102
<goals>deploy</goals>
103103
</configuration>
104104
</plugin>
105-
<plugin>
106-
<groupId>com.diffplug.spotless</groupId>
107-
<artifactId>spotless-maven-plugin</artifactId>
108-
<version>2.39.0</version>
109-
<configuration>
110-
<!-- define Java language-specific format -->
111-
<java>
112-
<toggleOffOn />
113-
<eclipse>
114-
<file>${multi-project.rootdir}/eclipse-formatter.xml</file>
115-
</eclipse>
116-
<indent>
117-
<spaces>true</spaces>
118-
<spacesPerTab>3</spacesPerTab>
119-
</indent>
120-
</java>
121-
</configuration>
122-
<executions>
123-
<execution>
124-
<goals>
125-
<goal>check</goal>
126-
</goals>
127-
<phase>compile</phase>
128-
</execution>
129-
</executions>
130-
</plugin>
105+
<!-- MODIFIED-->
106+
<!-- <plugin>-->
107+
<!-- <groupId>com.diffplug.spotless</groupId>-->
108+
<!-- <artifactId>spotless-maven-plugin</artifactId>-->
109+
<!-- <version>2.39.0</version>-->
110+
<!-- <configuration>-->
111+
<!-- &lt;!&ndash; define Java language-specific format &ndash;&gt;-->
112+
<!-- <java>-->
113+
<!-- <toggleOffOn />-->
114+
<!-- <eclipse>-->
115+
<!-- <file>${multi-project.rootdir}/eclipse-formatter.xml</file>-->
116+
<!-- </eclipse>-->
117+
<!-- <indent>-->
118+
<!-- <spaces>true</spaces>-->
119+
<!-- <spacesPerTab>3</spacesPerTab>-->
120+
<!-- </indent>-->
121+
<!-- </java>-->
122+
<!-- </configuration>-->
123+
<!-- <executions>-->
124+
<!-- <execution>-->
125+
<!-- <goals>-->
126+
<!-- <goal>check</goal>-->
127+
<!-- </goals>-->
128+
<!-- <phase>compile</phase>-->
129+
<!-- </execution>-->
130+
<!-- </executions>-->
131+
<!-- </plugin>-->
132+
<!-- MODIFIED-->
131133
</plugins>
132134
</build>
133135

jdk_21_maven/cs/rest-gui/microcks/webapp/pom.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@
5050
</dependencyManagement>
5151

5252
<dependencies>
53+
<!-- MODIFIED-->
54+
<dependency>
55+
<groupId>org.springdoc</groupId>
56+
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
57+
<version>2.2.0</version>
58+
</dependency>
59+
<!-- MODIFIED-->
5360
<dependency>
5461
<groupId>io.github.microcks</groupId>
5562
<artifactId>microcks-util</artifactId>
@@ -408,6 +415,11 @@
408415
</profile>
409416
<profile>
410417
<id>prod</id>
418+
<!-- MODIFIED-->
419+
<activation>
420+
<activeByDefault>true</activeByDefault>
421+
</activation>
422+
<!-- MODIFIED-->
411423
<build>
412424
<plugins>
413425
<plugin>
@@ -510,7 +522,11 @@
510522
<arguments>
511523
<argument>--spring.profiles.active=prod</argument>
512524
</arguments>
513-
<classifier>exec</classifier>
525+
<!-- MODIFIED-->
526+
<finalName>microcks</finalName>
527+
<classifier>sut</classifier>
528+
<!-- <classifier>exec</classifier>-->
529+
<!-- MODIFIED-->
514530
<excludes>
515531
<!-- Otel agent should be provided at the bootstrap level within the container image -->
516532
<exclude>

jdk_21_maven/cs/rest-gui/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<modules>
1616
<module>webgoat</module>
17+
<module>microcks</module>
1718
</modules>
1819

1920

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
8+
<artifactId>evomaster-benchmark-jdk21-em-embedded-rest-gui-microcks</artifactId>
9+
<packaging>jar</packaging>
10+
11+
<parent>
12+
<groupId>org.evomaster</groupId>
13+
<artifactId>evomaster-benchmark-jdk21-em-embedded-rest-gui</artifactId>
14+
<version>3.4.1-SNAPSHOT</version>
15+
</parent>
16+
17+
<dependencyManagement>
18+
<dependencies>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-parent</artifactId>
22+
<version>3.3.10</version>
23+
<type>pom</type>
24+
<scope>import</scope>
25+
</dependency>
26+
</dependencies>
27+
</dependencyManagement>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>io.github.microcks</groupId>
32+
<artifactId>microcks-app</artifactId>
33+
<version>1.12.2-SNAPSHOT</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.mongodb</groupId>
37+
<artifactId>mongodb-driver-sync</artifactId>
38+
<version>5.0.1</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.mongodb</groupId>
42+
<artifactId>mongodb-driver-core</artifactId>
43+
<version>5.0.1</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>com.mongodb</groupId>
47+
<artifactId>java-spring-boot-mongodb-starter</artifactId>
48+
<version>1.0.0</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.testcontainers</groupId>
52+
<artifactId>testcontainers</artifactId>
53+
<scope>compile</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>junit</groupId>
57+
<artifactId>junit</artifactId>
58+
<scope>compile</scope>
59+
<version>4.11</version>
60+
</dependency>
61+
</dependencies>
62+
63+
64+
</project>

0 commit comments

Comments
 (0)