Skip to content

Commit 2591b16

Browse files
committed
fix: pf4j2 示例升级 org.pf4j 2.2.0 → 3.14.1,修复 CVE-2025-70952(Zip Slip)
- pf4j 3.0 移除了 org.pf4j.PluginException(改为运行时异常 PluginRuntimeException),同步迁移 pf4j2-plugin-api 中的 异常声明与 PluginInvokeException 父类 - 替代 Dependabot PR #32(Dependabot 无法处理源码级 API 迁移)
1 parent 9a158bd commit 2591b16

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

spring-boot-sample-pf4j2/pf4j2-plugin-sample/pf4j2-plugin-api/src/main/java/pf4j2/plugin/api/AuthcExtensionPoint.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
import javax.servlet.http.HttpServletRequest;
2121

2222
import org.pf4j.ExtensionPoint;
23-
import org.pf4j.PluginException;
23+
import org.pf4j.PluginRuntimeException;
2424

2525
public interface AuthcExtensionPoint extends ExtensionPoint {
2626

27-
String getToken(Map<String, Object> par,HttpServletRequest req) throws PluginException;
27+
String getToken(Map<String, Object> par,HttpServletRequest req) throws PluginRuntimeException;
2828

29-
void handleHeaderParams(Map<String, Object> par,HttpServletRequest req) throws PluginException;
29+
void handleHeaderParams(Map<String, Object> par,HttpServletRequest req) throws PluginRuntimeException;
3030

31-
void handleRequestParams(Map<String, Object> par,HttpServletRequest req) throws PluginException;
31+
void handleRequestParams(Map<String, Object> par,HttpServletRequest req) throws PluginRuntimeException;
3232

33-
Object handleResult(Object res) throws PluginException;
33+
Object handleResult(Object res) throws PluginRuntimeException;
3434
}

spring-boot-sample-pf4j2/pf4j2-plugin-sample/pf4j2-plugin-api/src/main/java/pf4j2/plugin/api/AuthcExtensionPointAdepter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@
1919

2020
import javax.servlet.http.HttpServletRequest;
2121

22-
import org.pf4j.PluginException;
22+
import org.pf4j.PluginRuntimeException;
2323

2424
public class AuthcExtensionPointAdepter implements AuthcExtensionPoint{
2525

2626
@Override
27-
public String getToken(Map<String, Object> par, HttpServletRequest req) throws PluginException{
27+
public String getToken(Map<String, Object> par, HttpServletRequest req) throws PluginRuntimeException{
2828
return null;
2929
}
3030

3131
@Override
32-
public void handleHeaderParams(Map<String, Object> par, HttpServletRequest req) throws PluginException {
32+
public void handleHeaderParams(Map<String, Object> par, HttpServletRequest req) throws PluginRuntimeException {
3333
}
3434

3535
@Override
36-
public void handleRequestParams(Map<String, Object> par, HttpServletRequest req) throws PluginException {
36+
public void handleRequestParams(Map<String, Object> par, HttpServletRequest req) throws PluginRuntimeException {
3737
}
3838

3939
@Override
40-
public Object handleResult(Object res) throws PluginException {
40+
public Object handleResult(Object res) throws PluginRuntimeException {
4141
return res;
4242
}
4343

spring-boot-sample-pf4j2/pf4j2-plugin-sample/pf4j2-plugin-api/src/main/java/pf4j2/plugin/api/exception/PluginInvokeException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package pf4j2.plugin.api.exception;
1717

18-
import org.pf4j.PluginException;
18+
import org.pf4j.PluginRuntimeException;
1919

2020
@SuppressWarnings("serial")
21-
public class PluginInvokeException extends PluginException{
21+
public class PluginInvokeException extends PluginRuntimeException{
2222

2323
private String pluginId;
2424

spring-boot-sample-pf4j2/pf4j2-plugin-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<commons-lang.version>2.6</commons-lang.version>
2424
<fastjson.version>1.2.61</fastjson.version>
2525
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
26-
<pf4j.version>2.2.0</pf4j.version>
26+
<pf4j.version>3.14.1</pf4j.version>
2727
<pf4j-update.version>2.0.0</pf4j-update.version>
2828
<pf4j-spring.version>0.4.0</pf4j-spring.version>
2929
<slf4j.version>1.7.21</slf4j.version>

0 commit comments

Comments
 (0)