From 9de7e5dc8bcdbd648edbb7f26be66eab9414ae5b Mon Sep 17 00:00:00 2001 From: Krish Date: Fri, 4 Sep 2020 14:51:35 +0100 Subject: [PATCH] PP-7018 Remove limit for CSV transactions - Removed limit on CSV transactions so we can enable and limit total count to 5K for selfservice searches. For services with lots of transactions, users will need to apply filters (in selfservice) before downloading transactions. --- .secrets.baseline | 75 +++++++++++++++++++ .../ledger/app/config/ReportingConfig.java | 8 -- .../resource/TransactionResource.java | 2 +- src/main/resources/config/config.yaml | 1 - src/test/resources/config/test-config.yaml | 1 - 5 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 .secrets.baseline diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 000000000..a1096785b --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,75 @@ +{ + "exclude": { + "files": null, + "lines": null + }, + "generated_at": "2020-09-04T13:50:13Z", + "plugins_used": [ + { + "name": "AWSKeyDetector" + }, + { + "name": "ArtifactoryDetector" + }, + { + "base64_limit": 4.5, + "name": "Base64HighEntropyString" + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "CloudantDetector" + }, + { + "hex_limit": 3, + "name": "HexHighEntropyString" + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "keyword_exclude": null, + "name": "KeywordDetector" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "results": { + "dev.yml": [ + { + "hashed_secret": "08cd923367890009657eab812753379bdb321eeb", + "is_verified": true, + "line_number": 2, + "type": "Secret Keyword" + } + ] + }, + "version": "0.13.1", + "word_list": { + "file": null, + "hash": null + } +} diff --git a/src/main/java/uk/gov/pay/ledger/app/config/ReportingConfig.java b/src/main/java/uk/gov/pay/ledger/app/config/ReportingConfig.java index 8c4802713..132771b08 100644 --- a/src/main/java/uk/gov/pay/ledger/app/config/ReportingConfig.java +++ b/src/main/java/uk/gov/pay/ledger/app/config/ReportingConfig.java @@ -3,20 +3,12 @@ import io.dropwizard.Configuration; import javax.validation.Valid; -import javax.validation.constraints.NotNull; public class ReportingConfig extends Configuration { - @Valid - private int maximumCsvRowsSize; - @Valid private int streamingCsvPageSize; - public int getMaximumCsvRowsSize() { - return maximumCsvRowsSize; - } - public int getStreamingCsvPageSize() { return streamingCsvPageSize; } diff --git a/src/main/java/uk/gov/pay/ledger/transaction/resource/TransactionResource.java b/src/main/java/uk/gov/pay/ledger/transaction/resource/TransactionResource.java index 9ded0fa17..1740a1957 100644 --- a/src/main/java/uk/gov/pay/ledger/transaction/resource/TransactionResource.java +++ b/src/main/java/uk/gov/pay/ledger/transaction/resource/TransactionResource.java @@ -136,7 +136,7 @@ public Response streamCsv(@Valid @BeanParam TransactionSearchParams searchParams ); outputStream.flush(); } - } while (!page.isEmpty() && count < configuration.getReportingConfig().getMaximumCsvRowsSize()); + } while (!page.isEmpty()); outputStream.close(); long elapsed = stopwatch.stop().elapsed(TimeUnit.MILLISECONDS); LOGGER.info("CSV stream took:", diff --git a/src/main/resources/config/config.yaml b/src/main/resources/config/config.yaml index 2a8052a3f..5daa70369 100644 --- a/src/main/resources/config/config.yaml +++ b/src/main/resources/config/config.yaml @@ -76,5 +76,4 @@ queueMessageReceiverConfig: messageRetryDelayInSeconds: ${QUEUE_MESSAGE_RETRY_DELAY_IN_SECONDS:-900} reportingConfig: - maximumCsvRowsSize: ${REPORTING_MAX_CSV_ROWS_SIZE:-100000} streamingCsvPageSize: ${STREAMING_CSV_PAGE_SIZE:-5000} diff --git a/src/test/resources/config/test-config.yaml b/src/test/resources/config/test-config.yaml index 83e2f2214..edb3af87a 100644 --- a/src/test/resources/config/test-config.yaml +++ b/src/test/resources/config/test-config.yaml @@ -62,5 +62,4 @@ queueMessageReceiverConfig: messageRetryDelayInSeconds: ${QUEUE_MESSAGE_RETRY_DELAY_IN_SECONDS:-900} reportingConfig: - maximumCsvRowsSize: ${REPORTING_MAX_CSV_ROWS_SIZE:-100000} streamingCsvPageSize: ${STREAMING_CSV_PAGE_SIZE:-5000} \ No newline at end of file