Skip to content

Commit

Permalink
Merge pull request #1916 from akto-api-security/feature/modify_adv_fi…
Browse files Browse the repository at this point in the history
…lter

add method to fetch multiple samples
  • Loading branch information
Ark2307 authored Jan 6, 2025
2 parents ee15eb4 + ec0b9a8 commit a44a716
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libs/dao/src/main/java/com/akto/dao/SampleDataDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.akto.dto.ApiCollectionUsers;
import com.akto.dto.ApiInfo;
import com.akto.dto.testing.TestingEndpoints;
import com.akto.dto.traffic.Key;
import com.akto.dto.traffic.SampleData;
import com.akto.dto.type.URLMethods;
import com.akto.dto.type.SingleTypeInfo;
Expand Down Expand Up @@ -86,6 +87,18 @@ public static Bson filterForSampleData(int apiCollectionId, String url, URLMetho
);
}


public static List<Bson> filterForMultipleSampleData(List<Key> sampleList) {
List<Bson> ret = new ArrayList<>();

for(Key key: sampleList) {
Bson f = filterForSampleData(key.getApiCollectionId(), key.getUrl(), key.getMethod());
ret.add(f);
}

return ret;
}

public List<SampleData> fetchSampleDataPaginated(int apiCollectionId, String lastFetchedUrl,
String lastFetchedMethod, int limit, int sliceLimit) {
List<Bson> filters = new ArrayList<>();
Expand Down

0 comments on commit a44a716

Please sign in to comment.