Skip to content

Commit 2969d92

Browse files
committed
fix solution
1 parent 935238e commit 2969d92

File tree

8 files changed

+51
-23
lines changed

8 files changed

+51
-23
lines changed

labs/initial/product/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
<dependency>
5555
<groupId>org.springdoc</groupId>
5656
<artifactId>springdoc-openapi-starter-common</artifactId>
57-
<version>2.0.4</version>
57+
<version>2.1.0</version>
5858
</dependency>
5959
<dependency>
6060
<groupId>org.springdoc</groupId>
6161
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
62-
<version>2.0.4</version>
62+
<version>2.1.0</version>
6363
</dependency>
6464
<dependency>
6565
<groupId>org.springframework.boot</groupId>
@@ -96,6 +96,10 @@
9696
<groupId>org.springframework.boot</groupId>
9797
<artifactId>spring-boot-maven-plugin</artifactId>
9898
</plugin>
99+
<plugin>
100+
<groupId>io.github.git-commit-id</groupId>
101+
<artifactId>git-commit-id-maven-plugin</artifactId>
102+
</plugin>
99103
</plugins>
100104
</build>
101105

labs/initial/product/src/main/java/com/example/ProductInitializer.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
public class ProductInitializer implements CommandLineRunner {
2525
private static final Logger LOG = LoggerFactory.getLogger(ProductInitializer.class.getName());
2626

27-
private static final String STANDARD_USER_FIRST_NAME = "Bruce";
28-
private static final String STANDARD_USER_LAST_NAME = "Wayne";
29-
private static final String ADMIN_USER_FIRST_NAME = "Peter";
30-
private static final String ADMIN_USER_LAST_NAME = "Parker";
31-
3227
private final ProductEntityRepository productEntityRepository;
3328
private final ProductUserEntityRepository productUserEntityRepository;
3429
private final PasswordEncoder passwordEncoder;
@@ -57,16 +52,23 @@ public void run(String... strings) {
5752
Stream.of(
5853
new ProductUserEntity(
5954
randomUUID().toString(),
60-
STANDARD_USER_FIRST_NAME,
61-
STANDARD_USER_LAST_NAME,
62-
passwordEncoder.encode("bruce_4demo!"),
55+
"Bruce",
56+
"Wayne",
57+
passwordEncoder.encode("wayne"),
6358
"bruce.wayne@example.com",
6459
Collections.singletonList("USER")),
6560
new ProductUserEntity(
6661
randomUUID().toString(),
67-
ADMIN_USER_FIRST_NAME,
68-
ADMIN_USER_LAST_NAME,
69-
passwordEncoder.encode("peter_4demo!"),
62+
"Clark",
63+
"Kent",
64+
passwordEncoder.encode("kent"),
65+
"clark.kent@example.com",
66+
Collections.singletonList("USER")),
67+
new ProductUserEntity(
68+
randomUUID().toString(),
69+
"Peter",
70+
"Parker",
71+
passwordEncoder.encode("parker"),
7072
"peter.parker@example.com",
7173
Arrays.asList("USER", "ADMIN")))
7274
.forEach(productUserEntityRepository::save);

labs/initial/product/src/main/resources/application.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ management:
2626
show-details: when_authorized
2727
info:
2828
enabled: true
29+
info:
30+
env:
31+
enabled: true
32+
java:
33+
enabled: true
34+
git:
35+
enabled: true
36+
os:
37+
enabled: true
2938
endpoints:
3039
web:
3140
exposure:

labs/solution/product/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
<dependency>
5555
<groupId>org.springdoc</groupId>
5656
<artifactId>springdoc-openapi-starter-common</artifactId>
57-
<version>2.0.4</version>
57+
<version>2.1.0</version>
5858
</dependency>
5959
<dependency>
6060
<groupId>org.springdoc</groupId>
6161
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
62-
<version>2.0.4</version>
62+
<version>2.1.0</version>
6363
</dependency>
6464
<dependency>
6565
<groupId>org.springframework.boot</groupId>
@@ -96,6 +96,10 @@
9696
<groupId>org.springframework.boot</groupId>
9797
<artifactId>spring-boot-maven-plugin</artifactId>
9898
</plugin>
99+
<plugin>
100+
<groupId>io.github.git-commit-id</groupId>
101+
<artifactId>git-commit-id-maven-plugin</artifactId>
102+
</plugin>
99103
</plugins>
100104
</build>
101105

labs/solution/product/src/main/resources/application.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ management:
3030
show-details: when_authorized
3131
info:
3232
enabled: true
33+
info:
34+
env:
35+
enabled: true
36+
java:
37+
enabled: true
38+
git:
39+
enabled: true
40+
os:
41+
enabled: true
3342
endpoints:
3443
web:
3544
exposure:

labs/solution/ui/src/main/resources/application.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,26 @@ spring:
1919
registration:
2020
auth0:
2121
client-id: 'v13BSQLEZnw4N96V36dDdsGRd022isKe'
22-
authorizationGrantType: authorization_code
23-
clientAuthenticationMethod: NONE
22+
authorization-grant-type: authorization_code
23+
client-authentication-method: none
2424
redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
2525
scope:
2626
- openid
2727
- profile
2828
- email
2929
keycloak:
3030
client-id: 'product-client'
31-
authorizationGrantType: authorization_code
32-
clientAuthenticationMethod: NONE
31+
authorization-grant-type: authorization_code
32+
client-authentication-method: none
3333
redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
3434
scope:
3535
- openid
3636
- profile
3737
- email
3838
spring:
3939
client-id: 'demo-client-pkce'
40-
authorizationGrantType: authorization_code
41-
clientAuthenticationMethod: NONE
40+
authorization-grant-type: authorization_code
41+
client-authentication-method: none
4242
redirect-uri: '{baseUrl}/login/oauth2/code/{registrationId}'
4343
scope:
4444
- openid

labs/solution/ui/src/main/resources/templates/products.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<nav class="navbar navbar-expand-lg bg-light">
99
<div class="container">
1010
<ul class="nav">
11-
<li class="nav-item"><a class="nav-link" th:href="@{/static}" href="#">Home</a></li>
11+
<li class="nav-item"><a class="nav-link" th:href="@{/}" href="#">Home</a></li>
1212
<li class="nav-item"><a class="nav-link" th:href="logout" href="#">Logout</a></li>
1313
</ul>
1414
<span class="navbar-text" th:text="${username}">User</span>

labs/solution/ui/src/main/resources/templates/users.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<nav class="navbar navbar-expand-lg bg-light">
99
<div class="container">
1010
<ul class="nav">
11-
<li class="nav-item"><a class="nav-link" th:href="@{/static}" href="#">Home</a></li>
11+
<li class="nav-item"><a class="nav-link" th:href="@{/}" href="#">Home</a></li>
1212
<li class="nav-item"><a class="nav-link" th:href="logout" href="#">Logout</a></li>
1313
</ul>
1414
<span class="navbar-text" th:text="${username}">User</span>

0 commit comments

Comments
 (0)