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

Skip to content
Closed
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
4 changes: 4 additions & 0 deletions modules/openapi-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@
<artifactId>lombok</artifactId>
<version>${lombok.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>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.openapitools.codegen.ignore;

import io.github.pixee.security.BoundedLineReader;
import org.openapitools.codegen.ignore.rules.DirectoryRule;
import org.openapitools.codegen.ignore.rules.Rule;
import org.slf4j.Logger;
Expand Down Expand Up @@ -112,7 +113,7 @@ void loadCodegenRules(final File codegenIgnore) throws IOException {

// NOTE: Comments that start with a : (e.g. //:) are pulled from git documentation for .gitignore
// see: https://github.com/git/git/blob/90f7b16b3adc78d4bbabbd426fb69aa78c714f71/Documentation/gitignore.txt
while ((line = reader.readLine()) != null) {
while ((line = BoundedLineReader.readLine(reader, 5_000_000)) != null) {
if(
//: A blank line matches no files, so it can serve as a separator for readability.
line.length() == 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.openapitools.codegen.languages;

import com.google.common.collect.Sets;
import io.github.pixee.security.BoundedLineReader;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.ComposedSchema;
import io.swagger.v3.oas.models.media.Schema;
Expand Down Expand Up @@ -117,7 +118,7 @@ public AbstractDartCodegen() {
new InputStreamReader(DartClientCodegen.class.getResourceAsStream("/dart/dart-keywords.txt"),
StandardCharsets.UTF_8))) {
while (reader.ready()) {
reservedWordsList.add(reader.readLine());
reservedWordsList.add(BoundedLineReader.readLine(reader, 5_000_000));
}
} catch (Exception e) {
LOGGER.error("Error reading dart keywords. Exception: {}", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.openapitools.codegen.languages;

import io.github.pixee.security.BoundedLineReader;
import io.swagger.v3.oas.models.media.Schema;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -271,7 +272,7 @@ public void postProcessFile(File file, String fileType) {
BufferedReader br = new BufferedReader(inputStreamReader)) {
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
while ((line = BoundedLineReader.readLine(br, 5_000_000)) != null) {
sb.append(line);
}
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command, exitValue, sb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.openapitools.codegen.languages;

import io.github.pixee.security.BoundedLineReader;
import io.swagger.v3.oas.models.media.Schema;
import lombok.Setter;
import org.apache.commons.io.FilenameUtils;
Expand Down Expand Up @@ -909,7 +910,7 @@ public void postProcessFile(File file, String fileType) {
BufferedReader br = new BufferedReader(inputStreamReader)) {
StringBuilder sb = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
while ((line = BoundedLineReader.readLine(br, 5_000_000)) != null) {
sb.append(line);
}
LOGGER.error("Error running the command ({}). Exit value: {}, Error output: {}", command,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.openapitools.codegen.dart;

import io.github.pixee.security.BoundedLineReader;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void testKeywords() throws Exception {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8));
while(reader.ready()) {
reservedWordsList.add(reader.readLine());
reservedWordsList.add(BoundedLineReader.readLine(reader, 5_000_000));
}
reader.close();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.openapitools.codegen.dart.dio;

import io.github.pixee.security.BoundedLineReader;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.DefaultGenerator;
Expand Down Expand Up @@ -84,7 +85,7 @@ public void testKeywords() {
List<String> reservedWordsList = new ArrayList<>();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("src/main/resources/dart/dart-keywords.txt"), StandardCharsets.UTF_8));
while(reader.ready()) { reservedWordsList.add(reader.readLine()); }
while(reader.ready()) { reservedWordsList.add(BoundedLineReader.readLine(reader, 5_000_000)); }
reader.close();
} catch (Exception e) {
String errorString = String.format(Locale.ROOT, "Error reading dart keywords: %s", e);
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,11 @@
<version>${testng.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>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
Expand Down Expand Up @@ -1254,5 +1259,6 @@
<wagon-ssh-external.version>3.4.3</wagon-ssh-external.version>
<wagon-svn.version>1.12</wagon-svn.version>
<wagon-webdav.version>1.0-beta-2</wagon-webdav.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
</project>
14 changes: 14 additions & 0 deletions samples/client/echo_api/java/resttemplate/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -287,5 +291,15 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openapitools.client;

import io.github.pixee.security.BoundedLineReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -846,10 +847,10 @@ private String headersToString(HttpHeaders headers) {
private String bodyToString(InputStream body) throws IOException {
StringBuilder builder = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
String line = bufferedReader.readLine();
String line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
while (line != null) {
builder.append(line).append(System.lineSeparator());
line = bufferedReader.readLine();
line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
}
bufferedReader.close();
return builder.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -295,5 +299,15 @@
<beanvalidation-version>3.0.2</beanvalidation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openapitools.client;

import io.github.pixee.security.BoundedLineReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -789,10 +790,10 @@ private String headersToString(HttpHeaders headers) {
private String bodyToString(InputStream body) throws IOException {
StringBuilder builder = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
String line = bufferedReader.readLine();
String line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
while (line != null) {
builder.append(line).append(System.lineSeparator());
line = bufferedReader.readLine();
line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
}
bufferedReader.close();
return builder.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -287,5 +291,15 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openapitools.client;

import io.github.pixee.security.BoundedLineReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -789,10 +790,10 @@ private String headersToString(HttpHeaders headers) {
private String bodyToString(InputStream body) throws IOException {
StringBuilder builder = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
String line = bufferedReader.readLine();
String line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
while (line != null) {
builder.append(line).append(System.lineSeparator());
line = bufferedReader.readLine();
line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
}
bufferedReader.close();
return builder.toString();
Expand Down
14 changes: 14 additions & 0 deletions samples/client/petstore/java/resttemplate-jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -287,5 +291,15 @@
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openapitools.client;

import io.github.pixee.security.BoundedLineReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -838,10 +839,10 @@ private String headersToString(HttpHeaders headers) {
private String bodyToString(InputStream body) throws IOException {
StringBuilder builder = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
String line = bufferedReader.readLine();
String line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
while (line != null) {
builder.append(line).append(System.lineSeparator());
line = bufferedReader.readLine();
line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
}
bufferedReader.close();
return builder.toString();
Expand Down
14 changes: 14 additions & 0 deletions samples/client/petstore/java/resttemplate-swagger1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -293,5 +297,15 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.openapitools.client;

import io.github.pixee.security.BoundedLineReader;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -838,10 +839,10 @@ private String headersToString(HttpHeaders headers) {
private String bodyToString(InputStream body) throws IOException {
StringBuilder builder = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
String line = bufferedReader.readLine();
String line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
while (line != null) {
builder.append(line).append(System.lineSeparator());
line = bufferedReader.readLine();
line = BoundedLineReader.readLine(bufferedReader, 5_000_000);
}
bufferedReader.close();
return builder.toString();
Expand Down
14 changes: 14 additions & 0 deletions samples/client/petstore/java/resttemplate-swagger2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@
<version>${junit-platform-runner.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>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -293,5 +297,15 @@
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.10.2</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<versions.java-security-toolkit>1.2.0</versions.java-security-toolkit>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.pixee</groupId>
<artifactId>java-security-toolkit</artifactId>
<version>${versions.java-security-toolkit}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Loading
Loading