pull/1/head
tanghc 5 years ago
parent 0496b70ec5
commit 9194482522
  1. 40
      doc/docs/files/10070_easyopen支持.md
  2. 2
      doc/docs/files/10096_使用SpringCloudGateway.md
  3. 3
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/validate/ApiValidator.java

@ -10,21 +10,39 @@ SOP对easyopen项目提供了很好的支持,如果您的服务端使用了eas
```xml ```xml
<!-- sop接入依赖 --> <!-- sop接入依赖 -->
<dependency> <dependency>
<groupId>com.gitee.sop</groupId> <groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId> <artifactId>sop-service-common</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency>
<!-- 使用nacos注册中心
版本 0.2.x.RELEASE 对应的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 对应的是 Spring Boot 1.x 版本。
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-alibaba-nacos-discovery
-->
<dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency> <version>0.2.2.RELEASE</version>
<dependency> <exclusions>
<exclusion>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>net.oschina.durcframework</groupId> <groupId>net.oschina.durcframework</groupId>
<artifactId>easyopen</artifactId> <artifactId>easyopen</artifactId>
<version>1.16.1</version> <version>1.16.1</version>
</dependency> </dependency>
<!-- sop接入依赖 end --> <!-- sop接入依赖 end -->
``` ```
easyopen版本必须升级到1.16.1 easyopen版本必须升级到1.16.1
@ -49,9 +67,7 @@ public class SopConfig extends EasyopenServiceConfiguration {
```java ```java
@Configuration @Configuration
public class ZuulConfig extends EasyopenZuulConfiguration { public class ZuulConfig extends EasyopenZuulConfiguration {
static {
new ManagerInitializer();
}
} }
``` ```

@ -69,5 +69,3 @@ public class GatewayConfig extends AlipayGatewayConfiguration {...}
``` ```
修改完毕,重启sop-gateway 修改完毕,重启sop-gateway
运行SpringCloudGatewayClientPostTest测试用例。

@ -59,7 +59,7 @@ public class ApiValidator implements Validator {
@Override @Override
public void validate(ApiParam param) { public void validate(ApiParam param) {
checkIP(param); checkIP(param);
checkEnable(param);
ApiConfig apiConfig = ApiContext.getApiConfig(); ApiConfig apiConfig = ApiContext.getApiConfig();
if (apiConfig.isIgnoreValidate() || param.fetchIgnoreValidate()) { if (apiConfig.isIgnoreValidate() || param.fetchIgnoreValidate()) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
@ -67,7 +67,6 @@ public class ApiValidator implements Validator {
} }
return; return;
} }
checkEnable(param);
// 需要验证签名,先校验appKey,后校验签名,顺序不能变 // 需要验证签名,先校验appKey,后校验签名,顺序不能变
checkAppKey(param); checkAppKey(param);
checkSign(param); checkSign(param);

Loading…
Cancel
Save