From e3b42d2b95a9051ef91cd499d14274bd87a6ac01 Mon Sep 17 00:00:00 2001 From: Administrator Date: Wed, 15 May 2024 23:44:22 +0800 Subject: [PATCH] github --- gateway/pom.xml | 24 ++++++++++++++++++- .../filter/RequestDecryptionGlobalFilter.java | 4 ++-- library/pom.xml | 17 +++++++++++++ pom.xml | 2 -- 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/gateway/pom.xml b/gateway/pom.xml index 368dc22..0aae789 100644 --- a/gateway/pom.xml +++ b/gateway/pom.xml @@ -6,6 +6,7 @@ security-api-demo org.example 1.0-SNAPSHOT + ../pom.xml 4.0.0 gateway @@ -41,7 +42,28 @@ aspectjweaver 1.9.7 - + + org.apache.commons + commons-lang3 + 3.11 + + + + commons-collections + commons-collections + 3.2.2 + + + + com.alibaba + fastjson + 1.2.73 + + + commons-codec + commons-codec + 1.15 + diff --git a/gateway/src/main/java/com/demo/gateway/filter/RequestDecryptionGlobalFilter.java b/gateway/src/main/java/com/demo/gateway/filter/RequestDecryptionGlobalFilter.java index e92f8d9..d8636bd 100644 --- a/gateway/src/main/java/com/demo/gateway/filter/RequestDecryptionGlobalFilter.java +++ b/gateway/src/main/java/com/demo/gateway/filter/RequestDecryptionGlobalFilter.java @@ -2,7 +2,7 @@ package com.demo.gateway.filter; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.alibaba.nacos.common.utils.Md5Utils; +import org.apache.commons.codec.digest.DigestUtils; import com.demo.gateway.config.FilterUtils; import com.demo.gateway.pojo.MyCachedBodyOutputMessage; import com.demo.gateway.utils.AESUtil; @@ -127,7 +127,7 @@ public class RequestDecryptionGlobalFilter implements GlobalFilter, Ordered { public void checkSign(String sign, Long dateTimestamp, String requestId, Map paramMap) { String str = JSON.toJSONString(paramMap) + requestId + dateTimestamp; - String tempSign = Md5Utils.getMD5(str.getBytes()); + String tempSign = DigestUtils.md5Hex(str); if (!tempSign.equals(sign)) { throw new IllegalArgumentException(SIGN_ERROR_MESSAGE); } diff --git a/library/pom.xml b/library/pom.xml index 80c569e..2fdadfb 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -79,6 +79,23 @@ java-jwt 3.18.2 + + org.apache.commons + commons-lang3 + 3.11 + + + + commons-collections + commons-collections + 3.2.2 + + + + com.alibaba + fastjson + 1.2.73 + diff --git a/pom.xml b/pom.xml index 9506a77..bd767f9 100644 --- a/pom.xml +++ b/pom.xml @@ -11,8 +11,6 @@ gateway library - -