File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed
src/main/java/br/com/grupo63/techchallenge/payment Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 28
28
<dependency >
29
29
<groupId >com.github.soat-tech-challenge</groupId >
30
30
<artifactId >service-common</artifactId >
31
- <version >4.1 .0</version >
31
+ <version >4.2 .0</version >
32
32
</dependency >
33
33
<dependency >
34
34
<groupId >org.springframework.boot</groupId >
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 .Arrays ;
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 (Arrays .asList ("/orders" , "/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
+ }
You can’t perform that action at this time.
0 commit comments