Skip to content

Commit 2c667c6

Browse files
committed
refactor/修改统一包扫描及鉴权机制
1 parent ce69033 commit 2c667c6

File tree

68 files changed

+1725
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1725
-709
lines changed

pmhub-auth/src/main/java/com/laigeoffer/pmhub/auth/PmHubAuthApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @description 认证授权中心
1010
* @create 2024-04-23-15:00
1111
*/
12-
//@EnableRyFeignClients todo
12+
//@EnablePmFeignClients todo
1313
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
1414
public class PmHubAuthApplication {
1515
public static void main(String[] args) {

pmhub-base/pmhub-base-core/pom.xml

+7
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@
160160
<artifactId>jaxb-api</artifactId>
161161
</dependency>
162162

163+
<!-- Transmittable ThreadLocal -->
164+
<dependency>
165+
<groupId>com.alibaba</groupId>
166+
<artifactId>transmittable-thread-local</artifactId>
167+
</dependency>
168+
169+
163170
<!-- redis 缓存操作 -->
164171
<dependency>
165172
<groupId>org.springframework.boot</groupId>

pmhub-base/pmhub-base-core/src/main/java/com/laigeoffer/pmhub/base/core/aspect/SecrecyAspect.java

-199
This file was deleted.

pmhub-base/pmhub-base-core/src/main/java/com/laigeoffer/pmhub/base/core/constant/Constants.java

+6
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,10 @@ public class Constants
139139
*/
140140
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
141141
"org.springframework", "org.apache", "com.laigeoffer.pmhub.common.utils.file", "com.laigeoffer.pmhub.common.config" };
142+
143+
/**
144+
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
145+
*/
146+
public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" };
147+
142148
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.laigeoffer.pmhub.base.core.constant;
2+
3+
/**
4+
* 权限相关通用常量
5+
*
6+
* @author ruoyi
7+
*/
8+
public class SecurityConstants
9+
{
10+
/**
11+
* 用户ID字段
12+
*/
13+
public static final String DETAILS_USER_ID = "user_id";
14+
15+
/**
16+
* 用户名字段
17+
*/
18+
public static final String DETAILS_USERNAME = "username";
19+
20+
/**
21+
* 授权信息字段
22+
*/
23+
public static final String AUTHORIZATION_HEADER = "authorization";
24+
25+
/**
26+
* 请求来源
27+
*/
28+
public static final String FROM_SOURCE = "from-source";
29+
30+
/**
31+
* 内部请求
32+
*/
33+
public static final String INNER = "inner";
34+
35+
/**
36+
* 用户标识
37+
*/
38+
public static final String USER_KEY = "user_key";
39+
40+
/**
41+
* 登录用户
42+
*/
43+
public static final String LOGIN_USER = "login_user";
44+
45+
/**
46+
* 角色权限
47+
*/
48+
public static final String ROLE_PERMISSION = "role_permission";
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.laigeoffer.pmhub.base.core.constant;
2+
3+
/**
4+
* Token的Key常量
5+
*
6+
* @author ruoyi
7+
*/
8+
public class TokenConstants
9+
{
10+
/**
11+
* 令牌自定义标识
12+
*/
13+
public static final String AUTHENTICATION = "Authorization";
14+
15+
/**
16+
* 令牌前缀
17+
*/
18+
public static final String PREFIX = "Bearer ";
19+
20+
/**
21+
* 令牌秘钥
22+
*/
23+
public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
24+
25+
}

0 commit comments

Comments
 (0)