Skip to content

Commit 88cf46d

Browse files
committed
fixed bad merges
1 parent 3789100 commit 88cf46d

File tree

9 files changed

+2854
-4334
lines changed

9 files changed

+2854
-4334
lines changed

apps/api-runtime/src/main/java/com/akto/runtime/APICatalogSync.java

Lines changed: 456 additions & 893 deletions
Large diffs are not rendered by default.

apps/dashboard/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,6 @@
243243
<artifactId>commons-csv</artifactId>
244244
<version>1.9.0</version>
245245
</dependency>
246-
<dependency>
247-
<artifactId>grpc-api</artifactId>
248-
<groupId>io.grpc</groupId>
249-
<version>1.68.1</version>
250-
<scope>compile</scope>
251-
</dependency>
252246
</dependencies>
253247
<build>
254248
<sourceDirectory>src/main/java</sourceDirectory>

apps/dashboard/src/main/java/com/akto/action/threat_detection/SuspectSampleDataAction.java

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,18 @@ public SuspectSampleDataAction() {
4242
}
4343

4444
public String fetchSampleData() {
45-
HttpPost post =
46-
new HttpPost(
47-
String.format("%s/api/dashboard/list_malicious_requests", this.getBackendUrl()));
45+
HttpPost post = new HttpPost(String.format("%s/api/dashboard/list_malicious_requests", this.getBackendUrl()));
4846
post.addHeader("Authorization", "Bearer " + this.getApiToken());
4947
post.addHeader("Content-Type", "application/json");
5048

5149
System.out.print("API Token: " + this.getApiToken());
5250

53-
Map<String, Object> body =
54-
new HashMap<String, Object>() {
55-
{
56-
put("skip", skip);
57-
put("limit", LIMIT);
58-
}
59-
};
51+
Map<String, Object> body = new HashMap<String, Object>() {
52+
{
53+
put("skip", skip);
54+
put("limit", LIMIT);
55+
}
56+
};
6057
String msg = objectMapper.valueToTree(body).toString();
6158

6259
System.out.println("Request body for list malicious requests" + msg);
@@ -70,24 +67,22 @@ public String fetchSampleData() {
7067
System.out.println(responseBody);
7168

7269
ProtoMessageUtils.<ListMaliciousRequestsResponse>toProtoMessage(
73-
ListMaliciousRequestsResponse.class, responseBody)
70+
ListMaliciousRequestsResponse.class, responseBody)
7471
.ifPresent(
7572
m -> {
76-
this.maliciousEvents =
77-
m.getMaliciousEventsList().stream()
78-
.map(
79-
smr ->
80-
new DashboardMaliciousEvent(
81-
smr.getId(),
82-
smr.getActor(),
83-
smr.getFilterId(),
84-
smr.getEndpoint(),
85-
URLMethods.Method.fromString(smr.getMethod()),
86-
smr.getApiCollectionId(),
87-
smr.getIp(),
88-
smr.getCountry(),
89-
smr.getDetectedAt()))
90-
.collect(Collectors.toList());
73+
this.maliciousEvents = m.getMaliciousEventsList().stream()
74+
.map(
75+
smr -> new DashboardMaliciousEvent(
76+
smr.getId(),
77+
smr.getActor(),
78+
smr.getFilterId(),
79+
smr.getEndpoint(),
80+
URLMethods.Method.fromString(smr.getMethod()),
81+
smr.getApiCollectionId(),
82+
smr.getIp(),
83+
smr.getCountry(),
84+
smr.getDetectedAt()))
85+
.collect(Collectors.toList());
9186
});
9287
} catch (Exception e) {
9388
e.printStackTrace();
@@ -98,8 +93,7 @@ public String fetchSampleData() {
9893
}
9994

10095
public String fetchFilters() {
101-
HttpGet get =
102-
new HttpGet(String.format("%s/api/dashboard/fetch_filters", this.getBackendUrl()));
96+
HttpGet get = new HttpGet(String.format("%s/api/dashboard/fetch_filters", this.getBackendUrl()));
10397
get.addHeader("Authorization", "Bearer " + this.getApiToken());
10498
get.addHeader("Content-Type", "application/json");
10599

@@ -109,7 +103,7 @@ public String fetchFilters() {
109103
System.out.println(responseBody);
110104

111105
ProtoMessageUtils.<FetchAlertFiltersResponse>toProtoMessage(
112-
FetchAlertFiltersResponse.class, responseBody)
106+
FetchAlertFiltersResponse.class, responseBody)
113107
.ifPresent(
114108
msg -> {
115109
this.ips = msg.getActorsList();

apps/dashboard/src/main/java/com/akto/interceptor/UsageInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public String intercept(ActionInvocation invocation) throws Exception {
4848

4949
HashMap<String, FeatureAccess> featureWiseAllowed = organization.getFeatureWiseAllowed();
5050

51-
if (featureWiseAllowed == null || featureWiseAllowed.isEmpty()) {
51+
if(featureWiseAllowed == null || featureWiseAllowed.isEmpty()) {
5252
throw new Exception("feature map not found or empty for organization " + organization.getId());
5353
}
5454

@@ -58,7 +58,7 @@ public String intercept(ActionInvocation invocation) throws Exception {
5858
for (String feature : features) {
5959
feature = feature.trim();
6060

61-
if (feature.isEmpty()) {
61+
if(feature.isEmpty()) {
6262
continue;
6363
}
6464

0 commit comments

Comments
 (0)