Skip to content

Commit 721f170

Browse files
committed
feat: 网关请求参数验签、加解密
1 parent 2175ac3 commit 721f170

File tree

9 files changed

+338
-93
lines changed

9 files changed

+338
-93
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright © 2019 collin (1634753825@qq.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.smartframework.cloud.examples.support.gateway.constants;
17+
18+
/**
19+
* 数据安全常量
20+
*
21+
* @author collin
22+
* @date 2024-04-11
23+
*/
24+
public class DataSecurityConstants {
25+
26+
/**
27+
* url参数名
28+
*/
29+
public static final String URL_PARAM_NAME = "q";
30+
31+
}

application-module/support-module/support-service-gateway/src/main/java/org/smartframework/cloud/examples/support/gateway/constants/GatewayReturnCodes.java

+4
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,9 @@ public interface GatewayReturnCodes {
8585
* 不支持数据安全
8686
*/
8787
String NOT_SUPPORT_DATA_SECURITY = "400017";
88+
/**
89+
* 请求nonce缺失
90+
*/
91+
String REQUEST_NONCE_MISSING = "400018";
8892

8993
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright © 2019 collin (1634753825@qq.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.smartframework.cloud.examples.support.gateway.dto;
17+
18+
import lombok.Getter;
19+
import lombok.Setter;
20+
import lombok.ToString;
21+
22+
@Getter
23+
@Setter
24+
@ToString
25+
public class DataSecurityParamDTO {
26+
27+
private String headers;
28+
private String urlParamsBase64;
29+
private String bodyBase64;
30+
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright © 2019 collin (1634753825@qq.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.smartframework.cloud.examples.support.gateway.exception;
17+
18+
import io.github.smart.cloud.exception.BaseException;
19+
20+
/**
21+
* 请求nonce异常
22+
*
23+
* @author collin
24+
* @date 2024-04-11
25+
*/
26+
public class RequestNonceException extends BaseException {
27+
28+
public RequestNonceException(String code) {
29+
super(code);
30+
}
31+
32+
}

0 commit comments

Comments
 (0)