From 0e04e7045839d8c01fb1df0b0e1efc6bce55d499 Mon Sep 17 00:00:00 2001 From: Nathaniel Steers Date: Wed, 22 May 2024 11:48:21 +0100 Subject: [PATCH] PP-12487 remove data submodule now it is no longer required --- .gitmodules | 4 --- Dockerfile | 1 - README.md | 82 ++++++++++++++++++++++++--------------------- data | 1 - m1/arm64.Dockerfile | 1 - 5 files changed, 44 insertions(+), 45 deletions(-) delete mode 100644 .gitmodules delete mode 160000 data diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7898f894..00000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "data"] - path = data - url = https://github.com/alphagov/pay-cardid-data.git - branch = master diff --git a/Dockerfile b/Dockerfile index c95b2913..53041700 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,6 @@ EXPOSE 8081 WORKDIR /app -COPY --from=builder /home/build/data/sources /app/data COPY --from=builder /home/build/target/*.yaml . COPY --from=builder /home/build/target/pay-*-allinone.jar . diff --git a/README.md b/README.md index 5dc0c6b5..f9648979 100644 --- a/README.md +++ b/README.md @@ -2,79 +2,82 @@ GOV.UK Pay Card information service -The service provides an API that could be accessed to retrieve card information for a given card number. +The service provides an API that can be accessed to retrieve card information for a given card number. ## Environment Variables - - `ADMIN_PORT`: The port number to listen for Dropwizard admin requests on. Defaults to `8081`. - - `DISCOVER_DATA_LOCATION`: The URL to load bin ranges for Discover cards from. Defaults to `file:///app/data/discover/Merchant_Marketing.csv`. - - `JAVA_OPTS`: Options to pass to the JRE. Defaults to `-Xms1500m -Xmx1500m`. - - `PORT`: The port number to listen for requests on. Defaults to `8080`. - - `TEST_CARD_DATA_LOCATION`: The URL to load bin ranges for test cards from. Defaults to `file:///app/data/test-cards/test-card-bin-ranges.csv`. - - `WORLDPAY_DATA_LOCATION`: The URL to load the Worldpay bin range data from. Defaults to `file:///app/data/worldpay/WP_341BIN_V03.CSV`. +- `ADMIN_PORT`: The port number to listen for Dropwizard admin requests on. Defaults to `8081`. +- `JAVA_OPTS`: Options to pass to the JRE. Defaults to `-Xms1500m -Xmx1500m`. +- `PORT`: The port number to listen for requests on. Defaults to `8080`. +- `TEST_CARD_DATA_LOCATION`: The path to load bin ranges for test cards from. Defaults + to `classpath:/data-sources/test-cards.csv`. +- `WORLDPAY_DATA_LOCATION`: The path to load bin ranges for Worldpay from. Defaults + to `classpath:/data-sources/worldpay-v3.csv`. +- `DISCOVER_DATA_LOCATION`: The path to load bin ranges for Discover cards from. Defaults + to `classpath:/data-sources/discover.csv`. ## Card data -The data for this service would need to be sourced externally from relevant providers. -The service currently supports data provided by: + +The data for this service is sourced externally from supported providers. +The service currently supports data provided by: - Worldpay - Discover -For the service to built and run the relevant data from the supported providers would need to be placed in the appropriate -location under the `data` folder as follows: +For the service to build and run, BIN range data from the supported providers should be available in the `data-sources` +folder: ### Worldpay -Location: /data/sources/worldpay +Location: `/resources/data-sources/worldpay-v3.csv` Format: csv -The csv file is expected to have the following structure, as of Worldpay EMIS v19 document +The csv file should have the following structure. - 00!12102015!!!!!!!!!! - 05!511949000!511949999!CN!ELECTRON!SAMPLE COMP PLC!GBR!826!D!PE000!XE000!Y - 99!1!!!!!!!!!! + 00,20240122,611649,,,,,,,,,,,,,,,,,,,,, + 01,999999999999999998,999999999999999999,CN,MASTERCARD CREDIT,APERTURE SCIENCE INC.,BRA,76,BRAZIL,C,BRL,DCC allowed,AC000,N,N,,16,D,,,,,, + 99,611648,,,,,,,,,,,,, -|Key|Meaning | -|---|-----------| -|00 |Header | -|05 |Data record| -|99 |EOF | +| Key | Meaning | +|-----|-------------| +| 00 | Header | +| 01 | Data record | +| 99 | EOF | ### Discover -Location: /data/sources/discover +Location: `/resources/data-sources/discover.csv` Format: csv -Since the data from discover is in pdf format, the services expects it to be converted into a csv format. The csv file is - expected to have the following structure. +Data from Discover is in pdf format and should be converted to csv. The csv file should have the following structure. 01,START,END,TYPE,BRAND 02,12345678,12345679,C,DISCOVER 09 -|Key|Meaning | -|---|-----------| -|01 |Header | -|02 |Data record| -|09 |EOF | +| Key | Meaning | +|-----|-------------| +| 01 | Header | +| 02 | Data record | +| 09 | EOF | ### Test Card Data -Location: /data/sources/test-cards +Location: `/resources/data-sources/test-cards.csv` Format: csv -The data is a manual collection of test cards provided by our API documentation, converted into a csv format. The csv file is - expected to have the following structure: +The data is a manual collection of test cards provided by our API documentation, converted into a csv format. The csv +file should have the following structure: 01,START,END,TYPE,BRAND 02,123456789,123456789,C,VISA 09 -|Key|Meaning | -|---|-----------| -|01 |Header | -|02 |Data record| -|09 |EOF | +| Key | Meaning | +|-----|-------------| +| 01 | Header | +| 02 | Data record | +| 09 | EOF | ## API Specification @@ -107,4 +110,7 @@ Returns information for a given card number. ## Vulnerability Disclosure -GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. Please refer to our [vulnerability disclosure policy](https://www.gov.uk/help/report-vulnerability) and our [security.txt](https://vdp.cabinetoffice.gov.uk/.well-known/security.txt) file for details. +GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security +vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. Please refer to +our [vulnerability disclosure policy](https://www.gov.uk/help/report-vulnerability) and +our [security.txt](https://vdp.cabinetoffice.gov.uk/.well-known/security.txt) file for details. diff --git a/data b/data deleted file mode 160000 index bf0193af..00000000 --- a/data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bf0193af315a05607acae72b9ff7ec129b04ab72 diff --git a/m1/arm64.Dockerfile b/m1/arm64.Dockerfile index 3dec4a3e..2093d852 100644 --- a/m1/arm64.Dockerfile +++ b/m1/arm64.Dockerfile @@ -28,7 +28,6 @@ EXPOSE 8081 WORKDIR /app -COPY --from=builder /home/build/data/sources /app/data COPY --from=builder /home/build/target/*.yaml . COPY --from=builder /home/build/target/pay-*-allinone.jar .