Skip to content

Commit

Permalink
Merge pull request #1316 from akto-api-security/feature/flag_for_dep_…
Browse files Browse the repository at this point in the history
…analyser

added flags for dep analyser
  • Loading branch information
avneesh-akto authored Aug 1, 2024
2 parents 3afee6b + f92b0d4 commit cdc5374
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
10 changes: 10 additions & 0 deletions libs/dao/src/main/java/com/akto/dao/ApiCollectionsDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public List<ApiCollection> getMetaForIds(List<Integer> apiCollectionIds) {
return ApiCollectionsDao.instance.findAll(Filters.in("_id", apiCollectionIds), Projections.exclude("urls"));
}

public Map<Integer, ApiCollection> getApiCollectionsMetaMap() {
Map<Integer, ApiCollection> apiCollectionsMap = new HashMap<>();
List<ApiCollection> metaAll = getMetaAll();
for (ApiCollection apiCollection: metaAll) {
apiCollectionsMap.put(apiCollection.getId(), apiCollection);
}

return apiCollectionsMap;
}

public List<ApiCollection> getMetaAll() {
return ApiCollectionsDao.instance.findAll(new BasicDBObject(), Projections.exclude("urls"));
}
Expand Down
23 changes: 22 additions & 1 deletion libs/dao/src/main/java/com/akto/dto/ApiCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public class ApiCollection {
public static final String AUTOMATED = "automated";
boolean automated;

private boolean runDependencyAnalyser;
public static final String RUN_DEPENDENCY_ANALYSER = "runDependencyAnalyser";

private boolean matchDependencyWithOtherCollections;
public static final String MATCH_DEPENDENCY_WITH_OTHER_COLLECTIONS = "matchDependencyWithOtherCollections";

public enum Type {
API_GROUP
}
Expand Down Expand Up @@ -285,5 +291,20 @@ public boolean getAutomated() {
public void setAutomated(boolean automated) {
this.automated = automated;
}


public boolean isMatchDependencyWithOtherCollections() {
return matchDependencyWithOtherCollections;
}

public void setMatchDependencyWithOtherCollections(boolean matchDependencyWithOtherCollections) {
this.matchDependencyWithOtherCollections = matchDependencyWithOtherCollections;
}

public boolean isRunDependencyAnalyser() {
return runDependencyAnalyser;
}

public void setRunDependencyAnalyser(boolean runDependencyAnalyser) {
this.runDependencyAnalyser = runDependencyAnalyser;
}
}

0 comments on commit cdc5374

Please sign in to comment.