File tree Expand file tree Collapse file tree 5 files changed +50
-1
lines changed
java/br/com/grupo63/techchallenge/payment Expand file tree Collapse file tree 5 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 15
15
<description >FIAP SOAT1 2023 - Group 63 - Payment microservice</description >
16
16
<properties >
17
17
<java .version>17</java .version>
18
+
19
+ <sonar .coverage.exclusions>
20
+ **/config/*
21
+ </sonar .coverage.exclusions>
18
22
</properties >
19
23
20
24
<repositories >
28
32
<dependency >
29
33
<groupId >com.github.soat-tech-challenge</groupId >
30
34
<artifactId >service-common</artifactId >
31
- <version >4.1 .0</version >
35
+ <version >4.2 .0</version >
32
36
</dependency >
33
37
<dependency >
34
38
<groupId >org.springframework.boot</groupId >
178
182
<exclude >**/br/com/grupo63/techchallenge/payment/api/controller/dto/PaymentStatusResponseDTO.class</exclude >
179
183
<exclude >**/br/com/grupo63/techchallenge/payment/api/controller/dto/QRCodeResponseDTO.class</exclude >
180
184
<exclude >**/br/com/grupo63/techchallenge/payment/gateway/order/dto/OrderDTO.class</exclude >
185
+ <exclude >**/br/com/grupo63/techchallenge/payment/config/JwtFilterConfig.class</exclude >
186
+ <exclude >**/br/com/grupo63/techchallenge/payment/config/JwtService.class</exclude >
181
187
<exclude >**/br/com/grupo63/techchallenge/payment/ServicePaymentApplication.class</exclude >
182
188
</excludes >
183
189
</configuration >
Original file line number Diff line number Diff line change 1
1
package br .com .grupo63 .techchallenge .payment ;
2
2
3
+ import io .swagger .v3 .oas .annotations .enums .SecuritySchemeIn ;
4
+ import io .swagger .v3 .oas .annotations .enums .SecuritySchemeType ;
5
+ import io .swagger .v3 .oas .annotations .security .SecurityScheme ;
3
6
import org .springframework .boot .SpringApplication ;
4
7
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
8
import org .springframework .cloud .openfeign .EnableFeignClients ;
6
9
7
10
@ SpringBootApplication
8
11
@ EnableFeignClients
12
+ @ SecurityScheme (
13
+ name = "bearerAuth" ,
14
+ type = SecuritySchemeType .HTTP ,
15
+ scheme = "bearer" ,
16
+ bearerFormat = "JWT" ,
17
+ in = SecuritySchemeIn .HEADER
18
+ )
9
19
public class ServicePaymentApplication {
10
20
11
21
public static void main (String [] args ) {
Original file line number Diff line number Diff line change
1
+ package br .com .grupo63 .techchallenge .payment .config ;
2
+
3
+ import br .com .grupo63 .techchallenge .common .config .JwtFilter ;
4
+ import org .springframework .beans .factory .annotation .Autowired ;
5
+ import org .springframework .boot .web .servlet .FilterRegistrationBean ;
6
+ import org .springframework .context .annotation .Bean ;
7
+ import org .springframework .context .annotation .Configuration ;
8
+
9
+ import java .util .List ;
10
+
11
+ @ Configuration
12
+ public class JwtFilterConfig {
13
+
14
+ @ Autowired
15
+ private JwtService jwtService ;
16
+
17
+ @ Bean
18
+ public FilterRegistrationBean <JwtFilter > jwtFilterFilterRegistrationBean () {
19
+ FilterRegistrationBean <JwtFilter > jwtFilterFilterRegistrationBean = new FilterRegistrationBean <>();
20
+ jwtFilterFilterRegistrationBean .setFilter (new JwtFilter (jwtService ));
21
+ jwtFilterFilterRegistrationBean .setUrlPatterns (List .of ("/payments/initialize" ));
22
+ return jwtFilterFilterRegistrationBean ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ package br .com .grupo63 .techchallenge .payment .config ;
2
+
3
+ import org .springframework .stereotype .Service ;
4
+
5
+ @ Service
6
+ public class JwtService extends br .com .grupo63 .techchallenge .common .config .JwtService {
7
+
8
+ }
Original file line number Diff line number Diff line change
1
+ sonar.exclusions =src/java/br/com/grupo63/techchallenge/payment/config/**
You can’t perform that action at this time.
0 commit comments