diff --git a/dbrepo-container-service/README.md b/dbrepo-container-service/README.md index 986b2885e1bf0a1c49df81b9446c20e3c8d69e1f..a5ae3e58a15a826ac6d96403e5ff21bc420ef114 100644 --- a/dbrepo-container-service/README.md +++ b/dbrepo-container-service/README.md @@ -1,7 +1,15 @@ -# FDA Container Service +# Container Service -## Documentation +## Actuator -- OpenAPI v3: http://localhost:9091/swagger-ui/index.html -- OpenAPI v3 endpoint: http://localhost:9091/v3/api-docs/ -- OpenAPI v3 YAML: http://localhost:9091/v3/api-docs.yaml \ No newline at end of file +- Actuator Info: http://localhost:9091/actuator/info +- Actuator Health: http://localhost:9091/actuator/health +- Actuator Prometheus: http://localhost:9091/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9091/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9091/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-container-service/pom.xml b/dbrepo-container-service/pom.xml index e780d3f864a797d6915f27cae7bfbb714b0ef321..b972c5fa5f49a214084b0a591d31ca93416b5d6e 100644 --- a/dbrepo-container-service/pom.xml +++ b/dbrepo-container-service/pom.xml @@ -29,6 +29,7 @@ <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -72,9 +73,15 @@ </dependency> <!-- Swagger --> <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-core</artifactId> - <version>${swagger.version}</version> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> </dependency> <!-- Data Source --> <dependency> diff --git a/dbrepo-container-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-container-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 4965870c94ad807b50c6108f48eae70cde674594..95da4f4d33762d5887aaee347b21f044d41f2e08 100644 --- a/dbrepo-container-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-container-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,10 +6,8 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; -import org.springframework.beans.factory.annotation.Autowired; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.info.BuildProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-container-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-container-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index c12c18252c51f43494eb1558d0ba6d06261ef6a6..faa094b1c41f426ff4b198b4716273f96ebe6d72 100644 --- a/dbrepo-container-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-container-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; import io.swagger.v3.oas.annotations.security.SecurityScheme; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; @@ -39,16 +38,16 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/container/**", "GET"), - new AntPathRequestMatcher("/api/image/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/container/**", "GET"), + new AntPathRequestMatcher("/api/image/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-database-service/README.md b/dbrepo-database-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..459dff58ac32195052d7a97cc918628236656ebb --- /dev/null +++ b/dbrepo-database-service/README.md @@ -0,0 +1,15 @@ +# Database Service + +## Actuator + +- Actuator Info: http://localhost:9092/actuator/info +- Actuator Health: http://localhost:9092/actuator/health +- Actuator Prometheus: http://localhost:9092/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9092/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9092/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-database-service/pom.xml b/dbrepo-database-service/pom.xml index 414a7afe17da563adbfdd88d3808a216cd6b9451..3d3fbd8fce3388dee50debfc501c3bc3b82ef177 100644 --- a/dbrepo-database-service/pom.xml +++ b/dbrepo-database-service/pom.xml @@ -26,11 +26,11 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <c3p0.version>0.9.5.5</c3p0.version> <c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -67,12 +67,6 @@ <artifactId>dbrepo-metadata-db-entites</artifactId> <version>${project.version}</version> </dependency> - <!-- Monitoring --> - <dependency> - <groupId>io.micrometer</groupId> - <artifactId>micrometer-registry-prometheus</artifactId> - <scope>runtime</scope> - </dependency> <!-- elasticsearch --> <dependency> <groupId>co.elastic.clients</groupId> @@ -89,6 +83,18 @@ <artifactId>spring-cloud-starter-bootstrap</artifactId> <version>${spring-cloud.version}</version> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- Data Source --> <dependency> <groupId>com.mchange</groupId> diff --git a/dbrepo-database-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-database-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 38208b7a49ba44c21d81f34734d81d423e5892af..de68a599f062395e21918952b220fcfb2c376036 100644 --- a/dbrepo-database-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-database-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-database-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-database-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 7ee0e81e221d269441eb653f86b2cbfba4954552..e0ff9189e5c4ab5009f4b4a65a80e33f1104bea0 100644 --- a/dbrepo-database-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-database-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -39,15 +39,15 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/container/**/database/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/container/**/database/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-identifier-service/README.md b/dbrepo-identifier-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9f9b6fcdd3c07732e54c9a0bf7c33746adaf9fde --- /dev/null +++ b/dbrepo-identifier-service/README.md @@ -0,0 +1,15 @@ +# Identifier Service + +## Actuator + +- Actuator Info: http://localhost:9096/actuator/info +- Actuator Health: http://localhost:9096/actuator/health +- Actuator Prometheus: http://localhost:9096/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9096/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9096/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-identifier-service/pom.xml b/dbrepo-identifier-service/pom.xml index cbd895ea27da773ebe3dcf156491da76350d38d1..cb8d587faa108c1b6bb45cf95f0fd69097ccebd8 100644 --- a/dbrepo-identifier-service/pom.xml +++ b/dbrepo-identifier-service/pom.xml @@ -27,7 +27,6 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <hibernate-c3po.version>5.6.3.Final</hibernate-c3po.version> @@ -35,6 +34,7 @@ <opencsv.version>5.7.1</opencsv.version> <super-csv.version>2.4.0</super-csv.version> <jsql.version>4.6</jsql.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -114,6 +114,18 @@ <version>${docker.version}</version> <scope>test</scope> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- Testing --> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/dbrepo-identifier-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-identifier-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index b39fabcbbafb576974db31a870930aa7113e23c5..7c8ddcff285685220d7cb1fed793feea0f1a40ff 100644 --- a/dbrepo-identifier-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-identifier-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-identifier-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-identifier-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 13a5e63de31c4e367033e2f8a88da4a487e089f5..4169e7977c4d9cb037a3721080b08efc00c060a4 100644 --- a/dbrepo-identifier-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-identifier-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -39,16 +39,16 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/identifier/**", "GET"), - new AntPathRequestMatcher("/api/pid/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/identifier/**", "GET"), + new AntPathRequestMatcher("/api/pid/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-metadata-db/pom.xml b/dbrepo-metadata-db/pom.xml index 924d8d9c0790e83aea8d88b72ca6d26d409a9b15..6d3b7f77747b6fd5c02275fd9892ff8cb71fb4c1 100644 --- a/dbrepo-metadata-db/pom.xml +++ b/dbrepo-metadata-db/pom.xml @@ -31,6 +31,7 @@ <jsql-parser.version>4.6</jsql-parser.version> <jackson-datatype.version>2.15.0</jackson-datatype.version> <commons.version>2.11.0</commons.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -82,13 +83,8 @@ <!-- OpenAPI --> <dependency> <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-ui</artifactId> - <version>1.6.6</version> - </dependency> - <dependency> - <groupId>org.springdoc</groupId> - <artifactId>springdoc-openapi-javadoc</artifactId> - <version>1.6.6</version> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> </dependency> <!-- Docker --> <dependency> diff --git a/dbrepo-metadata-service/README.md b/dbrepo-metadata-service/README.md index 2b9e354befb0b72ab97925282256765224bef0f6..54443a4e20a8a7d2e34af4bb7bdada7833b11149 100644 --- a/dbrepo-metadata-service/README.md +++ b/dbrepo-metadata-service/README.md @@ -1,34 +1,15 @@ -# Metadata Service +# Semantics Service -Conforms (partly) to OAI-PMH 2.0 +## Actuator -THe exposed endpoint is `http://localhost:9098/api/oai` or at the gateway `http://localhost:9095/api/oai` +- Actuator Info: http://localhost:9099/actuator/info +- Actuator Health: http://localhost:9099/actuator/health +- Actuator Prometheus: http://localhost:9099/actuator/prometheus -## Implemented +## Swagger UI Endpoints -### Identify +- Swagger UI: http://localhost:9099/swagger-ui/index.html -```console -$ curl -X GET http://localhost:9095/api/oai?verb=Identify -<?xml version='1.0' encoding='UTF-8'?> -<OAI-PMH xmlns='http://www.openarchives.org/OAI/2.0/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' - xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd'> - <responseDate>2022-09-17T20:07:30Z</responseDate> - <request verb="Identify">https://metadata-service:9098/api/oai</request> - <Identify> - <repositoryName>Example Repository</repositoryName> - <baseURL>https://example.com</baseURL> - <protocolVersion>2.0</protocolVersion> - <adminEmail>noreply@example.com</adminEmail> - <earliestDatestamp>2022-09-17T18:23:00Z</earliestDatestamp> - <deletedRecord>persistent</deletedRecord> - <granularity>YYYY-MM-DDThh:mm:ssZ</granularity> -</Identify> -</OAI-PMH>( -``` +## OpenAPI Endpoints -### ListIdentifiers - -```console -$ curl -X GET http://localhost:9095/api/oai?verb=ListIdentifiers -``` \ No newline at end of file +- OpenAPI v3 as .yaml: http://localhost:9099/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-metadata-service/pom.xml b/dbrepo-metadata-service/pom.xml index 8dfab218eee806e01a1c1d7ad8d91e54ba352ae4..e6acaea7329e7a9cc7f4e5606461b8faef53aa7a 100644 --- a/dbrepo-metadata-service/pom.xml +++ b/dbrepo-metadata-service/pom.xml @@ -40,7 +40,6 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <hibernate-c3po.version>5.6.3.Final</hibernate-c3po.version> @@ -49,6 +48,7 @@ <jsql.version>4.6</jsql.version> <keycloak.version>21.0.2</keycloak.version> <hibernate.version>6.2.2.Final</hibernate.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -137,6 +137,18 @@ <artifactId>mapstruct</artifactId> <version>${mapstruct.version}</version> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- Testing --> <dependency> <groupId>org.springframework.boot</groupId> diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index fc7efc6d7522bd21adbc1870b8106703694095b6..7907a04f775e3246d8060d3707309683d953c0d1 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 7bec3fbf94675ec5f48f7b0b46298da40c9d51cb..2b7e04859f03dd201e59cd2921e84c1f1fb8857d 100644 --- a/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-metadata-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -23,15 +23,15 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/oai/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/oai/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-query-service/README.md b/dbrepo-query-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e2547c3ff15136223a66d51f18a336e8af65b2a --- /dev/null +++ b/dbrepo-query-service/README.md @@ -0,0 +1,15 @@ +# Query Service + +## Actuator + +- Actuator Info: http://localhost:9093/actuator/info +- Actuator Health: http://localhost:9093/actuator/health +- Actuator Prometheus: http://localhost:9093/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9093/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9093/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-query-service/pom.xml b/dbrepo-query-service/pom.xml index c533f3b2b804eba84f304622b11e60ceb832dd03..8decc97e39f11bd4a30f4e9f2638522f9b0f2c47 100644 --- a/dbrepo-query-service/pom.xml +++ b/dbrepo-query-service/pom.xml @@ -44,13 +44,13 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <opencsv.version>5.7.1</opencsv.version> <jsql.version>4.6</jsql.version> <c3p0.version>0.9.5.5</c3p0.version> <c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -130,6 +130,18 @@ <artifactId>amqp-client</artifactId> <version>${rabbit-amqp-client.version}</version> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- Docker --> <dependency> <groupId>com.github.docker-java</groupId> diff --git a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 3b18d5fc2819b868f845d6e768222f9624fd0d86..f61db6ccbfc01ed8ea594139d14dc67deb1a23f0 100644 --- a/dbrepo-query-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-query-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 1c36be92a450333a9a36b2ae24c9f7c1de5a90da..b6fab51c6dde960603fb8c10d3bea101666c4744 100644 --- a/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-query-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -38,7 +38,11 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") + new AntPathRequestMatcher("/actuator/**", "GET"), + new AntPathRequestMatcher("/v3/api-docs.yaml"), + new AntPathRequestMatcher("/v3/api-docs/**"), + new AntPathRequestMatcher("/swagger-ui/**"), + new AntPathRequestMatcher("/swagger-ui.html") ); final OrRequestMatcher publicEndpoints = new OrRequestMatcher( new AntPathRequestMatcher("/api/container/**/database/data/**", "GET"), @@ -48,11 +52,7 @@ public class WebSecurityConfig { new AntPathRequestMatcher("/api/container/**/database/**/table/**/export/**", "GET"), new AntPathRequestMatcher("/api/container/**/database/**/query/**", "GET"), new AntPathRequestMatcher("/api/container/**/database/**/query/**/export", "GET"), - new AntPathRequestMatcher("/api/container/**/database/**/query/**", "PUT"), - new AntPathRequestMatcher("/v3/api-docs.yaml"), - new AntPathRequestMatcher("/v3/api-docs/**"), - new AntPathRequestMatcher("/swagger-ui/**"), - new AntPathRequestMatcher("/swagger-ui.html") + new AntPathRequestMatcher("/api/container/**/database/**/query/**", "PUT") ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); diff --git a/dbrepo-semantics-service/README.md b/dbrepo-semantics-service/README.md index 986b2885e1bf0a1c49df81b9446c20e3c8d69e1f..859ab6d6acf70e7fd13bdd9c10b666796de55538 100644 --- a/dbrepo-semantics-service/README.md +++ b/dbrepo-semantics-service/README.md @@ -1,7 +1,15 @@ -# FDA Container Service +# Semantics Service -## Documentation +## Actuator -- OpenAPI v3: http://localhost:9091/swagger-ui/index.html -- OpenAPI v3 endpoint: http://localhost:9091/v3/api-docs/ -- OpenAPI v3 YAML: http://localhost:9091/v3/api-docs.yaml \ No newline at end of file +- Actuator Info: http://localhost:9097/actuator/info +- Actuator Health: http://localhost:9097/actuator/health +- Actuator Prometheus: http://localhost:9097/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9097/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9097/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-semantics-service/pom.xml b/dbrepo-semantics-service/pom.xml index d2891ee0b89629d704a26d2560cc34fd1b606a54..aeb1451ea6f218c90236479793cf9a96cd8e3193 100644 --- a/dbrepo-semantics-service/pom.xml +++ b/dbrepo-semantics-service/pom.xml @@ -35,6 +35,7 @@ <c3p0.version>0.9.5.5</c3p0.version> <c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version> <apache-jena.version>4.8.0</apache-jena.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -150,6 +151,18 @@ <artifactId>mapstruct</artifactId> <version>${mapstruct.version}</version> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> </dependencies> <build> diff --git a/dbrepo-semantics-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-semantics-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 140a531132f16ed713aa6242966ebefadb55aca2..53198e3489dabc13d6ef78c4ef155f84c82315b1 100644 --- a/dbrepo-semantics-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-semantics-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-semantics-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-semantics-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 49510d6efbcc187719a0c66693c9c8a6fa21f38f..3bd2ce6956ac3c52b301dbeacad582b6f68f9022 100644 --- a/dbrepo-semantics-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-semantics-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -38,15 +38,15 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/semantic/ontology/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/semantic/ontology/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-table-service/README.md b/dbrepo-table-service/README.md index 986b2885e1bf0a1c49df81b9446c20e3c8d69e1f..2275ec5de6998edff88c3a17af407272d3c4d44e 100644 --- a/dbrepo-table-service/README.md +++ b/dbrepo-table-service/README.md @@ -1,7 +1,15 @@ -# FDA Container Service +# Semantics Service -## Documentation +## Actuator -- OpenAPI v3: http://localhost:9091/swagger-ui/index.html -- OpenAPI v3 endpoint: http://localhost:9091/v3/api-docs/ -- OpenAPI v3 YAML: http://localhost:9091/v3/api-docs.yaml \ No newline at end of file +- Actuator Info: http://localhost:9094/actuator/info +- Actuator Health: http://localhost:9094/actuator/health +- Actuator Prometheus: http://localhost:9094/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9094/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9094/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-table-service/pom.xml b/dbrepo-table-service/pom.xml index d82996f45d43ce1653c1434f7d0350b68d4f3d94..7f444e593faf1d45b31bd5b3037f6bd156f09f68 100644 --- a/dbrepo-table-service/pom.xml +++ b/dbrepo-table-service/pom.xml @@ -26,7 +26,6 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <opencsv.version>5.7.1</opencsv.version> @@ -34,6 +33,7 @@ <jsql.version>4.6</jsql.version> <c3p0.version>0.9.5.5</c3p0.version> <c3p0-hibernate.version>6.2.2.Final</c3p0-hibernate.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -96,6 +96,18 @@ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- DataSource --> <dependency> <groupId>com.mchange</groupId> diff --git a/dbrepo-table-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-table-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 341d4650373eb88d8fdf813499fbdfc5655dc5f6..67509e1920a2dcdac678fad548814ed0c877246a 100644 --- a/dbrepo-table-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-table-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -6,7 +6,7 @@ import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-table-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-table-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index 73dd29d4eff73dd3dd03fc92f83517290ee0e9f7..5c4cfc9bf3afca6e79e06cd68f7808a61777d775 100644 --- a/dbrepo-table-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-table-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -38,15 +38,15 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/container/**/database/**/table/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/container/**/database/**/table/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */ diff --git a/dbrepo-user-service/README.md b/dbrepo-user-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ae61ee03af964f84a5e42666af5402e8ab930b8e --- /dev/null +++ b/dbrepo-user-service/README.md @@ -0,0 +1,15 @@ +# User Service + +## Actuator + +- Actuator Info: http://localhost:9098/actuator/info +- Actuator Health: http://localhost:9098/actuator/health +- Actuator Prometheus: http://localhost:9098/actuator/prometheus + +## Swagger UI Endpoints + +- Swagger UI: http://localhost:9098/swagger-ui/index.html + +## OpenAPI Endpoints + +- OpenAPI v3 as .yaml: http://localhost:9098/v3/api-docs.yaml \ No newline at end of file diff --git a/dbrepo-user-service/pom.xml b/dbrepo-user-service/pom.xml index f1ae609dcab5e95ec63de47944bff6e0f0dac174..1b5fd796af2b2d3b59f92f8201b35b50fea34ba0 100644 --- a/dbrepo-user-service/pom.xml +++ b/dbrepo-user-service/pom.xml @@ -43,7 +43,6 @@ <spring-cloud.version>4.0.2</spring-cloud.version> <mapstruct.version>1.5.5.Final</mapstruct.version> <docker.version>3.3.0</docker.version> - <swagger.version>2.2.9</swagger.version> <jacoco.version>0.8.10</jacoco.version> <jwt.version>4.3.0</jwt.version> <hibernate-c3po.version>5.6.3.Final</hibernate-c3po.version> @@ -52,6 +51,7 @@ <jsql.version>4.6</jsql.version> <keycloak.version>21.0.2</keycloak.version> <hibernate.version>6.2.2.Final</hibernate.version> + <springdoc-openapi.version>2.1.0</springdoc-openapi.version> </properties> <dependencies> @@ -119,6 +119,18 @@ <groupId>org.springframework.data</groupId> <artifactId>spring-data-elasticsearch</artifactId> </dependency> + <!-- Swagger --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> + <!-- Open API --> + <dependency> + <groupId>org.springdoc</groupId> + <artifactId>springdoc-openapi-starter-webmvc-api</artifactId> + <version>${springdoc-openapi.version}</version> + </dependency> <!-- IDE --> <dependency> <groupId>org.projectlombok</groupId> diff --git a/dbrepo-user-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-user-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index eb08f946aadc05ad3224133245e771aebf2a2364..353d949c4b4fb39c8b93bc22ef45fd325e53d0c2 100644 --- a/dbrepo-user-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-user-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -5,7 +5,7 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import org.springdoc.core.GroupedOpenApi; +import org.springdoc.core.models.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/dbrepo-user-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java b/dbrepo-user-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java index fe44809a4407c9c4e8f3b9a9e89222894a3da6d2..5df540670976455fe25c8985718bd6a0e3a0d0d3 100644 --- a/dbrepo-user-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java +++ b/dbrepo-user-service/services/src/main/java/at/tuwien/config/WebSecurityConfig.java @@ -38,17 +38,17 @@ public class WebSecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { final OrRequestMatcher internalEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/actuator/prometheus/**", "GET") - ); - final OrRequestMatcher publicEndpoints = new OrRequestMatcher( - new AntPathRequestMatcher("/api/user/**", "GET"), - new AntPathRequestMatcher("/api/user/**", "POST"), - new AntPathRequestMatcher("/api/maintenance/**", "GET"), + new AntPathRequestMatcher("/actuator/**", "GET"), new AntPathRequestMatcher("/v3/api-docs.yaml"), new AntPathRequestMatcher("/v3/api-docs/**"), new AntPathRequestMatcher("/swagger-ui/**"), new AntPathRequestMatcher("/swagger-ui.html") ); + final OrRequestMatcher publicEndpoints = new OrRequestMatcher( + new AntPathRequestMatcher("/api/user/**", "GET"), + new AntPathRequestMatcher("/api/user/**", "POST"), + new AntPathRequestMatcher("/api/maintenance/**", "GET") + ); /* enable CORS and disable CSRF */ http = http.cors().and().csrf().disable(); /* set session management to stateless */