Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<lombok.version>1.18.12</lombok.version>
<versions.java-security-toolkit>1.2.1</versions.java-security-toolkit>
</properties>

<dependencies>
Expand Down Expand Up @@ -216,5 +217,13 @@
</build>
</profile>
</profiles>

<dependencyManagement>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
6 changes: 5 additions & 1 deletion powerjob-official-processors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
<version>${mysql.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -172,4 +176,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tech.powerjob.official.processors.impl.script;

import io.github.pixee.security.BoundedLineReader;
import tech.powerjob.worker.common.utils.PowerFileUtils;
import tech.powerjob.worker.core.processor.ProcessResult;
import tech.powerjob.worker.core.processor.TaskContext;
Expand Down Expand Up @@ -142,7 +143,7 @@ private String prepareScriptFile(Long instanceId, String processorInfo) throws I
private void copyStream(InputStream is, StringBuilder sb, OmsLogger omsLogger, Charset charset) {
String line;
try (BufferedReader br = new BufferedReader(new InputStreamReader(is, charset))) {
while ((line = br.readLine()) != null) {
while ((line = BoundedLineReader.readLine(br, 5_000_000)) != null) {
sb.append(line).append(System.lineSeparator());
// 同步到在线日志
omsLogger.info(line);
Expand Down
10 changes: 7 additions & 3 deletions powerjob-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<aliyun-sdk-oss.version>3.17.1</aliyun-sdk-oss.version>
<minio.version>8.5.2</minio.version>
<commons-collections4.version>4.4</commons-collections4.version>
<versions.java-security-toolkit>1.2.1</versions.java-security-toolkit>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -126,8 +127,11 @@
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>


<dependency>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -325,4 +329,4 @@
</plugins>
</build>

</project>
</project>
6 changes: 5 additions & 1 deletion powerjob-server/powerjob-server-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<groupId>tech.powerjob</groupId>
<artifactId>powerjob-server-persistence</artifactId>
</dependency>
<dependency>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library holds security tools for protecting Java API calls.

License: MIT ✅ | Open source ✅ | More facts

<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
</dependency>
</dependencies>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tech.powerjob.server.core.container;

import io.github.pixee.security.BoundedLineReader;
import tech.powerjob.common.ContainerConstant;
import net.lingala.zip4j.ZipFile;
import org.apache.commons.io.FileUtils;
Expand Down Expand Up @@ -51,7 +52,7 @@ public static File generate(String group, String artifact, String name, String p
String line;
StringBuilder buffer = new StringBuilder();
try (BufferedReader br = new BufferedReader(new FileReader(pomPath))) {
while ((line = br.readLine()) != null) {
while ((line = BoundedLineReader.readLine(br, 5_000_000)) != null) {

if (line.contains("<groupId>groupId</groupId>")) {
buffer.append(" <groupId>").append(group).append("</groupId>");
Expand Down Expand Up @@ -82,7 +83,7 @@ public static File generate(String group, String artifact, String name, String p
buffer.setLength(0);

try (BufferedReader br = new BufferedReader(new FileReader(springXMLPath))) {
while ((line = br.readLine()) != null) {
while ((line = BoundedLineReader.readLine(br, 5_000_000)) != null) {

if (line.contains("<context:component-scan base-package=\"")) {
buffer.append(" <context:component-scan base-package=\"").append(packageName).append("\"/>");
Expand Down