Skip to content

Commit

Permalink
Migrate employee-service from springfox to springdoc (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
CamaradeRoman authored May 26, 2023
1 parent 011b862 commit dd56f65
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 105 deletions.
3 changes: 3 additions & 0 deletions ft/docker/employee-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ logging.level:
org.springframework.security: DEBUG
org.springframework.web.reactive.function.client: TRACE

server:
forward-headers-strategy: framework

octopus-security:
roles:
ROLE_EMPLOYEE_SERVICE_USER_DEV:
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ junit-jupiter.version=5.9.0
kotlin.version=1.6.21
spring-boot.version=2.7.3
spring-cloud.version=2021.0.3
cloud-commons.version=2.0.9
springdoc.version=1.6.7
cloud-commons.version=2.0.10

docker.registry=
octopus.github.docker.registry=
Expand Down
4 changes: 2 additions & 2 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ dependencies {
implementation("org.springframework.security:spring-security-oauth2-jose")
implementation("org.octopusden.octopus-cloud-commons:octopus-security-common:${project.properties["cloud-commons.version"]}")

implementation("io.springfox:springfox-boot-starter:3.0.0")
implementation("io.springfox:springfox-swagger-ui:3.0.0")
implementation("org.springdoc:springdoc-openapi-ui:${project.properties["springdoc.version"]}")
implementation("org.springdoc:springdoc-openapi-kotlin:${project.properties["springdoc.version"]}")

implementation("com.fasterxml.jackson.module:jackson-module-kotlin")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.octopusden.employee.config

import io.swagger.v3.oas.models.Components
import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info
import io.swagger.v3.oas.models.security.SecurityRequirement
import io.swagger.v3.oas.models.security.SecurityScheme
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class OpenApiConfig {

@Bean
fun springShopOpenAPI(): OpenAPI {
val securitySchemeName = "bearerAuth"
return OpenAPI().info(Info().title("Employee Service").description("Employee Service API"))
.addSecurityItem(SecurityRequirement().addList(securitySchemeName)).components(
Components().addSecuritySchemes(
securitySchemeName,
SecurityScheme().name(securitySchemeName).type(SecurityScheme.Type.HTTP).scheme("bearer")
.bearerFormat("JWT")
)
)
}
}
102 changes: 0 additions & 102 deletions server/src/main/kotlin/org/octopusden/employee/config/SwaggerConfig.kt

This file was deleted.

0 comments on commit dd56f65

Please sign in to comment.