Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pig_冷冷
Pig
提交
e1510165
Pig
项目概览
pig_冷冷
/
Pig
上一次同步 12 个月
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Pig
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e1510165
编写于
3月 30, 2020
作者:
pig_冷冷
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🔖
Releasing / Version tags. 2.7.1
上级
5a35db49
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
127 addition
and
136 deletion
+127
-136
.gitee/ISSUE_TEMPLATE.zh-CN.md
.gitee/ISSUE_TEMPLATE.zh-CN.md
+3
-0
pig-auth/pom.xml
pig-auth/pom.xml
+3
-3
pig-codegen/pom.xml
pig-codegen/pom.xml
+7
-7
pig-common/pig-common-core/pom.xml
pig-common/pig-common-core/pom.xml
+1
-1
pig-common/pig-common-datasource/pom.xml
pig-common/pig-common-datasource/pom.xml
+1
-1
pig-common/pig-common-log/pom.xml
pig-common/pig-common-log/pom.xml
+3
-3
pig-common/pig-common-mybatis/pom.xml
pig-common/pig-common-mybatis/pom.xml
+1
-1
pig-common/pig-common-security/pom.xml
pig-common/pig-common-security/pom.xml
+3
-3
pig-common/pig-common-swagger/pom.xml
pig-common/pig-common-swagger/pom.xml
+1
-1
pig-common/pom.xml
pig-common/pom.xml
+1
-1
pig-gateway/pom.xml
pig-gateway/pom.xml
+2
-2
pig-monitor/pom.xml
pig-monitor/pom.xml
+1
-1
pig-register/pom.xml
pig-register/pom.xml
+1
-1
pig-register/src/main/java/com/alibaba/nacos/console/config/WebSecurityConfig.java
...a/com/alibaba/nacos/console/config/WebSecurityConfig.java
+3
-3
pig-register/src/main/java/com/alibaba/nacos/console/utils/JwtTokenUtils.java
...n/java/com/alibaba/nacos/console/utils/JwtTokenUtils.java
+86
-98
pig-upms/pig-upms-api/pom.xml
pig-upms/pig-upms-api/pom.xml
+2
-2
pig-upms/pig-upms-biz/pom.xml
pig-upms/pig-upms-biz/pom.xml
+6
-6
pig-upms/pom.xml
pig-upms/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
未找到文件。
.gitee/ISSUE_TEMPLATE.zh-CN.md
浏览文件 @
e1510165
[
pigx 相关问题请去此提,码云忽略
](
https://git.pig4cloud.com/pig/pigx/issues
)
### 版本信息
-
pig版本:
-
是否修改包名:
...
...
pig-auth/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-auth
</artifactId>
...
...
@@ -46,13 +46,13 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--security-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-security
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--JDBC相关-->
<dependency>
...
...
pig-codegen/pom.xml
浏览文件 @
e1510165
...
...
@@ -24,7 +24,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-codegen
</artifactId>
...
...
@@ -37,7 +37,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-swagger
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--注册中心客户端-->
<dependency>
...
...
@@ -53,30 +53,30 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-datasource
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-mybatis
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--common-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--日志处理-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-log
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--安全模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-security
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--代码生成模板引擎-->
<dependency>
...
...
pig-common/pig-common-core/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common-core
</artifactId>
...
...
pig-common/pig-common-datasource/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<artifactId>
pig-common
</artifactId>
<groupId>
com.pig4cloud
</groupId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
pig-common/pig-common-log/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common-log
</artifactId>
...
...
@@ -37,13 +37,13 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--UPMS接口模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--安全依赖获取上下文信息-->
<dependency>
...
...
pig-common/pig-common-mybatis/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common-mybatis
</artifactId>
...
...
pig-common/pig-common-security/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common-security
</artifactId>
...
...
@@ -37,7 +37,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--安全模块-->
<dependency>
...
...
@@ -52,7 +52,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
</dependencies>
</project>
pig-common/pig-common-swagger/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common-swagger
</artifactId>
...
...
pig-common/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-common
</artifactId>
...
...
pig-gateway/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-gateway
</artifactId>
...
...
@@ -61,7 +61,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--接口文档-->
<dependency>
...
...
pig-monitor/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-monitor
</artifactId>
...
...
pig-register/pom.xml
浏览文件 @
e1510165
...
...
@@ -24,7 +24,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-register
</artifactId>
...
...
pig-register/src/main/java/com/alibaba/nacos/console/config/WebSecurityConfig.java
浏览文件 @
e1510165
...
...
@@ -75,9 +75,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public
void
configure
(
WebSecurity
web
)
{
String
ignoreU
RL
s
=
env
.
getProperty
(
"nacos.security.ignore.urls"
,
"/**"
);
for
(
String
ignoreURL
:
ignoreURL
s
.
trim
().
split
(
SECURITY_IGNORE_URLS_SPILT_CHAR
))
{
web
.
ignoring
().
antMatchers
(
ignoreURL
.
trim
());
String
ignoreU
rl
s
=
env
.
getProperty
(
"nacos.security.ignore.urls"
,
"/**"
);
for
(
String
url
:
ignoreUrl
s
.
trim
().
split
(
SECURITY_IGNORE_URLS_SPILT_CHAR
))
{
web
.
ignoring
().
antMatchers
(
url
.
trim
());
}
}
...
...
pig-register/src/main/java/com/alibaba/nacos/console/utils/JwtTokenUtils.java
浏览文件 @
e1510165
...
...
@@ -38,102 +38,90 @@ import java.util.List;
@Component
public
class
JwtTokenUtils
{
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
JwtTokenUtils
.
class
);
private
static
final
String
AUTHORITIES_KEY
=
"auth"
;
/**
* secret key
*/
private
String
secretKey
;
/**
* Token validity time(ms)
*/
private
long
tokenValidityInMilliseconds
;
@PostConstruct
public
void
init
()
{
this
.
secretKey
=
"SecretKey012345678901234567890123456789012345678901234567890123456789"
;
this
.
tokenValidityInMilliseconds
=
1000
*
60
*
30L
;
}
/**
* Create token
*
* @param authentication auth info
* @return token
*/
public
String
createToken
(
Authentication
authentication
)
{
/**
* Current time
*/
long
now
=
(
new
Date
()).
getTime
();
/**
* Validity date
*/
Date
validity
;
validity
=
new
Date
(
now
+
this
.
tokenValidityInMilliseconds
);
/**
* create token
*/
return
Jwts
.
builder
()
.
setSubject
(
authentication
.
getName
())
.
claim
(
AUTHORITIES_KEY
,
""
)
.
setExpiration
(
validity
)
.
signWith
(
SignatureAlgorithm
.
HS256
,
secretKey
)
.
compact
();
}
/**
* Get auth Info
*
* @param token token
* @return auth info
*/
public
Authentication
getAuthentication
(
String
token
)
{
/**
* parse the payload of token
*/
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
secretKey
)
.
parseClaimsJws
(
token
)
.
getBody
();
List
<
GrantedAuthority
>
authorities
=
AuthorityUtils
.
commaSeparatedStringToAuthorityList
((
String
)
claims
.
get
(
AUTHORITIES_KEY
));
User
principal
=
new
User
(
claims
.
getSubject
(),
""
,
authorities
);
return
new
UsernamePasswordAuthenticationToken
(
principal
,
""
,
authorities
);
}
/**
* validate token
*
* @param token token
* @return whether valid
*/
public
boolean
validateToken
(
String
token
)
{
try
{
Jwts
.
parser
().
setSigningKey
(
secretKey
).
parseClaimsJws
(
token
);
return
true
;
}
catch
(
SignatureException
e
)
{
log
.
info
(
"Invalid JWT signature."
);
log
.
trace
(
"Invalid JWT signature trace: {}"
,
e
);
}
catch
(
MalformedJwtException
e
)
{
log
.
info
(
"Invalid JWT token."
);
log
.
trace
(
"Invalid JWT token trace: {}"
,
e
);
}
catch
(
ExpiredJwtException
e
)
{
log
.
info
(
"Expired JWT token."
);
log
.
trace
(
"Expired JWT token trace: {}"
,
e
);
}
catch
(
UnsupportedJwtException
e
)
{
log
.
info
(
"Unsupported JWT token."
);
log
.
trace
(
"Unsupported JWT token trace: {}"
,
e
);
}
catch
(
IllegalArgumentException
e
)
{
log
.
info
(
"JWT token compact of handler are invalid."
);
log
.
trace
(
"JWT token compact of handler are invalid trace: {}"
,
e
);
}
return
false
;
}
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
JwtTokenUtils
.
class
);
private
static
final
String
AUTHORITIES_KEY
=
"auth"
;
/**
* secret key
*/
private
String
secretKey
;
/**
* Token validity time(ms)
*/
private
long
tokenValidityInMilliseconds
;
@PostConstruct
public
void
init
()
{
this
.
secretKey
=
"SecretKey012345678901234567890123456789012345678901234567890123456789"
;
this
.
tokenValidityInMilliseconds
=
1000
*
60
*
30L
;
}
/**
* Create token
*
* @param authentication auth info
* @return token
*/
public
String
createToken
(
Authentication
authentication
)
{
/**
* Current time
*/
long
now
=
(
new
Date
()).
getTime
();
/**
* Validity date
*/
Date
validity
;
validity
=
new
Date
(
now
+
this
.
tokenValidityInMilliseconds
);
/**
* create token
*/
return
Jwts
.
builder
()
.
setSubject
(
authentication
.
getName
())
.
claim
(
AUTHORITIES_KEY
,
""
)
.
setExpiration
(
validity
)
.
signWith
(
SignatureAlgorithm
.
HS256
,
secretKey
)
.
compact
();
}
/**
* Get auth Info
*
* @param token token
* @return auth info
*/
public
Authentication
getAuthentication
(
String
token
)
{
/**
* parse the payload of token
*/
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
secretKey
)
.
parseClaimsJws
(
token
)
.
getBody
();
List
<
GrantedAuthority
>
authorities
=
AuthorityUtils
.
commaSeparatedStringToAuthorityList
((
String
)
claims
.
get
(
AUTHORITIES_KEY
));
User
principal
=
new
User
(
claims
.
getSubject
(),
""
,
authorities
);
return
new
UsernamePasswordAuthenticationToken
(
principal
,
""
,
authorities
);
}
/**
* validate token
*
* @param token token
* @return whether valid
*/
public
boolean
validateToken
(
String
token
)
{
try
{
Jwts
.
parser
().
setSigningKey
(
secretKey
).
parseClaimsJws
(
token
);
return
true
;
}
catch
(
Exception
e
)
{
log
.
info
(
"Invalid JWT signature."
);
log
.
trace
(
"Invalid JWT signature trace: {}"
,
e
);
}
return
false
;
}
}
pig-upms/pig-upms-api/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-upms-api
</artifactId>
...
...
@@ -37,7 +37,7 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-core
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
</dependencies>
</project>
pig-upms/pig-upms-biz/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-upms-biz
</artifactId>
...
...
@@ -36,31 +36,31 @@
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-upms-api
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--安全模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-security
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--日志处理-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-log
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--接口文档-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-swagger
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--mybatis 模块-->
<dependency>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig-common-mybatis
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</dependency>
<!--注册中心客户端-->
<dependency>
...
...
pig-upms/pom.xml
浏览文件 @
e1510165
...
...
@@ -23,7 +23,7 @@
<parent>
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
</parent>
<artifactId>
pig-upms
</artifactId>
...
...
pom.xml
浏览文件 @
e1510165
...
...
@@ -29,7 +29,7 @@
<groupId>
com.pig4cloud
</groupId>
<artifactId>
pig
</artifactId>
<version>
2.7.
0
</version>
<version>
2.7.
1
</version>
<name>
${project.artifactId}
</name>
<packaging>
pom
</packaging>
<url>
https://www.pig4cloud.com
</url>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录