Skip to content

Commit

Permalink
[backend] add configurable taxii feed ingestion pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyCloarec committed Jan 21, 2025
1 parent a4b25ed commit 52c68a7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ export interface TaxiiResponseData {
addedLastHeader: string | undefined | null
}

interface TaxiiGetParams {
next: string | undefined,
added_after: Date | undefined,
limit?: string | undefined
}

/**
* Compute HTTP GET parameters to send to taxii server.
*
Expand All @@ -301,7 +307,7 @@ export interface TaxiiResponseData {
* @param ingestion
*/
export const prepareTaxiiGetParam = (ingestion: BasicStoreEntityIngestionTaxii) => {
const params = { next: ingestion.current_state_cursor, added_after: ingestion.added_after_start, limit: undefined };
const params: TaxiiGetParams = { next: ingestion.current_state_cursor, added_after: ingestion.added_after_start };
if (INGESTION_MANAGER_TAXII_FEED_LIMIT_PER_REQUEST > 0) {
params.limit = INGESTION_MANAGER_TAXII_FEED_LIMIT_PER_REQUEST;
}

Check warning on line 313 in opencti-platform/opencti-graphql/src/manager/ingestionManager.ts

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/manager/ingestionManager.ts#L312-L313

Added lines #L312 - L313 were not covered by tests
Expand Down

0 comments on commit 52c68a7

Please sign in to comment.