Skip to content

Commit 98c2880

Browse files
committed
chore: cleanup, update common
1 parent 31628a0 commit 98c2880

File tree

8 files changed

+21
-31
lines changed

8 files changed

+21
-31
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>com.github.soat-tech-challenge</groupId>
4747
<artifactId>service-common</artifactId>
48-
<version>4.2.2</version>
48+
<version>5.1.1</version>
4949
</dependency>
5050
<dependency>
5151
<groupId>org.springframework.boot</groupId>

src/main/java/br/com/grupo63/techchallenge/payment/ServicePaymentApplication.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package br.com.grupo63.techchallenge.payment;
22

3+
import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
4+
import br.com.grupo63.techchallenge.common.config.aws.ecs.ECSTaskIdInfoContributor;
35
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
46
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
57
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
@@ -10,7 +12,6 @@
1012
import org.springframework.boot.autoconfigure.SpringBootApplication;
1113
import org.springframework.cloud.openfeign.EnableFeignClients;
1214

13-
@SpringBootApplication
1415
@EnableFeignClients
1516
@OpenAPIDefinition(
1617
info = @Info(title = "${info.name}", description = "${info.description}", version = "${info.version}"),
@@ -27,6 +28,11 @@
2728
bearerFormat = "JWT",
2829
in = SecuritySchemeIn.HEADER
2930
)
31+
@SpringBootApplication(scanBasePackageClasses = {
32+
ServicePaymentApplication.class,
33+
JwtService.class,
34+
ECSTaskIdInfoContributor.class
35+
})
3036
public class ServicePaymentApplication {
3137

3238
public static void main(String[] args) {

src/main/java/br/com/grupo63/techchallenge/payment/config/JwtFilterConfig.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package br.com.grupo63.techchallenge.payment.config;
22

3-
import br.com.grupo63.techchallenge.common.config.JwtFilter;
4-
import org.springframework.beans.factory.annotation.Autowired;
3+
import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtFilter;
4+
import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
55
import org.springframework.boot.web.servlet.FilterRegistrationBean;
66
import org.springframework.context.annotation.Bean;
77
import org.springframework.context.annotation.Configuration;
@@ -11,11 +11,8 @@
1111
@Configuration
1212
public class JwtFilterConfig {
1313

14-
@Autowired
15-
private JwtService jwtService;
16-
1714
@Bean
18-
public FilterRegistrationBean<JwtFilter> jwtFilterFilterRegistrationBean() {
15+
public FilterRegistrationBean<JwtFilter> jwtFilterFilterRegistrationBean(JwtService jwtService) {
1916
FilterRegistrationBean<JwtFilter> jwtFilterFilterRegistrationBean = new FilterRegistrationBean<>();
2017
jwtFilterFilterRegistrationBean.setFilter(new JwtFilter(jwtService));
2118
jwtFilterFilterRegistrationBean.setUrlPatterns(List.of("/payments/initialize"));

src/main/java/br/com/grupo63/techchallenge/payment/config/JwtService.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/resources/application-dev.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,8 @@ spring:
3131
# --- Custom keys ---
3232

3333
app:
34+
auth:
35+
jwt_public_key: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqStd8n4SGNM0eZhV/hzU+urHA5/IMZPoP9YQ9ZcLKWiX33nI6bSuZMCrLZcJExf63xS+uxDpGxM8Mnk2zOdl+lPwANXLzP1us5P1PyA3YPycW9J7C5YTQW0GiEL3M93ZX7vMJiVoBYblP3JPlYnoYlBORuc0JPk33KtfEZP+78qXpPHM8imYrJLe8ceiDLLFDU/nh5KC2dWAy3ci1ahoJ1Q9ELhp3IZLvOTX57H/T2VKOYOya5+ST41h+JjzI+qGTVnLcKaW+k25YLlVnkSspvdx98+yQDi7kbOTS6yRZHUPD6wPk/nUozpD0nZKccoH4W+zMwmQVtsAA6JCA9gfGwIDAQAB}"
3436
api-url:
3537
order: "${API_URL_ORDER:http://localhost:8002/order}"
3638
production: "${API_URL_PRODUCTION:http://localhost:8004/production}"
37-
38-
jwt:
39-
token:
40-
key:
41-
public: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqStd8n4SGNM0eZhV/hzU+urHA5/IMZPoP9YQ9ZcLKWiX33nI6bSuZMCrLZcJExf63xS+uxDpGxM8Mnk2zOdl+lPwANXLzP1us5P1PyA3YPycW9J7C5YTQW0GiEL3M93ZX7vMJiVoBYblP3JPlYnoYlBORuc0JPk33KtfEZP+78qXpPHM8imYrJLe8ceiDLLFDU/nh5KC2dWAy3ci1ahoJ1Q9ELhp3IZLvOTX57H/T2VKOYOya5+ST41h+JjzI+qGTVnLcKaW+k25YLlVnkSspvdx98+yQDi7kbOTS6yRZHUPD6wPk/nUozpD0nZKccoH4W+zMwmQVtsAA6JCA9gfGwIDAQAB}"
42-

src/main/resources/application-prod.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ spring:
66
username: ${DB_USERNAME:backend}
77
devtools:
88
add-properties: false
9+
10+
info:
11+
ecs_metadata_url_v4: "${ECS_CONTAINER_METADATA_URI_V4:unknown}"

src/main/resources/application.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ server:
5050
# --- Custom keys ---
5151

5252
app:
53+
auth:
54+
jwt_public_key: "${JWT_PUBLIC_KEY}"
5355
aws:
5456
session-token: "${AWS_SESSION_TOKEN:}"
5557
docs-api-url: "${DOCS_API_URL:(no value)}"
@@ -62,7 +64,3 @@ info:
6264
description: "@project.description@"
6365
version: "@project.version@"
6466

65-
jwt:
66-
token:
67-
key:
68-
public: "${JWT_PUBLIC_KEY}"

src/test/java/br/com/grupo63/techchallenge/resources/application.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ spring:
1313
output:
1414
ansi:
1515
enabled: always
16-
jwt:
17-
token:
18-
key:
19-
public: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoNgzDuoQFLRFb3ivIA5CEHFRuqltT7xR6hFu+6xPD5q0sq8Exjue5s5MIQwkJMldk8/Dhp85OT5ULmAA5x4hPZfFlQEMlMPT5QItQImQ7UFCxBbMwksZlUQEP37Aa5OJ+KhEPBDTe0AaXqXFKxIOLEjHYWqhFHq5whxNotbuPrqLWEopCAgY4lqCe0pSoT3V+7Jszpq+czLBOl6eCbD933pK98/aVD9yA2+7LNOwmkYVyR4kvXX25K5Q/DDUZgMWyQTm3TCnfCrbdH6IH/Z12/DkePNuGFygUKDCEYPkPYnHbRXee4CXbeDkEdgZwzGJPM8gPhSUFrrzFVeihvN5OQIDAQAB}"
16+
2017
management:
2118
endpoints:
22-
enabled-by-default: false
19+
enabled-by-default: false
20+

0 commit comments

Comments
 (0)