diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e32483b --- /dev/null +++ b/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + sydney.cheng + ec-super-pom + 1.0.1 + + + ec-microservice-commons + 1.0.0-SNAPSHOT + pom + + + + MIT License + https://www.opensource.org/licenses/mit-license.php + + + + + Edward Cheng + edward@cheng.sydney + cheng.sydney + https://3dwardch3ng.github.io/ + + + + scm:git:git://github.com/3dwardch3ng/ec-microservice-commons.git + scm:git:ssh://github.com:3dwardch3ng/ec-microservice-commons.git + https://github.com/3dwardch3ng/ec-microservice-commons/tree/main + + + GitHub + https://github.com/3dwardch3ng/ec-microservice-commons/issues + + + + swagger + + + + + jacoco + reuseReports + ${project.basedir}/../target/site/jacoco/jacoco.xml + java + **/config/* + 3dwardch3ng + https://sonarqube.cluster.edward.sydney + + \ No newline at end of file diff --git a/swagger/pom.xml b/swagger/pom.xml new file mode 100644 index 0000000..9f666fe --- /dev/null +++ b/swagger/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + + sydney.cheng + ec-microservice-commons + 1.0.0-SNAPSHOT + + + cheng.edward + ec-microservice-commons-swagger + 1.0.0-SNAPSHOT + + + + 2.6.0 + 17 + 17 + UTF-8 + + + + + org.springdoc + springdoc-openapi-starter-common + ${springdoc-openapi-starter-common.version} + + + \ No newline at end of file diff --git a/swagger/src/main/java/cheng/edward/microservice/commons/swagger/config/SwaggerConfiguration.java b/swagger/src/main/java/cheng/edward/microservice/commons/swagger/config/SwaggerConfiguration.java new file mode 100644 index 0000000..6a32b19 --- /dev/null +++ b/swagger/src/main/java/cheng/edward/microservice/commons/swagger/config/SwaggerConfiguration.java @@ -0,0 +1,17 @@ +package cheng.edward.microservice.commons.swagger.config; + +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.security.SecurityScheme; +import org.springframework.context.annotation.Configuration; + +@Configuration +@OpenAPIDefinition(info = @Info(title = "MediRecords Secure Message API", version = "v1")) +@SecurityScheme( + name = "Authentication Token", + type = SecuritySchemeType.HTTP, + scheme = "bearer" +) +public class SwaggerConfiguration { +} diff --git a/swagger/src/main/java/cheng/edward/microservice/commons/swagger/controller/SecuredController.java b/swagger/src/main/java/cheng/edward/microservice/commons/swagger/controller/SecuredController.java new file mode 100644 index 0000000..de06761 --- /dev/null +++ b/swagger/src/main/java/cheng/edward/microservice/commons/swagger/controller/SecuredController.java @@ -0,0 +1,7 @@ +package cheng.edward.microservice.commons.swagger.controller; + +import io.swagger.v3.oas.annotations.security.SecurityRequirement; + +@SecurityRequirement(name = "Authentication Token") +public interface SecuredController { +}