Skip to content

Commit

Permalink
Merge pull request #736 from akto-api-security/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
notshivansh authored Nov 23, 2023
2 parents a92eb00 + 94ff2b9 commit 89bb2f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
import static com.akto.dto.type.KeyTypes.patternToSubType;

public class APICatalogSync {


public static final int VULNERABLE_API_COLLECTION_ID = 1111111111;
public static final int LLM_API_COLLECTION_ID = 1222222222;

public int thresh;
public String userIdentifier;
private static final Logger logger = LoggerFactory.getLogger(APICatalogSync.class);
Expand Down Expand Up @@ -647,6 +650,9 @@ public static URLTemplate tryMergeUrls(URLStatic dbUrl, URLStatic newUrl) {


public static void mergeUrlsAndSave(int apiCollectionId, Boolean urlRegexMatchingEnabled) {

if (apiCollectionId == LLM_API_COLLECTION_ID || apiCollectionId == VULNERABLE_API_COLLECTION_ID) return;

ApiMergerResult result = tryMergeURLsInCollection(apiCollectionId, urlRegexMatchingEnabled);
ArrayList<WriteModel<SingleTypeInfo>> bulkUpdatesForSti = new ArrayList<>();
ArrayList<WriteModel<SampleData>> bulkUpdatesForSampleData = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private TestingRun createTestingRun(int scheduleTimestamp, int periodInSeconds)
return null;
}
if (this.selectedTests != null) {
int id = UUID.randomUUID().hashCode();
int id = UUID.randomUUID().hashCode() & 0xfffffff;
TestingRunConfig testingRunConfig = new TestingRunConfig(id, null, this.selectedTests,authMechanism.getId(), this.overriddenTestAppUrl);
this.testIdConfig = testingRunConfig.getId();
TestingRunConfigDao.instance.insertOne(testingRunConfig);
Expand Down Expand Up @@ -189,7 +189,7 @@ public String startTest() {
));

if (this.overriddenTestAppUrl != null || this.selectedTests != null) {
int id = UUID.randomUUID().hashCode();
int id = UUID.randomUUID().hashCode() & 0xfffffff ;
TestingRunConfig testingRunConfig = new TestingRunConfig(id, null, this.selectedTests, null, this.overriddenTestAppUrl);
this.testIdConfig = testingRunConfig.getId();
TestingRunConfigDao.instance.insertOne(testingRunConfig);
Expand Down

0 comments on commit 89bb2f1

Please sign in to comment.