Skip to content

Commit eff3c3c

Browse files
committed
Add security and actuator
1 parent 94f88c4 commit eff3c3c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

spring-boot/spring-boot-codefirst/src/main/java/io/reflectoring/codefirst/CodeFirstApplication.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
import java.util.stream.Stream;
3333

3434

35+
@SpringBootApplication
36+
public class CodeFirstApplication {
37+
public static void main(String[] args) {
38+
SpringApplication.run(CodeFirstApplication.class, args);
39+
}
40+
}
41+
3542
@RequestMapping("/api/todos")
3643
@Tag(name = "Todo API", description = "euismod in pellentesque massa placerat duis ultricies lacus sed turpis")
3744
@SecurityRequirement(name = "api")
@@ -67,13 +74,6 @@ interface UnsecuredApi {
6774
String unsecured();
6875
}
6976

70-
@SpringBootApplication
71-
public class CodeFirstApplication {
72-
public static void main(String[] args) {
73-
SpringApplication.run(CodeFirstApplication.class, args);
74-
}
75-
}
76-
7777
@OpenAPIDefinition(
7878
info = @Info(
7979
title = "Code-First Approach (reflectoring.io)",
@@ -85,7 +85,7 @@ public static void main(String[] args) {
8585
license = @License(name = "MIT Licence", url = "https://github.com/thombergs/code-examples/blob/master/LICENSE")),
8686
servers = @Server(url = "http://localhost:8080")
8787
)
88-
@SecurityScheme(scheme = "basic", type = SecuritySchemeType.HTTP, name = "api", in = SecuritySchemeIn.HEADER)
88+
@SecurityScheme(name = "api", scheme = "basic", type = SecuritySchemeType.HTTP, in = SecuritySchemeIn.HEADER)
8989
class OpenAPIConfiguration {
9090
}
9191

0 commit comments

Comments
 (0)