Skip to content

Commit

Permalink
The interface of basic data management should be judged by the admini…
Browse files Browse the repository at this point in the history
…strator. (apache#5108)

* Add administrator judgment

* Add jdbc params

* Add file path judgment

* add throw Exception

* code format

code format

* remove no use file

* code optimize

* use feign requestInterceptor to fixed server

* add gateway ip priority load balancer

* Fix Rpc bug

* Support automatic retry for important RPC requests

* Fix build issue

* code format
  • Loading branch information
peacewong committed May 14, 2024
1 parent d811d03 commit 43cb5b2
Show file tree
Hide file tree
Showing 47 changed files with 229 additions and 974 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,40 @@ private static boolean isNotSecurity(String key, String value, String param) {
return key.toLowerCase().contains(param.toLowerCase())
|| value.toLowerCase().contains(param.toLowerCase());
}

/**
* allowLoadLocalInfile=false&autoDeserialize=false&allowLocalInfile=false&allowUrlInLocalInfile=false
*
* @return
*/
public static Properties getMysqlSecurityParams() {
Properties properties = new Properties();
properties.setProperty("allowLoadLocalInfile", "false");
properties.setProperty("autoDeserialize", "false");
properties.setProperty("allowLocalInfile", "false");
properties.setProperty("allowUrlInLocalInfile", "false");
return properties;
}

/**
* Check if the path has a relative path
*
* @param path
* @return
*/
public static boolean containsRelativePath(String path) {
if (path.startsWith("./")
|| path.contains("/./")
|| path.startsWith("../")
|| path.contains("/../")) {
return true;
}
if (path.startsWith(".\\")
|| path.contains("\\.\\")
|| path.startsWith("..\\")
|| path.contains("\\..\\")) {
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class AbstractRetryableProtocol implements RetryableProtocol {

@Override
public long maxPeriod() {
return 3000L;
return 30000L;
}

@Override
Expand All @@ -31,11 +31,11 @@ public Class<? extends Throwable>[] retryExceptions() {

@Override
public int retryNum() {
return 2;
return 5;
}

@Override
public long period() {
return 1000L;
return 10000L;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package org.apache.linkis.protocol

trait RetryableProtocol extends Protocol {
def retryNum: Int = 2
def period: Long = 1000L
def maxPeriod: Long = 3000L
def retryNum: Int = 5
def period: Long = 10000L
def maxPeriod: Long = 30000L
def retryExceptions: Array[Class[_ <: Throwable]] = Array.empty[Class[_ <: Throwable]]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
* limitations under the License.
*/

package org.apache.linkis.rpc.loadbalancer;
package org.apache.linkis.protocol

public class GatewayLoadBalancerConfiguration {}
case class UserWithCreator(user: String, creator: String)

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 43cb5b2

Please sign in to comment.