Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <[email protected]>
  • Loading branch information
eirsep committed Jul 9, 2024
1 parent 00fcd33 commit 242a7aa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ public void downloadFromUrlAndIndexIOCs(SATIFSourceConfig saTifSourceConfig, Act
}
break;
default:
// if the feed type doesn't match any of the supporting feed types, throw an exception
log.error("unsupported feed format for url download:" + source.getFeedFormat());
listener.onFailure(new UnsupportedOperationException("unsupported feed format for url download:" + source.getFeedFormat()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public List<String> validateSourceConfigDto(SATIFSourceConfigDto sourceConfigDto
break;
case URL_DOWNLOAD:
if (sourceConfigDto.getSchedule() == null) {
errorMsgs.add("Must pass in schedule for URL_DONWLOAD source type");
errorMsgs.add("Must pass in schedule for URL_DOWNLOAD source type");
}
if (sourceConfigDto.getSource() != null && sourceConfigDto.getSource() instanceof UrlDownloadSource == false) {
errorMsgs.add("Source must be URL_DONWLOAD source type");
errorMsgs.add("Source must be URL_DOWNLOAD source type");
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public DefaultTifSourceConfigLoaderService(BuiltInTIFMetadataLoader tifMetadataL
}

/**
* check if the default
* check if the default tif source configs are loaded. if not, try create them from the feedMetadata.json file.
*/
public void createDefaultTifConfigsIfNotExists(ActionListener<Void> listener) {
List<TIFMetadata> tifMetadataList = tifMetadataLoader.getTifMetadataList();
Expand Down Expand Up @@ -135,7 +135,8 @@ public void onFailure(Exception e) {
null,
null,
true,
List.of(iocType)
List.of(iocType),
true
),
null,
RestRequest.Method.POST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;

import java.util.stream.Collectors;

import static org.opensearch.securityanalytics.services.STIX2IOCFeedStore.getIocIndexAlias;
import static org.opensearch.securityanalytics.threatIntel.common.SourceConfigType.IOC_UPLOAD;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void onFailure(Exception e) {
}
break;
default:
// if the feed type doesn't match any of the supporting feed types, throw an exception
onFailure(new UnsupportedOperationException("Not a supported feed format : " + tifMetadata.getFeedType()));
}
}
} catch (IOException ex) {
Expand Down

0 comments on commit 242a7aa

Please sign in to comment.