pull/1/head
tanghc 5 years ago
parent 0496b70ec5
commit 9194482522
  1. 26
      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

@ -13,12 +13,30 @@ SOP对easyopen项目提供了很好的支持,如果您的服务端使用了eas
<dependency>
<groupId>com.gitee.sop</groupId>
<artifactId>sop-service-common</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</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>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>0.2.2.RELEASE</version>
<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>
<artifactId>easyopen</artifactId>
@ -49,9 +67,7 @@ public class SopConfig extends EasyopenServiceConfiguration {
```java
@Configuration
public class ZuulConfig extends EasyopenZuulConfiguration {
static {
new ManagerInitializer();
}
}
```

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

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

Loading…
Cancel
Save