File tree Expand file tree Collapse file tree 23 files changed +78
-43
lines changed
java/com/springboot/auth/authentication/config
java/com/springboot/auth/authorization/config
consumer-ribbon/src/main/resources Expand file tree Collapse file tree 23 files changed +78
-43
lines changed Original file line number Diff line number Diff line change 36
36
<plugin >
37
37
<groupId >com.spotify</groupId >
38
38
<artifactId >docker-maven-plugin</artifactId >
39
- <version >1.0 .0</version >
39
+ <version >1.2 .0</version >
40
40
<configuration >
41
41
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
42
42
<imageName >cike/${project.artifactId} </imageName >
Original file line number Diff line number Diff line change 1
1
package com .springboot .auth .authentication .config ;
2
2
3
- import lombok .extern .slf4j .Slf4j ;
4
3
import org .springframework .context .annotation .Configuration ;
4
+ import org .springframework .core .annotation .Order ;
5
5
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
6
6
import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
7
7
import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
8
8
9
+ import lombok .extern .slf4j .Slf4j ;
10
+
11
+ @ Slf4j
9
12
@ Configuration
10
13
@ EnableWebSecurity
11
- @ Slf4j
14
+ @ Order ( 1 )
12
15
public class WebServerSecurityConfig extends WebSecurityConfigurerAdapter {
13
16
14
17
@ Override
15
18
protected void configure (HttpSecurity http ) throws Exception {
16
19
log .debug ("HttpSecurity configure method" );
17
20
http .csrf ().disable ();
18
21
http .authorizeRequests ()
22
+ .antMatchers ("/actuator/**" ).permitAll ()
19
23
.anyRequest ().authenticated ();
20
24
}
21
25
}
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ spring:
19
19
port : ${REDIS_PORT:6379}
20
20
# #password: ${REDIS_PASSWORD:}
21
21
datasource :
22
- url : jdbc:${DATASOURCE_DB:postgresql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:5432}/sc_auth
23
- username : ${DATASOURCE_USERNAME:postgres}
24
- password : ${DATASOURCE_PASSWORD:postgres }
25
- driver-class-name : ${DATASOURCE_DRIVER:org.postgresql.Driver }
22
+ driver-class-name : com.mysql. jdbc.Driver
23
+ url : jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
24
+ username : ${DATASOURCE_USERNAME:root }
25
+ password : ${DATASOURCE_PASSWORD:123456 }
26
26
27
27
zipkin :
28
28
enabled : true
Original file line number Diff line number Diff line change 42
42
<plugin >
43
43
<groupId >com.spotify</groupId >
44
44
<artifactId >docker-maven-plugin</artifactId >
45
- <version >1.0 .0</version >
45
+ <version >1.2 .0</version >
46
46
<configuration >
47
47
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
48
48
<imageName >cike/${project.artifactId} </imageName >
Original file line number Diff line number Diff line change 1
1
package com .springboot .auth .authorization .config ;
2
2
3
- import com .springboot .auth .authorization .oauth2 .granter .MobileAuthenticationProvider ;
4
- import lombok .extern .slf4j .Slf4j ;
5
3
import org .springframework .beans .factory .annotation .Autowired ;
6
4
import org .springframework .beans .factory .annotation .Qualifier ;
7
5
import org .springframework .context .annotation .Bean ;
15
13
import org .springframework .security .crypto .bcrypt .BCryptPasswordEncoder ;
16
14
import org .springframework .security .crypto .password .PasswordEncoder ;
17
15
16
+ import com .springboot .auth .authorization .oauth2 .granter .MobileAuthenticationProvider ;
17
+
18
+ import lombok .extern .slf4j .Slf4j ;
19
+
18
20
@ Slf4j
19
21
@ Configuration
20
22
@ EnableWebSecurity
@@ -32,6 +34,7 @@ public class WebServerSecurityConfig extends WebSecurityConfigurerAdapter {
32
34
protected void configure (HttpSecurity http ) throws Exception {
33
35
http .csrf ().disable ();
34
36
http .authorizeRequests ()
37
+ .antMatchers ("/actuator/**" ).permitAll ()
35
38
.anyRequest ().authenticated ()
36
39
.and ()
37
40
.formLogin ().permitAll ();
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ spring:
19
19
port : ${REDIS_PORT:6379}
20
20
# #password: ${REDIS_PASSWORD:}
21
21
datasource :
22
- url : jdbc:${DATASOURCE_DB:postgresql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:5432}/sc_auth
23
- username : ${DATASOURCE_USERNAME:postgres}
24
- password : ${DATASOURCE_PASSWORD:postgres }
25
- driver-class-name : ${DATASOURCE_DRIVER:org.postgresql.Driver }
22
+ driver-class-name : com.mysql. jdbc.Driver
23
+ url : jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
24
+ username : ${DATASOURCE_USERNAME:root }
25
+ password : ${DATASOURCE_PASSWORD:123456 }
26
26
27
27
zipkin :
28
28
enabled : true
Original file line number Diff line number Diff line change 53
53
<artifactId >druid-spring-boot-starter</artifactId >
54
54
<version >1.1.9</version >
55
55
</dependency >
56
+ <dependency >
57
+ <groupId >mysql</groupId >
58
+ <artifactId >mysql-connector-java</artifactId >
59
+ <version >5.1.39</version >
60
+ </dependency >
56
61
<!-- 数据库-->
57
62
<dependency >
58
63
<groupId >org.postgresql</groupId >
Original file line number Diff line number Diff line change 23
23
<plugin >
24
24
<groupId >com.spotify</groupId >
25
25
<artifactId >docker-maven-plugin</artifactId >
26
- <version >1.0 .0</version >
26
+ <version >1.2 .0</version >
27
27
<configuration >
28
28
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
29
29
<imageName >cike/${project.artifactId} </imageName >
Original file line number Diff line number Diff line change 36
36
<plugin >
37
37
<groupId >com.spotify</groupId >
38
38
<artifactId >docker-maven-plugin</artifactId >
39
- <version >1.0 .0</version >
39
+ <version >1.2 .0</version >
40
40
<configuration >
41
41
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
42
42
<imageName >cike/${project.artifactId} </imageName >
Original file line number Diff line number Diff line change 31
31
<plugin >
32
32
<groupId >com.spotify</groupId >
33
33
<artifactId >docker-maven-plugin</artifactId >
34
- <version >1.0 .0</version >
34
+ <version >1.2 .0</version >
35
35
<configuration >
36
36
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
37
37
<imageName >cike/${project.artifactId} </imageName >
You can’t perform that action at this time.
0 commit comments