diff --git a/pom.xml b/pom.xml
index 9689fee..e0e49cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
com.github.soat-tech-challenge
service-common
- 5.0.0
+ 5.1.1
org.postgresql
diff --git a/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java b/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
index 8e3196d..d315c87 100644
--- a/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
+++ b/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
@@ -1,5 +1,7 @@
package br.com.grupo63.serviceorder;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
+import br.com.grupo63.techchallenge.common.config.aws.ecs.ECSTaskIdInfoContributor;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
@@ -9,7 +11,6 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.ComponentScan;
@OpenAPIDefinition(
info = @Info(title = "${info.name}", description = "${info.description}", version = "${info.version}"),
@@ -25,9 +26,12 @@
bearerFormat = "JWT",
in = SecuritySchemeIn.HEADER
)
-@SpringBootApplication
+@SpringBootApplication(scanBasePackageClasses = {
+ ServiceOrderApplication.class,
+ JwtService.class,
+ ECSTaskIdInfoContributor.class
+})
@EnableFeignClients
-@ComponentScan(basePackages = {"br.com.grupo63"})
public class ServiceOrderApplication {
public static void main(String[] args) {
diff --git a/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java b/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
index 4e6c680..8085d83 100644
--- a/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
+++ b/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
@@ -1,8 +1,7 @@
package br.com.grupo63.serviceorder.config;
-import br.com.grupo63.techchallenge.common.config.JwtFilter;
-import br.com.grupo63.techchallenge.common.config.JwtService;
-import org.springframework.beans.factory.annotation.Autowired;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtFilter;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -12,11 +11,8 @@
@Configuration
public class JwtFilterConfig {
- @Autowired
- private JwtService jwtService;
-
@Bean
- public FilterRegistrationBean jwtFilterFilterRegistrationBean() {
+ public FilterRegistrationBean jwtFilterFilterRegistrationBean(JwtService jwtService) {
FilterRegistrationBean jwtFilterFilterRegistrationBean = new FilterRegistrationBean<>();
jwtFilterFilterRegistrationBean.setFilter(new JwtFilter(jwtService));
jwtFilterFilterRegistrationBean.setUrlPatterns(List.of("/orders"));