diff --git a/.azuredevops/pipelines/build-v2.yml b/.azuredevops/pipelines/build-v2.yml index 139a9e2..4c1c3f8 100644 --- a/.azuredevops/pipelines/build-v2.yml +++ b/.azuredevops/pipelines/build-v2.yml @@ -6,53 +6,15 @@ schedules: include: - develop -resources: - repositories: - - repository: shared-code-scanning - type: git - name: Common/shared-code-scanning - ref: refs/heads/main - trigger: none - trigger: - develop - main - releases/* - -variables: -- group: PT-Pipeline-Common - + pool: - name: mdp-mgmt-shared - demands: - - ImageOverride -equals $(PipelineHostLinuxImage) + vmImage: ubuntu-latest steps: -- script: | - echo "Cleaning mock-register folder in temp" - ls $(Agent.BuildDirectory)/s/Source/_temp/mock-register-* 2>/dev/null || "No matching folders found" - sudo rm -rf $(Agent.BuildDirectory)/s/Source/_temp/mock-register-* 2> /dev/null - displayName: Clean temp mock-register folders - condition: always() - -- checkout: self - clean: true - -- task: UseDotNet@2 - displayName: 'Use .NET 8 sdk' - condition: always() - inputs: - packageType: sdk - version: '8.0.x' - performMultiLevelLookup: true - - # Restore dotnet tooling -- task: CmdLine@2 - displayName: 'Restore dotnet tooling' - condition: always() - inputs: - script: 'dotnet tool restore' - # Build mock-register - task: Docker@2 displayName: Build mock-register image @@ -63,11 +25,6 @@ steps: repository: mock-register tags: latest -- template: templates/scan-image.yml@shared-code-scanning - parameters: - Repository: mock-register - Tag: latest - # Build mock-register-unit-tests - task: Docker@2 displayName: Build mock-register-unit-tests image @@ -126,22 +83,23 @@ steps: # Remove integration tests - script: | - docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down + docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml down displayName: 'Integration Tests - Down' condition: always() -# Generate Extent Report from Test Results +# Run trx formatter to output .MD and .CSV - script: | - dotnet TrxToExtentReport \ - --output $(Build.ArtifactStagingDirectory)/test-results/mock-register-integration-tests/MR-$(Build.BuildNumber).html \ - --trx $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx \ - --verbose - cp $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx $(Build.ArtifactStagingDirectory)/test-results/mock-register-integration-tests/MR-$(Build.BuildNumber).trx - displayName: 'Format Test Results' - condition: always() + docker run \ + -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \ + -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \ + $(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR" --outputprefix "MR" -o out/ + displayName: 'Run trx-formatter' + condition: always() + env: + TEST_FILTER: "Category!=CTSONLY" # Publish mock-register integration tests results -- publish: $(Build.ArtifactStagingDirectory)/test-results/mock-register-integration-tests +- publish: Source/_temp/mock-register-integration-tests/testresults displayName: Publish MockRegister Integration tests condition: always() artifact: Mock-Register - Integration tests @@ -159,7 +117,7 @@ steps: # Run integration tests For CTS Only tests #**************************************************************************************************************** - script: | - docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests + docker compose --file $(Build.SourcesDirectory)/Source/docker-compose.IntegrationTests.yml up --abort-on-container-exit --exit-code-from mock-register-integration-tests displayName: 'Integration Tests Tests For CTS Only - Up' condition: always() env: @@ -184,12 +142,11 @@ steps: # Run trx formatter to output .MD and .CSV - script: | - dotnet TrxToExtentReport \ - --output $(Build.ArtifactStagingDirectory)/test-results/mock-register-cts-integration-tests/MR-CTS-$(Build.BuildNumber).html \ - --trx $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx \ - --verbose - cp $(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx $(Build.ArtifactStagingDirectory)/test-results/mock-register-cts-integration-tests/MR-CTS-$(Build.BuildNumber).trx - displayName: 'Format Test Results' + docker run \ + -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/results.trx:/app/results.trx:ro \ + -v=$(Build.SourcesDirectory)/Source/_temp/mock-register-integration-tests/testresults/formatted/:/app/out/:rw \ + $(SharedAcrBaseUrl).azurecr.io/trx-formatter -i results.trx -t "MR-CTS" --outputprefix "MR-CTS" -o out/ + displayName: 'Run trx-formatter' condition: always() # Remove integration tests For CTS Only tests @@ -199,7 +156,7 @@ steps: condition: always() # Publish mock-register integration tests results -- publish: $(Build.ArtifactStagingDirectory)/test-results/mock-register-cts-integration-tests +- publish: Source/_temp/mock-register-integration-tests/testresults displayName: Publish MockRegister CTS Integration tests condition: always() artifact: Mock-Register - CTS Integration tests @@ -228,15 +185,36 @@ steps: displayName: Publish container images # condition: always() inputs: - path: $(build.artifactstagingdirectory)/mock-register.image.tar + path: $(build.artifactstagingdirectory) artifact: Container Images +# FIXME - MJS - See dockercompose, volume no longer mapped as 1001:121 (vsts:docker) in build pipeline and causes issue with chown in dockerfile (appuser:appgroup), ie stops register from starting because of different user +# # Publish mock-register logs +# - publish: Source/_temp/mock-register/tmp +# displayName: Publish MockRegister logs +# condition: always() +# artifact: Mock-Register - Logs + # Publish mock-register unit tests results - publish: Source/_temp/mock-register-unit-tests/testresults displayName: Publish unit tests condition: always() artifact: Mock-Register - Unit tests +- task: UseDotNet@2 + displayName: 'Use .NET 8 sdk' + condition: always() + inputs: + packageType: sdk + version: '8.0.x' + performMultiLevelLookup: true + +- task: CmdLine@2 + displayName: 'Restore dotnet tooling' + condition: always() + inputs: + script: 'dotnet tool restore' + - script: | cd Source/CDR.Register.Repository dotnet ef migrations bundle --context RegisterDatabaseContext --verbose --self-contained diff --git a/.azuredevops/pipelines/code-scanning.yml b/.azuredevops/pipelines/code-scanning.yml index 1fb2be5..ea3fe11 100644 --- a/.azuredevops/pipelines/code-scanning.yml +++ b/.azuredevops/pipelines/code-scanning.yml @@ -17,13 +17,8 @@ schedules: # Disable standard CI build trigger: none -variables: -- group: PT-Pipeline-Common - pool: - name: mdp-mgmt-shared - demands: - - ImageOverride -equals $(PipelineHostLinuxImage) + vmImage: 'ubuntu-latest' extends: template: pipeline-templates/code-scanning.yml@shared-code-scanning \ No newline at end of file diff --git a/.azuredevops/pipelines/dependabot.yml b/.azuredevops/pipelines/dependabot.yml index 415e259..b3268e3 100644 --- a/.azuredevops/pipelines/dependabot.yml +++ b/.azuredevops/pipelines/dependabot.yml @@ -6,17 +6,11 @@ schedules: - refs/heads/develop always: true -variables: -- group: PT-Pipeline-Common - - jobs: - job: dependabot displayName: Dependabot pool: - name: mdp-mgmt-shared - demands: - - ImageOverride -equals $(PipelineHostLinuxImage) + vmImage: ubuntu-latest steps: - task: CmdLine@2 diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 3e156dd..3173bfc 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,18 +3,10 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "8.0.25", + "version": "8.0.20", "commands": [ "dotnet-ef" - ], - "rollForward": false - }, - "trxtoextentreport": { - "version": "0.0.4", - "commands": [ - "TrxToExtentReport" - ], - "rollForward": false + ] } } } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a9ee53..e9584d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,20 +5,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -## [2.2.6] - 2026-05-13 -### Changed -- Support for "Non Bank Lending" industry added to the Mock Register -- Updated Integration Tests inline with NBL updates -- Migrate solution from Microsoft.AspNetCore.Mvc.Versioning to Asp.Versioning.Mvc package - -## [2.2.5] - 2026-03-18 -# Fixed -- Patched vulnerabilities - -## [2.2.4] - 2026-02-25 -# Fixed -- Fixed JWKS endpoint response to conform CDR Data Standard - ## [2.2.3] - 2025-12-03 ### Added - Added health check endpoints for APIs diff --git a/Help/notebooks/mock-register.ipynb b/Help/notebooks/mock-register.ipynb index 200f83c..8760d50 100644 --- a/Help/notebooks/mock-register.ipynb +++ b/Help/notebooks/mock-register.ipynb @@ -38,7 +38,7 @@ "\n", "Set the required configuration variables which are reused by all the PowerShell cells in this notebook. \n", "\n", - "> **Note:** This cell must be executed prior to executing any PowerShell cells in this notebook." + "**Note:** This cell must be executed prior to executing any PowerShell cells in this notebook." ] }, { @@ -50,6 +50,9 @@ }, "polyglot_notebook": { "kernelName": "pwsh" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -58,17 +61,16 @@ "$hostname = \"localhost\"\n", "$mockRegisterBaseUrl = \"https://${hostname}:7000\"\n", "$mockRegisterSecureBaseUrl = \"https://${hostname}:7001\"\n", - "$mockRegisterAdminBaseUrl = \"https://${hostname}:7006\"\n", "\n", - "# Set Data Recipient variables\n", + "# Set Data Reciepient variables\n", "$mockDataRecipientCertificatePath = \"..\\\\..\\\\CertificateManagement\\\\mtls\\\\client.pfx\"\n", "$mockDataRecipientCertificatePassword = \"#M0ckDataRecipient#\"\n", - "$industry = \"Non-Bank-Lending\" # banking, energy, non-bank-lending, all\n", - "$dataRecipientBrandId = \"F3F0C40B-9DF8-491A-AF1D-81CB9AB5F021\" # YoYo\n", - "$softwareProductId = \"6F7A1B8E-8799-48A8-9011-E3920391F713\" # ThatBudgetHelper\n", + "$industry = \"Banking\"\n", + "$dataRecipientBrandId = \"F3F0C40B-9DF8-491A-AF1D-81CB9AB5F021\"\n", + "$softwareProductId = \"6F7A1B8E-8799-48A8-9011-E3920391F713\"\n", "$mdrClientAssertionUri = \"https://${hostname}:7006/loopback/MockDataRecipientClientAssertion?iss=$softwareProductId\"\n", "\n", - "# Load the Data Recipient certificate with password\n", + "# Load the Data Reciepient certificate with password\n", "$certPassword = ConvertTo-SecureString -String $mockDataRecipientCertificatePassword -Force -AsPlainText\n", "$mockDataRecipientCert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $mockDataRecipientCertificatePath, $certPassword" ] @@ -80,7 +82,7 @@ "\n", "Set the required variables from above PowerShell cell to make them available for HTTP Request cells.\n", "\n", - "> **Note:** This cell must be executed prior to executing any HTTP Request cells in this notebook." + "**Note:** This cell must be executed prior to executing any HTTP Request cells in this notebook." ] }, { @@ -92,13 +94,15 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "#!set --value @pwsh:hostname --name hostname\n", "#!set --value @pwsh:mockRegisterBaseUrl --name mockRegisterBaseUrl\n", - "#!set --value @pwsh:mockRegisterAdminBaseUrl --name mockRegisterAdminBaseUrl\n", "#!set --value @pwsh:softwareProductId --name softwareProductId\n", "#!set --value @pwsh:industry --name industry" ] @@ -133,6 +137,9 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -148,8 +155,7 @@ "\n", "`GET /cdr-register/v1/{industry}/data-recipients`\n", "\n", - "Endpoint used by participants to discover data recipients and associated brands and software products, available in the CDR ecosystem. \n", - "> Data recipients are not industry specific." + "Endpoint used by participants to discover data recipients and associated brands and software products, available in the CDR ecosystem." ] }, { @@ -161,12 +167,15 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ - "GET {{mockRegisterBaseUrl}}/cdr-register/v1/all/data-recipients\n", - "x-v: 4" + "GET {{mockRegisterBaseUrl}}/cdr-register/v1/{{industry}}/data-recipients\n", + "x-v:3" ] }, { @@ -177,8 +186,7 @@ "\n", "`GET /cdr-register/v1/{industry}/data-recipients/status`\n", "\n", - "Endpoint used by participants to discover the statuses for Data Recipients from the CDR Register.\n", - "> Data recipients are not industry specific." + "Endpoint used by participants to discover the statuses for Data Recipients from the CDR Register." ] }, { @@ -190,12 +198,15 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ - "GET {{mockRegisterBaseUrl}}/cdr-register/v1/all/data-recipients/status\n", - "x-v: 3" + "GET {{mockRegisterBaseUrl}}/cdr-register/v1/{{industry}}/data-recipients/status\n", + "x-v: 2" ] }, { @@ -206,8 +217,7 @@ "\n", "`GET /cdr-register/v1/{industry}/data-recipients/brands/software-products/status`\n", "\n", - "Endpoint used by participants to discover the statuses for Software Products from the CDR Register.\n", - "> Software Products are not industry specific." + "Endpoint used by participants to discover the statuses for software products from the CDR Register." ] }, { @@ -219,12 +229,15 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ - "GET {{mockRegisterBaseUrl}}/cdr-register/v1/all/data-recipients/brands/software-products/status\n", - "x-v: 3" + "GET {{mockRegisterBaseUrl}}/cdr-register/v1/{{industry}}/data-recipients/brands/software-products/status\n", + "x-v: 2" ] }, { @@ -247,12 +260,15 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "GET {{mockRegisterBaseUrl}}/cdr-register/v1/{{industry}}/data-holders/status\n", - "x-v: 2" + "x-v: 1" ] }, { @@ -284,6 +300,9 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -311,6 +330,9 @@ }, "polyglot_notebook": { "kernelName": "pwsh" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -329,7 +351,7 @@ "}\n", "\n", "# Make the request\n", - "$response = Invoke-RestMethod -Uri \"${mockRegisterSecureBaseUrl}/idp/connect/token\" `\n", + "$response = Invoke-RestMethod -Uri \"${mockRegisterSecureBaseUrl}/idp/connect/token\" `\n", " -Method Post -StatusCodeVariable responseCode `\n", " -Body $parameters -ContentType \"application/x-www-form-urlencoded\" `\n", " -Certificate $mockDataRecipientCert\n", @@ -356,7 +378,7 @@ "\n", "Allows Data Recipients to discover Data Holder Brands available in the CDR ecosystem.\n", "\n", - "> **Note:** This API requires an access token. The Get Access Token cell must be executed prior to executing this cell." + "**Note:** This API requires an access token. The Get Access Token cell must be executed prior to executing this cell." ] }, { @@ -368,24 +390,26 @@ }, "polyglot_notebook": { "kernelName": "pwsh" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "# Set the API version and Authorization headers\n", "$headers = @{\n", - " \"x-v\" = \"3\"\n", + " \"x-v\" = \"2\"\n", " \"Authorization\" = \"Bearer $accessToken\"\n", "}\n", "\n", "# Make the request\n", - "$res = Invoke-RestMethod -Uri \"${mockRegisterSecureBaseUrl}/cdr-register/v1/${industry}/data-holders/brands\" `\n", + "$res = Invoke-RestMethod -Uri \"${mockRegisterSecureBaseUrl}/cdr-register/v1/all/data-holders/brands\" `\n", " -Method Get -StatusCodeVariable resCode -Headers $headers -Certificate $mockDataRecipientCert `\n", - " -ResponseHeadersVariable resHeaders | ConvertTo-Json -Depth 10\n", + " | ConvertTo-Json -Depth 10\n", "\n", "# Write the response status code and content to the console\n", "Write-Host \"Response Code: $resCode\"\n", - "Write-Host \"Response x-v: $($resHeaders[\"x-v\"])\"\n", "Write-Host \"Response Content: $($res)\"" ] }, @@ -399,7 +423,7 @@ "\n", "Get a Software Statement Assertion (SSA) for a software product on the CDR Register to be used for Dynamic Client Registration with a Data Holder Brand.\n", "\n", - "> **Note:** This API requires an access token. The Get Access Token cell must be executed prior to executing this cell." + "**Note:** This API requires an access token. The Get Access Token cell must be executed prior to executing this cell." ] }, { @@ -411,24 +435,26 @@ }, "polyglot_notebook": { "kernelName": "pwsh" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ "# Set the API version and Authorization headers\n", "$headers = @{\n", - " \"x-v\" = \"4\"\n", + " \"x-v\" = \"3\"\n", " \"Authorization\" = \"Bearer $accessToken\"\n", "}\n", "\n", "# Make the request\n", "$r = Invoke-RestMethod -Uri \"${mockRegisterSecureBaseUrl}/cdr-register/v1/all/data-recipients/brands/${dataRecipientBrandId}/software-products/${softwareProductId}/ssa\" `\n", - " -Method Get -StatusCodeVariable rCode -Headers $headers -Certificate $mockDataRecipientCert -ResponseHeadersVariable resHeaders`\n", + " -Method Get -StatusCodeVariable rCode -Headers $headers -Certificate $mockDataRecipientCert `\n", " | ConvertTo-Json -Depth 10\n", "\n", "# Write the response status code and content to the console\n", "Write-Host \"Response Code: $rCode\"\n", - "Write-Host \"Response x-v: $($resHeaders[\"x-v\"])\"\n", "Write-Host \"Response Content: $($r)\"" ] }, @@ -461,6 +487,9 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -488,6 +517,9 @@ }, "polyglot_notebook": { "kernelName": "pwsh" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -497,7 +529,7 @@ "$metadataPayload = Get-Content -path .\\payloads\\metadataPayload.json -raw\n", "\n", "# Make the request\n", - "$response = Invoke-RestMethod -Uri \"${mockRegisterAdminBaseUrl}/admin/metadata\" `\n", + "$response = Invoke-RestMethod -Uri \"https://${hostname}:7006/admin/metadata\" `\n", " -Method Post -StatusCodeVariable responseCode `\n", " -Body $metadataPayload `\n", " -ContentType \"application/json\" `\n", @@ -527,11 +559,14 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ - "POST {{mockRegisterAdminBaseUrl}}/admin/metadata/data-recipients \n", + "POST https://{{hostname}}:7006/admin/metadata/data-recipients \n", "x-v: 1\n", "Content-Type: application/json\n", "{\n", @@ -607,17 +642,19 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], "source": [ - "POST {{mockRegisterAdminBaseUrl}}/admin/metadata/data-holders HTTP/1.1\n", + "POST https://{{hostname}}:7006/admin/metadata/data-holders HTTP/1.1\n", "Content-Type: application/json\n", "x-v: 1\n", "{\n", " \"dataHolderBrandId\": \"bb03be60-5c46-422e-a27e-aefa0015078d\",\n", " \"brandName\": \"Luna\",\n", - " \"brandGroup\": \"Luna Banking Group\",\n", " \"industries\": [\n", " \"banking\"\n", " ],\n", @@ -626,7 +663,6 @@ " \"endpointDetail\": {\n", " \"version\": \"v1\",\n", " \"publicBaseUri\": \"https://publicapi.lunabank\",\n", - " \"productBaseUri\": \"https://productapi.lunabank\",\n", " \"resourceBaseUri\": \"https://rb-api.lunabank\",\n", " \"infosecBaseUri\": \"https://isb-api.lunabank\",\n", " \"extensionBaseUri\": \"https://eb-api.lunabank\",\n", @@ -674,6 +710,9 @@ }, "polyglot_notebook": { "kernelName": "http" + }, + "vscode": { + "languageId": "polyglot-notebook" } }, "outputs": [], @@ -689,7 +728,7 @@ "name": ".net-csharp" }, "language_info": { - "name": "polyglot-notebook" + "name": "python" }, "polyglot_notebook": { "kernelInfo": { diff --git a/Help/notebooks/payloads/metadataPayload.json b/Help/notebooks/payloads/metadataPayload.json index 2a986f2..dfbbafa 100644 --- a/Help/notebooks/payloads/metadataPayload.json +++ b/Help/notebooks/payloads/metadataPayload.json @@ -1,2093 +1,1971 @@ { - "legalEntities": [ - { - "legalEntityId": "2f596416-53bc-42ad-bd5a-65537a2d5c42", - "legalEntityName": "Very Smart Energy Company", - "logoUri": "https://verysmarterenergy/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12345678901", - "acn": "123456789", - "arbn": null, - "anzsicDivision": "2640", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 2, - "statusId": 1, - "brands": [ - { - "brandId": "cfcaf0df-401b-47f2-98af-94787289eca8", - "brandName": "Mock Data Holder (Energy)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://smarterenergy/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-12-01T10:00:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.smarterenergy/jwks" + "legalEntities": [ + { + "legalEntityId": "2f596416-53bc-42ad-bd5a-65537a2d5c42", + "legalEntityName": "Very Smart Energy Company", + "logoUri": "https://verysmarterenergy/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12345678901", + "acn": "123456789", + "arbn": null, + "anzsicDivision": "2640", + "organisationTypeId": 2, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 2, + "statusId": 1, + "brands": [ + { + "brandId": "cfcaf0df-401b-47f2-98af-94787289eca8", + "brandName": "Mock Data Holder (Energy)", + "logoUri": "https://smarterenergy/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-12-01T10:00:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.smarterenergy/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://mock-data-holder-energy:8100", + "resourceBaseUri": "https://mock-data-holder-energy:8102", + "infoSecBaseUri": "https://mock-data-holder-energy:8101", + "extensionBaseUri": "", + "websiteUri": "https://smarterenergy/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://mock-data-holder-energy:8100", - "productBaseUri": "https://mock-data-holder-energy:8100", - "resourceBaseUri": "https://mock-data-holder-energy:8102", - "infoSecBaseUri": "https://mock-data-holder-energy:8101", - "extensionBaseUri": "", - "websiteUri": "https://smarterenergy/" - } - }, - { - "brandId": "6859d9f9-9cf9-486d-bc85-5d43a7e116de", - "brandName": "Cut Price Energy -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://cutpriceenergy/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-12-01T11:00:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.cutpriceenergy/jwks" + }, + { + "brandId": "6859d9f9-9cf9-486d-bc85-5d43a7e116de", + "brandName": "Cut Price Energy -- dummy data holder -- do not use", + "logoUri": "https://cutpriceenergy/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-12-01T11:00:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.cutpriceenergy/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://api.cutpriceenergy:8100", + "resourceBaseUri": "https://api.cutpriceenergy:8102", + "infoSecBaseUri": "https://api.cutpriceenergy:8101", + "extensionBaseUri": "", + "websiteUri": "https://cutpriceenergy/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://api.cutpriceenergy:8100", - "productBaseUri": "https://api.cutpriceenergy:8100", - "resourceBaseUri": "https://api.cutpriceenergy:8102", - "infoSecBaseUri": "https://api.cutpriceenergy:8101", - "extensionBaseUri": "", - "websiteUri": "https://cutpriceenergy/" } - } - ] - } - ] - }, - { - "legalEntityId": "f9bde9a1-9fef-4bd9-b7ef-877369e076e3", - "legalEntityName": "Mock Energy Company", - "logoUri": "https://mocksoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "34241177887", - "acn": "005249981", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000001", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "d50b74cf-e992-42fd-86d4-582ac9d72dbb", - "brandName": "Mock Energy Tool", - "brandGroup": null, - "logoUri": "https://mocksoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-12-01T09:00:00", - "softwareProducts": [ - { - "softwareProductId": "4754cf30-6cc2-4a9a-a9e1-4fb8f6d42120", - "softwareProductName": "MyEnergyHelper", - "softwareProductDescription": "A product to help you manage your energy costs", - "logoUri": "https://mocksoftware/myenergyapp/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://mocksoftware/myenergyapp", - "tosUri": "https://mocksoftware/myenergyapp/terms", - "policyUri": "https://mocksoftware/myenergyapp/policy", - "recipientBaseUri": "https://mock-data-recipient:9001", - "revocationUri": "https://mock-data-recipient:9001/revocation", - "redirectUris": "https://mock-data-recipient:9001/consent/callback", - "jwksUri": "https://mock-data-recipient:9001/jwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "0d332caa-8cd8-4ac9-8898-20641c54bc8c", - "legalEntityName": "Bank Legal Entity 1", - "logoUri": "https://bank/logo.png", - "registrationNumber": "12345", - "registrationDate": "2021-12-01T10:00:00", - "registeredCountry": "AUSTRALIA", - "abn": "11111111111", - "acn": "888777666", - "arbn": null, - "anzsicDivision": "6221", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "804fc2fb-18a7-4235-9a49-2af393d18bc7", - "brandName": "Mock Data Holder (Banking)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://bank1/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.bank1/jwks" + ] + } + ] + }, + { + "legalEntityId": "f9bde9a1-9fef-4bd9-b7ef-877369e076e3", + "legalEntityName": "Mock Energy Company", + "logoUri": "https://mocksoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "34241177887", + "acn": "005249981", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000001", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "d50b74cf-e992-42fd-86d4-582ac9d72dbb", + "brandName": "Mock Energy Tool", + "logoUri": "https://mocksoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-12-01T09:00:00", + "softwareProducts": [ + { + "softwareProductId": "4754cf30-6cc2-4a9a-a9e1-4fb8f6d42120", + "softwareProductName": "MyEnergyHelper", + "softwareProductDescription": "A product to help you manage your energy costs", + "logoUri": "https://mocksoftware/myenergyapp/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://mocksoftware/myenergyapp", + "tosUri": "https://mocksoftware/myenergyapp/terms", + "policyUri": "https://mocksoftware/myenergyapp/policy", + "recipientBaseUri": "https://mock-data-recipient:9001", + "revocationUri": "https://mock-data-recipient:9001/revocation", + "redirectUris": "https://mock-data-recipient:9001/consent/callback", + "jwksUri": "https://mock-data-recipient:9001/jwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "0d332caa-8cd8-4ac9-8898-20641c54bc8c", + "legalEntityName": "Bank Legal Entity 1", + "logoUri": "https://bank/logo.png", + "registrationNumber": "12345", + "registrationDate": "2021-12-01T10:00:00", + "registeredCountry": "AUSTRALIA", + "abn": "11111111111", + "acn": "888777666", + "arbn": null, + "anzsicDivision": "6221", + "organisationTypeId": 2, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "804fc2fb-18a7-4235-9a49-2af393d18bc7", + "brandName": "Mock Data Holder (Banking)", + "logoUri": "https://bank1/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.bank1/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://mock-data-holder:8000", + "resourceBaseUri": "https://mock-data-holder:8002", + "infoSecBaseUri": "https://mock-data-holder:8001", + "extensionBaseUri": "", + "websiteUri": "https://bank1/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://mock-data-holder:8000", - "productBaseUri": "https://mock-data-holder:8000", - "resourceBaseUri": "https://mock-data-holder:8002", - "infoSecBaseUri": "https://mock-data-holder:8001", - "extensionBaseUri": "", - "websiteUri": "https://bank1/" } - } - ] - } - ] - }, - { - "legalEntityId": "07568be9-ed72-4268-8a8f-83cf60608dff", - "legalEntityName": "Non Bank Legal Entity 1", - "logoUri": "https://non-bank/logo.png", - "registrationNumber": "48219", - "registrationDate": "2021-12-01T10:00:00", - "registeredCountry": "AUSTRALIA", - "abn": "58392017462", - "acn": "473915802", - "arbn": null, - "anzsicDivision": "6221", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 3, - "statusId": 1, - "brands": [ - { - "brandId": "7f3c2a41-9b8e-4e6c-9df1-12c4b8f0a6e3", - "brandName": "Mock Data Holder (Non-Bank Lending)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://non-bank1/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.non.bank1/jwks" + ] + } + ] + }, + { + "legalEntityId": "18b75a76-5821-4c9e-b465-4709291cf0f4", + "legalEntityName": "Mock Software Company", + "logoUri": "https://mocksoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "11222333444", + "acn": "222333444", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000099", + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "ffb1c8ba-279e-44d8-96f0-1bc34a6b436f", + "brandName": "Mock Finance Tools", + "logoUri": "https://mocksoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "c6327f87-687a-4369-99a4-eaacd3bb8210", + "softwareProductName": "MyBudgetHelper", + "softwareProductDescription": "A product to help you manage your budget", + "logoUri": "https://mocksoftware/mybudgetapp/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://mocksoftware/mybudgetapp", + "tosUri": "https://mocksoftware/mybudgetapp/terms", + "policyUri": "https://mocksoftware/mybudgetapp/policy", + "recipientBaseUri": "https://mock-data-recipient:9001", + "revocationUri": "https://mock-data-recipient:9001/revocation", + "redirectUris": "https://mock-data-recipient:9001/consent/callback", + "jwksUri": "https://mock-data-recipient:9001/jwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "93ef5f28-7f30-43f2-8e5c-b1e3cb39ce90", + "legalEntityName": "New Bank", + "logoUri": "https://newbank/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "99888777666", + "acn": "888777666", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55", + "brandName": "New Bank -- dummy data holder -- do not use", + "logoUri": "https://newbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.newbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.newbank", + "resourceBaseUri": "https://api.newbank", + "infoSecBaseUri": "https://idp.newbank", + "extensionBaseUri": "", + "websiteUri": "https://newbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://mock-data-holder:8200", - "productBaseUri": "https://mock-data-holder:8200", - "resourceBaseUri": "https://mock-data-holder:8202", - "infoSecBaseUri": "https://mock-data-holder:8201", - "extensionBaseUri": "", - "websiteUri": "https://non-bank1/" } - } - ] - } - ] - }, - { - "legalEntityId": "18b75a76-5821-4c9e-b465-4709291cf0f4", - "legalEntityName": "Mock Software Company", - "logoUri": "https://mocksoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "11222333444", - "acn": "222333444", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000099", - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "ffb1c8ba-279e-44d8-96f0-1bc34a6b436f", - "brandName": "Mock Finance Tools", - "brandGroup": null, - "logoUri": "https://mocksoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "c6327f87-687a-4369-99a4-eaacd3bb8210", - "softwareProductName": "MyBudgetHelper", - "softwareProductDescription": "A product to help you manage your budget", - "logoUri": "https://mocksoftware/mybudgetapp/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://mocksoftware/mybudgetapp", - "tosUri": "https://mocksoftware/mybudgetapp/terms", - "policyUri": "https://mocksoftware/mybudgetapp/policy", - "recipientBaseUri": "https://mock-data-recipient:9001", - "revocationUri": "https://mock-data-recipient:9001/revocation", - "redirectUris": "https://mock-data-recipient:9001/consent/callback", - "jwksUri": "https://mock-data-recipient:9001/jwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] + ] + } + ] + }, + { + "legalEntityId": "aeca53ab-2a90-4737-938d-987ce195ca14", + "legalEntityName": "Sun Bank", + "logoUri": "https://sunbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "94477558899", + "acn": "99000099", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": 2, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d", + "brandName": "Sun -- dummy data holder -- do not use", + "logoUri": "https://sunbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-01T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.sunbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.sunbank", + "resourceBaseUri": "https://api.sunbank", + "infoSecBaseUri": "https://idp.sunbank", + "extensionBaseUri": "", + "websiteUri": "https://sunbank/" } - ] - } - ] - } - ] - }, - { - "legalEntityId": "93ef5f28-7f30-43f2-8e5c-b1e3cb39ce90", - "legalEntityName": "New Bank", - "logoUri": "https://newbank/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "99888777666", - "acn": "888777666", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55", - "brandName": "New Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://newbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.newbank/jwks" + }, + { + "brandId": "a2cd9cd1-e3c7-493b-86d8-f9f319ca0732", + "brandName": "Brighter Bank -- dummy data holder -- do not use", + "logoUri": "https://brighterbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-01-01T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.brighterbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.brighterbank", + "resourceBaseUri": "https://api.brighterbank", + "infoSecBaseUri": "https://idp.brighterbank", + "extensionBaseUri": "", + "websiteUri": "https://brighterbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.newbank", - "productBaseUri": null, // intentionally not provided - "resourceBaseUri": "https://api.newbank", - "infoSecBaseUri": "https://idp.newbank", - "extensionBaseUri": "", - "websiteUri": "https://newbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "aeca53ab-2a90-4737-938d-987ce195ca14", - "legalEntityName": "Sun Bank", - "logoUri": "https://sunbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "94477558899", - "acn": "99000099", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d", - "brandName": "Sun -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://sunbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-01T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.sunbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "ba1311fb-5cea-4c5c-b4ed-f2a98a0915e0", + "legalEntityName": "Hot Bank", + "logoUri": "https://hotbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12345678901", + "acn": "123456789", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "62f4a113-defe-4f99-bd9c-625277bc0e36", + "brandName": "mildBank -- dummy data holder -- do not use", + "logoUri": "https://mildbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-11T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://mildbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.mildbank", + "resourceBaseUri": "https://api.mildbank", + "infoSecBaseUri": "https://idp.mildbank", + "extensionBaseUri": "", + "websiteUri": "https://mildbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.sunbank", - "productBaseUri": "https://publicapi.sunbank", - "resourceBaseUri": "https://api.sunbank", - "infoSecBaseUri": "https://idp.sunbank", - "extensionBaseUri": "", - "websiteUri": "https://sunbank/" - } - }, - { - "brandId": "a2cd9cd1-e3c7-493b-86d8-f9f319ca0732", - "brandName": "Brighter Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://brighterbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-01-01T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.brighterbank/jwks" + }, + { + "brandId": "81d3d5cc-cdb6-4253-a78b-b17155dde7fd", + "brandName": "extrahotBank -- dummy data holder -- do not use", + "logoUri": "https://extrahotbank/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-16T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://extrahotbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.extrahotbank", + "resourceBaseUri": "https://api.extrahotbank", + "infoSecBaseUri": "https://idp.extrahotbank", + "extensionBaseUri": "", + "websiteUri": "https://extrahotbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.brighterbank", - "productBaseUri": "https://publicapi.brighterbank", - "resourceBaseUri": "https://api.brighterbank", - "infoSecBaseUri": "https://idp.brighterbank", - "extensionBaseUri": "", - "websiteUri": "https://brighterbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "ba1311fb-5cea-4c5c-b4ed-f2a98a0915e0", - "legalEntityName": "Hot Bank", - "logoUri": "https://hotbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12345678901", - "acn": "123456789", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "62f4a113-defe-4f99-bd9c-625277bc0e36", - "brandName": "mildBank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://mildbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-11T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://mildbank/idp/jwks" + ] + } + ] + }, + { + "legalEntityId": "725c6e62-bfa7-4719-94af-415ae64d4bcd", + "legalEntityName": "Ive Bank", + "logoUri": "https://ivebank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12312312393", + "acn": "099800998", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "9928cf0f-70c7-40ea-b7ad-cad190232f68", + "brandName": "Ive Bank -- dummy data holder -- do not use", + "logoUri": "https://ivebank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-03T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.ivebank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.ivebank", + "resourceBaseUri": "https://api.ivebank", + "infoSecBaseUri": "https://idp.ivebank", + "extensionBaseUri": "", + "websiteUri": "https://ivebank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.mildbank", - "productBaseUri": "https://publicapi.mildbank", - "resourceBaseUri": "https://api.mildbank", - "infoSecBaseUri": "https://idp.mildbank", - "extensionBaseUri": "", - "websiteUri": "https://mildbank/" } - }, - { - "brandId": "81d3d5cc-cdb6-4253-a78b-b17155dde7fd", - "brandName": "extrahotBank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://extrahotbank/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-16T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://extrahotbank/idp/jwks" + ] + } + ] + }, + { + "legalEntityId": "2f1c327f-56b6-40c5-8e2e-b2130867329c", + "legalEntityName": "Eva Bank", + "logoUri": "https://evabank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "98765456765", + "acn": "22121232", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "7c97c3b5-fe64-4b35-8ae0-17fa5d4aa0a8", + "brandName": "Eva Bank corp -- dummy data holder -- do not use", + "logoUri": "https://evabankcorp/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-26T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.evabank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.evabank", + "resourceBaseUri": "https://api.evabank", + "infoSecBaseUri": "https://idp.evabank", + "extensionBaseUri": "", + "websiteUri": "https://evabank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.extrahotbank", - "productBaseUri": "https://publicapi.extrahotbank", - "resourceBaseUri": "https://api.extrahotbank", - "infoSecBaseUri": "https://idp.extrahotbank", - "extensionBaseUri": "", - "websiteUri": "https://extrahotbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "725c6e62-bfa7-4719-94af-415ae64d4bcd", - "legalEntityName": "Ive Bank", - "logoUri": "https://ivebank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12312312393", - "acn": "099800998", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "9928cf0f-70c7-40ea-b7ad-cad190232f68", - "brandName": "Ive Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://ivebank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-03T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.ivebank/jwks" + ] + } + ] + }, + { + "legalEntityId": "e81ab637-b3b7-4403-82b8-a43077a569d6", + "legalEntityName": "Royal Bank", + "logoUri": "https://royalbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "94477558833", + "acn": "99000033", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "a5252bde-d1a6-413f-8f53-f7e2f6ab3f77", + "brandName": "Royal Bank -- dummy data holder -- do not use", + "logoUri": "https://royalbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-01T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.royalbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.royalbank", + "resourceBaseUri": "https://api.royalbank", + "infoSecBaseUri": "https://idp.royalbank", + "extensionBaseUri": "", + "websiteUri": "https://royalbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.ivebank", - "productBaseUri": "https://publicapi.ivebank", - "resourceBaseUri": "https://api.ivebank", - "infoSecBaseUri": "https://idp.ivebank", - "extensionBaseUri": "", - "websiteUri": "https://ivebank/" } - } - ] - } - ] - }, - { - "legalEntityId": "2f1c327f-56b6-40c5-8e2e-b2130867329c", - "legalEntityName": "Eva Bank", - "logoUri": "https://evabank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "98765456765", - "acn": "22121232", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "7c97c3b5-fe64-4b35-8ae0-17fa5d4aa0a8", - "brandName": "Eva Bank corp -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://evabankcorp/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-26T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.evabank/jwks" + ] + } + ] + }, + { + "legalEntityId": "e81ab636-b3b7-4403-82b8-a43077a569d6", + "legalEntityName": "Central Bank", + "logoUri": "https://centralbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12398122412", + "acn": "44123312", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": 2, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "c1ff7731-5843-4384-88d8-6062afde7c5b", + "brandName": "central bank -- dummy data holder -- do not use", + "logoUri": "https://centralbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-03-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.centralbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.centralbank", + "resourceBaseUri": "https://api.centralbank", + "infoSecBaseUri": "https://idp.centralbank", + "extensionBaseUri": "", + "websiteUri": "https://centralbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.evabank", - "productBaseUri": "https://publicapi.evabank", - "resourceBaseUri": "https://api.evabank", - "infoSecBaseUri": "https://idp.evabank", - "extensionBaseUri": "", - "websiteUri": "https://evabank/" } - } - ] - } - ] - }, - { - "legalEntityId": "e81ab637-b3b7-4403-82b8-a43077a569d6", - "legalEntityName": "Royal Bank", - "logoUri": "https://royalbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "94477558833", - "acn": "99000033", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "a5252bde-d1a6-413f-8f53-f7e2f6ab3f77", - "brandName": "Royal Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://royalbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-01T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.royalbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "ae4af466-54c6-4ce4-ad2d-580bc6496943", + "legalEntityName": "Fox Bank", + "logoUri": "https://foxbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "31234212475", + "acn": "122341213", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "2192a459-5ef5-4493-afe1-56c3d03fc1ba", + "brandName": "Fox Bank -- dummy data holder -- do not use", + "logoUri": "https://foxbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-21T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.foxbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.foxbank", + "resourceBaseUri": "https://api.foxbank", + "infoSecBaseUri": "https://idp.foxbank", + "extensionBaseUri": "", + "websiteUri": "https://foxbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.royalbank", - "productBaseUri": "https://publicapi.royalbank", - "resourceBaseUri": "https://api.royalbank", - "infoSecBaseUri": "https://idp.royalbank", - "extensionBaseUri": "", - "websiteUri": "https://royalbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "e81ab636-b3b7-4403-82b8-a43077a569d6", - "legalEntityName": "Central Bank", - "logoUri": "https://centralbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12398122412", - "acn": "44123312", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "c1ff7731-5843-4384-88d8-6062afde7c5b", - "brandName": "central bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://centralbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-03-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.centralbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "017fcfc8-1fd3-4ef4-8f08-b697c4c681ee", + "legalEntityName": "Grand Bank", + "logoUri": "https://grandbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "99888777666", + "acn": "888777666", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "8aa8e9a6-1dc7-4428-baea-d1f4533428b9", + "brandName": "Grand Bank -- dummy data holder -- do not use", + "logoUri": "https://grandbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-29T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.grandbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.grandbank", + "resourceBaseUri": "https://api.grandbank", + "infoSecBaseUri": "https://idp.grandbank", + "extensionBaseUri": "", + "websiteUri": "https://grandbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.centralbank", - "productBaseUri": "https://publicapi.centralbank", - "resourceBaseUri": "https://api.centralbank", - "infoSecBaseUri": "https://idp.centralbank", - "extensionBaseUri": "", - "websiteUri": "https://centralbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "ae4af466-54c6-4ce4-ad2d-580bc6496943", - "legalEntityName": "Fox Bank", - "logoUri": "https://foxbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "31234212475", - "acn": "122341213", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "2192a459-5ef5-4493-afe1-56c3d03fc1ba", - "brandName": "Fox Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://foxbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-21T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.foxbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "7b1a7566-e113-411b-94b7-d3b9fb0da98a", + "legalEntityName": "Kiss Bank", + "logoUri": "https://kissbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12593477455", + "acn": "112122235", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "85168ace-9211-45e3-bb75-f85c54e66f10", + "brandName": "Kiss Bank -- dummy data holder -- do not use", + "logoUri": "https://kissbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-12T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.kissbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.kissbank", + "resourceBaseUri": "https://api.kissbank", + "infoSecBaseUri": "https://idp.kissbank", + "extensionBaseUri": "", + "websiteUri": "https://kissbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.foxbank", - "productBaseUri": "https://publicapi.foxbank", - "resourceBaseUri": "https://api.foxbank", - "infoSecBaseUri": "https://idp.foxbank", - "extensionBaseUri": "", - "websiteUri": "https://foxbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "017fcfc8-1fd3-4ef4-8f08-b697c4c681ee", - "legalEntityName": "Grand Bank", - "logoUri": "https://grandbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "99888777666", - "acn": "888777666", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "8aa8e9a6-1dc7-4428-baea-d1f4533428b9", - "brandName": "Grand Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://grandbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-29T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.grandbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "667407fc-dc7e-4be5-8795-5189240bcbca", + "legalEntityName": "Luna Bank", + "logoUri": "https://lunabank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12334412233", + "acn": "747553322", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "bb03be60-5c46-422e-a27e-aefa0015078d", + "brandName": "Luna -- dummy data holder -- do not use", + "logoUri": "https://lunabank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-12T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.lunabank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.lunabank", + "resourceBaseUri": "https://api.lunabank", + "infoSecBaseUri": "https://idp.lunabank", + "extensionBaseUri": "", + "websiteUri": "https://lunabank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.grandbank", - "productBaseUri": "https://publicapi.grandbank", - "resourceBaseUri": "https://api.grandbank", - "infoSecBaseUri": "https://idp.grandbank", - "extensionBaseUri": "", - "websiteUri": "https://grandbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "7b1a7566-e113-411b-94b7-d3b9fb0da98a", - "legalEntityName": "Kiss Bank", - "logoUri": "https://kissbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12593477455", - "acn": "112122235", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "85168ace-9211-45e3-bb75-f85c54e66f10", - "brandName": "Kiss Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://kissbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-12T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.kissbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "7993c227-9252-432b-9b2f-a8666e2fd2f2", + "legalEntityName": "Mu Bank", + "logoUri": "https://mubank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12352345345", + "acn": "112123121", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "52d23611-4493-4a21-9095-44ae9eb85841", + "brandName": "Mu Bank -- dummy data holder -- do not use", + "logoUri": "https://mubank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.mubank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.mubank", + "resourceBaseUri": "https://api.mubank", + "infoSecBaseUri": "https://idp.mubank", + "extensionBaseUri": "", + "websiteUri": "https://mubank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.kissbank", - "productBaseUri": "https://publicapi.kissbank", - "resourceBaseUri": "https://api.kissbank", - "infoSecBaseUri": "https://idp.kissbank", - "extensionBaseUri": "", - "websiteUri": "https://kissbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "667407fc-dc7e-4be5-8795-5189240bcbca", - "legalEntityName": "Luna Bank", - "logoUri": "https://lunabank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12334412233", - "acn": "747553322", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "bb03be60-5c46-422e-a27e-aefa0015078d", - "brandName": "Luna -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://lunabank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-12T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.lunabank/jwks" + ] + } + ] + }, + { + "legalEntityId": "9c7dec6d-2e46-4b53-8430-5337c7eb93e9", + "legalEntityName": "Noon Bank", + "logoUri": "https://noonbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "11123599749", + "acn": "224435522", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "557f42e8-4e00-4b03-a9c9-d97796b6418b", + "brandName": "Noon Bank -- dummy data holder -- do not use", + "logoUri": "https://noonbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.noonbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.noonbank", + "resourceBaseUri": "https://api.noonbank", + "infoSecBaseUri": "https://idp.noonbank", + "extensionBaseUri": "", + "websiteUri": "https://noonbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.lunabank", - "productBaseUri": "https://publicapi.lunabank", - "resourceBaseUri": "https://api.lunabank", - "infoSecBaseUri": "https://idp.lunabank", - "extensionBaseUri": "", - "websiteUri": "https://lunabank/" } - } - ] - } - ] - }, - { - "legalEntityId": "7993c227-9252-432b-9b2f-a8666e2fd2f2", - "legalEntityName": "Mu Bank", - "logoUri": "https://mubank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12352345345", - "acn": "112123121", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "52d23611-4493-4a21-9095-44ae9eb85841", - "brandName": "Mu Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://mubank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.mubank/jwks" + ] + } + ] + }, + { + "legalEntityId": "b9b45c14-3346-47f7-ad78-3416762cf1d8", + "legalEntityName": "Oppo Bank", + "logoUri": "https://oppobank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12412412426", + "acn": "995543336", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "a5e45351-d13c-4690-93d1-3da515e71a92", + "brandName": "Oppo Bank -- dummy data holder -- do not use", + "logoUri": "https://oppobank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.oppobank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.oppobank", + "resourceBaseUri": "https://api.oppobank", + "infoSecBaseUri": "https://idp.oppobank", + "extensionBaseUri": "", + "websiteUri": "https://oppobank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.mubank", - "productBaseUri": "https://publicapi.mubank", - "resourceBaseUri": "https://api.mubank", - "infoSecBaseUri": "https://idp.mubank", - "extensionBaseUri": "", - "websiteUri": "https://mubank/" } - } - ] - } - ] - }, - { - "legalEntityId": "9c7dec6d-2e46-4b53-8430-5337c7eb93e9", - "legalEntityName": "Noon Bank", - "logoUri": "https://noonbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "11123599749", - "acn": "224435522", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "557f42e8-4e00-4b03-a9c9-d97796b6418b", - "brandName": "Noon Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://noonbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.noonbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "b7a18659-eb9b-4130-a0df-402c85f1f216", + "legalEntityName": "Pepper Bank", + "logoUri": "https://pepperbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "87356524315", + "acn": "322342343", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "97e53112-73b2-482a-b352-39d389d67916", + "brandName": "Pepper Bank -- dummy data holder -- do not use", + "logoUri": "https://pepperbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.pepperbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.pepperbank", + "resourceBaseUri": "https://api.pepperbank", + "infoSecBaseUri": "https://idp.pepperbank", + "extensionBaseUri": "", + "websiteUri": "https://pepperbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.noonbank", - "productBaseUri": "https://publicapi.noonbank", - "resourceBaseUri": "https://api.noonbank", - "infoSecBaseUri": "https://idp.noonbank", - "extensionBaseUri": "", - "websiteUri": "https://noonbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "b9b45c14-3346-47f7-ad78-3416762cf1d8", - "legalEntityName": "Oppo Bank", - "logoUri": "https://oppobank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12412412426", - "acn": "995543336", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "a5e45351-d13c-4690-93d1-3da515e71a92", - "brandName": "Oppo Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://oppobank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.oppobank/jwks" + ] + } + ] + }, + { + "legalEntityId": "fe75814c-99ee-4922-a6b0-71913e60984c", + "legalEntityName": "QQ Bank", + "logoUri": "https://qqbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "21111244638", + "acn": "317373231", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "895e54c5-93e0-405f-8072-0a9871bac8b5", + "brandName": "QQ Bank -- dummy data holder -- do not use", + "logoUri": "https://qqbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.qqbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.qqbank", + "resourceBaseUri": "https://api.qqbank", + "infoSecBaseUri": "https://idp.qqbank", + "extensionBaseUri": "", + "websiteUri": "https://qqbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.oppobank", - "productBaseUri": "https://publicapi.oppobank", - "resourceBaseUri": "https://api.oppobank", - "infoSecBaseUri": "https://idp.oppobank", - "extensionBaseUri": "", - "websiteUri": "https://oppobank/" } - } - ] - } - ] - }, - { - "legalEntityId": "b7a18659-eb9b-4130-a0df-402c85f1f216", - "legalEntityName": "Pepper Bank", - "logoUri": "https://pepperbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "87356524315", - "acn": "322342343", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "97e53112-73b2-482a-b352-39d389d67916", - "brandName": "Pepper Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://pepperbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.pepperbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "06c595f2-f0b2-4684-90e1-6905e4537304", + "legalEntityName": "Run Bank", + "logoUri": "https://runbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "99888777666", + "acn": "888777666", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "975375f7-2bd9-44b5-a188-43d65ca8eaae", + "brandName": "Run Bank -- dummy data holder -- do not use", + "logoUri": "https://runbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.runbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.runbank", + "resourceBaseUri": "https://api.runbank", + "infoSecBaseUri": "https://idp.runbank", + "extensionBaseUri": "", + "websiteUri": "https://runbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.pepperbank", - "productBaseUri": "https://publicapi.pepperbank", - "resourceBaseUri": "https://api.pepperbank", - "infoSecBaseUri": "https://idp.pepperbank", - "extensionBaseUri": "", - "websiteUri": "https://pepperbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "fe75814c-99ee-4922-a6b0-71913e60984c", - "legalEntityName": "QQ Bank", - "logoUri": "https://qqbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "21111244638", - "acn": "317373231", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "895e54c5-93e0-405f-8072-0a9871bac8b5", - "brandName": "QQ Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://qqbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.qqbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "350c4b28-132c-4248-a962-1434e00e7046", + "legalEntityName": "SaS Bank", + "logoUri": "https://sasbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "99888777666", + "acn": "888777666", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "b648f694-0dee-4f5e-bd2c-9837ac08fb7b", + "brandName": "SaS Bank -- dummy data holder -- do not use", + "logoUri": "https://sasbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.sasbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.sasbank", + "resourceBaseUri": "https://api.sasbank", + "infoSecBaseUri": "https://idp.sasbank", + "extensionBaseUri": "", + "websiteUri": "https://sasbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.qqbank", - "productBaseUri": "https://publicapi.qqbank", - "resourceBaseUri": "https://api.qqbank", - "infoSecBaseUri": "https://idp.qqbank", - "extensionBaseUri": "", - "websiteUri": "https://qqbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "06c595f2-f0b2-4684-90e1-6905e4537304", - "legalEntityName": "Run Bank", - "logoUri": "https://runbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "99888777666", - "acn": "888777666", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "975375f7-2bd9-44b5-a188-43d65ca8eaae", - "brandName": "Run Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://runbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.runbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "a1349224-adf3-4678-ba9b-f9ec800b5dc5", + "legalEntityName": "TnT Bank", + "logoUri": "https://tntbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "13123412473", + "acn": "533284211", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "f8bce914-ac8d-436a-b265-19baca6d1df2", + "brandName": "TnT Bank -- dummy data holder -- do not use", + "logoUri": "https://tntbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-09T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.tntbank/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.tntbank", + "resourceBaseUri": "https://api.tntbank", + "infoSecBaseUri": "https://idp.tntbank", + "extensionBaseUri": "", + "websiteUri": "https://tntbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.runbank", - "productBaseUri": "https://publicapi.runbank", - "resourceBaseUri": "https://api.runbank", - "infoSecBaseUri": "https://idp.runbank", - "extensionBaseUri": "", - "websiteUri": "https://runbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "350c4b28-132c-4248-a962-1434e00e7046", - "legalEntityName": "SaS Bank", - "logoUri": "https://sasbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "99888777666", - "acn": "888777666", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "b648f694-0dee-4f5e-bd2c-9837ac08fb7b", - "brandName": "SaS Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://sasbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.sasbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "bc9d68f2-74c4-43d5-9a9c-93e72a2e84c9", + "legalEntityName": "Bank Legal Entity 2", + "logoUri": "https://bank2/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "11111111111", + "acn": "888777666", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": 2, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "e748eadf-4aa4-4e2f-b3da-fb4a9d511994", + "brandName": "Bank Brand 2 -- dummy data holder -- do not use", + "logoUri": "https://bank2/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://idp.bank2/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.bank2", + "resourceBaseUri": "https://api.bank2", + "infoSecBaseUri": "https://idp.bank2", + "extensionBaseUri": "", + "websiteUri": "https://bank2/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.sasbank", - "productBaseUri": "https://publicapi.sasbank", - "resourceBaseUri": "https://api.sasbank", - "infoSecBaseUri": "https://idp.sasbank", - "extensionBaseUri": "", - "websiteUri": "https://sasbank/" } - } - ] - } - ] - }, - { - "legalEntityId": "a1349224-adf3-4678-ba9b-f9ec800b5dc5", - "legalEntityName": "TnT Bank", - "logoUri": "https://tntbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "13123412473", - "acn": "533284211", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "f8bce914-ac8d-436a-b265-19baca6d1df2", - "brandName": "TnT Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://tntbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-09T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.tntbank/jwks" + ] + } + ] + }, + { + "legalEntityId": "3d974478-afa6-4ce4-80bc-6f93e8e92e19", + "legalEntityName": "Smarter Bank", + "logoUri": "https://smarterbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12345678901", + "acn": "123456789", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "9f8df3e2-6866-42af-91d4-5faa3204f0b8", + "brandName": "Smarter Bank -- dummy data holder -- do not use", + "logoUri": "https://smarterbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://smarterbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.smarterbank", + "resourceBaseUri": "https://api.smarterbank", + "infoSecBaseUri": "https://idp.smarterbank", + "extensionBaseUri": "", + "websiteUri": "https://smarterbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.tntbank", - "productBaseUri": "https://publicapi.tntbank", - "resourceBaseUri": "https://api.tntbank", - "infoSecBaseUri": "https://idp.tntbank", - "extensionBaseUri": "", - "websiteUri": "https://tntbank/" - } - } - ] - } - ] - }, - { - "legalEntityId": "bc9d68f2-74c4-43d5-9a9c-93e72a2e84c9", - "legalEntityName": "Bank Legal Entity 2", - "logoUri": "https://bank2/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "11111111111", - "acn": "888777666", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "e748eadf-4aa4-4e2f-b3da-fb4a9d511994", - "brandName": "Bank Brand 2 -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://bank2/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.bank2/jwks" + }, + { + "brandId": "81d3d5cb-cdb6-4253-a78b-b17155dde7fd", + "brandName": "MyBank -- dummy data holder -- do not use", + "logoUri": "https://mybank/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://mybank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.mybank", + "resourceBaseUri": "https://api.mybank", + "infoSecBaseUri": "https://idp.mybank", + "extensionBaseUri": "", + "websiteUri": "https://mybank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.bank2", - "productBaseUri": "https://publicapi.bank2", - "resourceBaseUri": "https://api.bank2", - "infoSecBaseUri": "https://idp.bank2", - "extensionBaseUri": "", - "websiteUri": "https://bank2/" } - } - ] - } - ] - }, - { - "legalEntityId": "3d974478-afa6-4ce4-80bc-6f93e8e92e19", - "legalEntityName": "Smarter Bank", - "logoUri": "https://smarterbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12345678901", - "acn": "123456789", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "9f8df3e2-6866-42af-91d4-5faa3204f0b8", - "brandName": "Smarter Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://smarterbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://smarterbank/idp/jwks" + ] + } + ] + }, + { + "legalEntityId": "924ca498-0f19-402d-ae07-2cb61088f8aa", + "legalEntityName": "Hall Bank", + "logoUri": "https://hallbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "12345678901", + "acn": "123456789", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "cf217aba-e00d-48d5-9c3d-03af0b91cb80", + "brandName": "Hall Bank -- dummy data holder -- do not use", + "logoUri": "https://hallardbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-19T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://hallbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.hallbank", + "resourceBaseUri": "https://api.hallbank", + "infoSecBaseUri": "https://idp.hallbank", + "extensionBaseUri": "", + "websiteUri": "https://hallbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.smarterbank", - "productBaseUri": "https://publicapi.smarterbank", - "resourceBaseUri": "https://api.smarterbank", - "infoSecBaseUri": "https://idp.smarterbank", - "extensionBaseUri": "", - "websiteUri": "https://smarterbank/" - } - }, - { - "brandId": "81d3d5cb-cdb6-4253-a78b-b17155dde7fd", - "brandName": "MyBank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://mybank/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://mybank/idp/jwks" + }, + { + "brandId": "920f296d-5f2f-49de-876c-15a4aa1b4a79", + "brandName": "Hallway -- dummy data holder -- do not use", + "logoUri": "https://hallwaybank/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-18T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://hallwaybank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.hallwaybank", + "resourceBaseUri": "https://api.hallwaybank", + "infoSecBaseUri": "https://idp.hallwaybank", + "extensionBaseUri": "", + "websiteUri": "https://hallwaybank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.mybank", - "productBaseUri": "https://publicapi.mybank", - "resourceBaseUri": "https://api.mybank", - "infoSecBaseUri": "https://idp.mybank", - "extensionBaseUri": "", - "websiteUri": "https://mybank/" } - } - ] - } - ] - }, - { - "legalEntityId": "924ca498-0f19-402d-ae07-2cb61088f8aa", - "legalEntityName": "Hall Bank", - "logoUri": "https://hallbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "12345678901", - "acn": "123456789", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "cf217aba-e00d-48d5-9c3d-03af0b91cb80", - "brandName": "Hall Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://hallardbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-19T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://hallbank/idp/jwks" + ] + } + ] + }, + { + "legalEntityId": "04361651-f485-421a-8e3e-d01dd7ab2706", + "legalEntityName": "Job Bank", + "logoUri": "https://jobbank/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "13254365476", + "acn": "264284352", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": null, + "accreditationLevelId": null, + "participations": [ + { + "participationTypeId": 1, + "industryId": 1, + "statusId": 1, + "brands": [ + { + "brandId": "bc144967-d6f8-47a6-8590-07caf522141b", + "brandName": "Jobs Bank -- dummy data holder -- do not use", + "logoUri": "https://jobsbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://jobsbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.jobsbank", + "resourceBaseUri": "https://api.jobsbank", + "infoSecBaseUri": "https://idp.jobsbank", + "extensionBaseUri": "", + "websiteUri": "https://jobsbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.hallbank", - "productBaseUri": "https://publicapi.hallbank", - "resourceBaseUri": "https://api.hallbank", - "infoSecBaseUri": "https://idp.hallbank", - "extensionBaseUri": "", - "websiteUri": "https://hallbank/" - } - }, - { - "brandId": "920f296d-5f2f-49de-876c-15a4aa1b4a79", - "brandName": "Hallway -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://hallwaybank/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-18T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://hallwaybank/idp/jwks" + }, + { + "brandId": "7b47ecf8-a991-4dd3-adef-b89564005e8e", + "brandName": "offer bank -- dummy data holder -- do not use", + "logoUri": "https://offerbank/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://offerbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.offerbank", + "resourceBaseUri": "https://api.offerbank", + "infoSecBaseUri": "https://idp.offerbank", + "extensionBaseUri": "", + "websiteUri": "https://offerbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.hallwaybank", - "productBaseUri": "https://publicapi.hallwaybank", - "resourceBaseUri": "https://api.hallwaybank", - "infoSecBaseUri": "https://idp.hallwaybank", - "extensionBaseUri": "", - "websiteUri": "https://hallwaybank/" - } - } - ] - } - ] - }, - { - "legalEntityId": "04361651-f485-421a-8e3e-d01dd7ab2706", - "legalEntityName": "Job Bank", - "logoUri": "https://jobbank/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "13254365476", - "acn": "264284352", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 1, - "statusId": 1, - "brands": [ - { - "brandId": "bc144967-d6f8-47a6-8590-07caf522141b", - "brandName": "Jobs Bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://jobsbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://jobsbank/idp/jwks" + }, + { + "brandId": "c3176245-4258-4383-b945-cd2f7c828d3c", + "brandName": "J bank -- dummy data holder -- do not use", + "logoUri": "https://jbank/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-18T11:58:00", + "authDetails": [ + { + "registerUTypeId": 1, + "jwksEndpoint": "https://jbank/idp/jwks" + } + ], + "endpoint": { + "version": 1, + "publicBaseUri": "https://publicapi.jbank", + "resourceBaseUri": "https://api.jbank", + "infoSecBaseUri": "https://idp.jbank", + "extensionBaseUri": "", + "websiteUri": "https://jbank/" } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.jobsbank", - "productBaseUri": "https://publicapi.jobsbank", - "resourceBaseUri": "https://api.jobsbank", - "infoSecBaseUri": "https://idp.jobsbank", - "extensionBaseUri": "", - "websiteUri": "https://jobsbank/" } - }, - { - "brandId": "7b47ecf8-a991-4dd3-adef-b89564005e8e", - "brandName": "offer bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://offerbank/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://offerbank/idp/jwks" - } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.offerbank", - "productBaseUri": "https://publicapi.offerbank", - "resourceBaseUri": "https://api.offerbank", - "infoSecBaseUri": "https://idp.offerbank", - "extensionBaseUri": "", - "websiteUri": "https://offerbank/" + ] + } + ] + }, + { + "legalEntityId": "9d34ede4-2c76-4ecc-a31e-ea8392d31cc9", + "legalEntityName": "FintechX", + "logoUri": "https://fintechx/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "98765987654", + "acn": "987659876", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR001001", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "20c0864b-ceef-4de0-8944-eb0962f825eb", + "brandName": "Finance X", + "logoUri": "https://fintechx/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "d3c44426-e003-4604-aa45-4137e45dfbc4", + "softwareProductName": "Loan Calculator X", + "softwareProductDescription": "Loan affordability application", + "logoUri": "https://fintechx/products/loancalculator/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://fintechx/products/loancalculator", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://fintechx/products/loancalculator", + "revocationUri": "https://fintechx/products/loancalculator/revocation", + "redirectUris": "https://fintechx/products/loancalculator/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + }, + { + "softwareProductId": "9381dad2-6b68-4879-b496-c1319d7dfbc9", + "softwareProductName": "Track Xpense", + "softwareProductDescription": "Application to allow you to track your expenses", + "logoUri": "https://fintechx/products/trackxpense/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://fintechx/products/trackxpense", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://fintechx/products/trackxpense", + "revocationUri": "https://fintechx/products/trackxpense/revoke", + "redirectUris": "https://fintechx/products/trackxpense/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + }, + { + "softwareProductId": "63bc22ac-6fd2-4e85-a979-c2fc7c4db9da", + "softwareProductName": "TestProductCert", + "softwareProductDescription": "Application to allow you to track your expenses", + "logoUri": "https://fintechx/products/trackxpense/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://fintechx/products/trackxpense", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://fintechx/products/trackxpense", + "revocationUri": "https://fintechx/products/trackxpense/revoke", + "redirectUris": "https://fintechx/products/trackxpense/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + }, + { + "softwareProductId": "86ecb655-9eba-409c-9be3-59e7adf7080d", + "softwareProductName": "MockDataRecepient", + "softwareProductDescription": "Mock Data Recepient", + "logoUri": "https://fintechx/products/trackxpense/logo.png", + "sectorIdentifierUri": "https://fintechx/products/trackxpense/sectoridentifieruri", + "clientUri": "https://fintechx/products/trackxpense", + "tosUri": "https://fintechx/products/trackxpense/tos", + "policyUri": "https://fintechx/products/trackxpense/policy", + "recipientBaseUri": "https://fintechx/products/trackxpense", + "revocationUri": "https://fintechx/products/trackxpense/revoke", + "redirectUris": "https://fintechx/products/trackxpense/cb https://fintechx/products/trackxpense/cb2", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] } - }, - { - "brandId": "c3176245-4258-4383-b945-cd2f7c828d3c", - "brandName": "J bank -- dummy data holder -- do not use", - "brandGroup": null, - "logoUri": "https://jbank/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-18T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://jbank/idp/jwks" - } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://publicapi.jbank", - "productBaseUri": "https://publicapi.jbank", - "resourceBaseUri": "https://api.jbank", - "infoSecBaseUri": "https://idp.jbank", - "extensionBaseUri": "", - "websiteUri": "https://jbank/" + ] + } + ] + }, + { + "legalEntityId": "a1ca85da-7be8-4020-9c27-c9623eca582b", + "legalEntityName": "Xray Software Pty Ltd", + "logoUri": "https://xraysoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "112341234", + "acn": "12341243", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000006", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "fe123396-4eba-4518-aade-b245ceea78af", + "brandName": "XRay Financial", + "logoUri": "https://xraysoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "6a25c22b-0810-4f41-8e41-f48d162c517d", + "softwareProductName": "Budget direct", + "softwareProductDescription": "A product to help you manage your budget", + "logoUri": "https://xraysoftware/budgetdirect/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://xraysoftware/budgetdirect", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://api.xrayoftware/budgetdirect", + "revocationUri": "https://api.xraysoftware/budgetdirect/revoke", + "redirectUris": "https://api.xraysoftware/budgetdirect/callback", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] } - } - ] - } - ] - }, - { - "legalEntityId": "9d34ede4-2c76-4ecc-a31e-ea8392d31cc9", - "legalEntityName": "FintechX", - "logoUri": "https://fintechx/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "98765987654", - "acn": "987659876", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR001001", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "20c0864b-ceef-4de0-8944-eb0962f825eb", - "brandName": "Finance X", - "brandGroup": null, - "logoUri": "https://fintechx/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "d3c44426-e003-4604-aa45-4137e45dfbc4", - "softwareProductName": "Loan Calculator X", - "softwareProductDescription": "Loan affordability application", - "logoUri": "https://fintechx/products/loancalculator/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://fintechx/products/loancalculator", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://fintechx/products/loancalculator", - "revocationUri": "https://fintechx/products/loancalculator/revocation", - "redirectUris": "https://fintechx/products/loancalculator/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - }, - { - "softwareProductId": "9381dad2-6b68-4879-b496-c1319d7dfbc9", - "softwareProductName": "Track Xpense", - "softwareProductDescription": "Application to allow you to track your expenses", - "logoUri": "https://fintechx/products/trackxpense/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://fintechx/products/trackxpense", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://fintechx/products/trackxpense", - "revocationUri": "https://fintechx/products/trackxpense/revoke", - "redirectUris": "https://fintechx/products/trackxpense/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - }, - { - "softwareProductId": "63bc22ac-6fd2-4e85-a979-c2fc7c4db9da", - "softwareProductName": "TestProductCert", - "softwareProductDescription": "Application to allow you to track your expenses", - "logoUri": "https://fintechx/products/trackxpense/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://fintechx/products/trackxpense", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://fintechx/products/trackxpense", - "revocationUri": "https://fintechx/products/trackxpense/revoke", - "redirectUris": "https://fintechx/products/trackxpense/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - }, - { - "softwareProductId": "86ecb655-9eba-409c-9be3-59e7adf7080d", - "softwareProductName": "MockDataRecepient", - "softwareProductDescription": "Mock Data Recepient", - "logoUri": "https://fintechx/products/trackxpense/logo.png", - "sectorIdentifierUri": "https://fintechx/products/trackxpense/sectoridentifieruri", - "clientUri": "https://fintechx/products/trackxpense", - "tosUri": "https://fintechx/products/trackxpense/tos", - "policyUri": "https://fintechx/products/trackxpense/policy", - "recipientBaseUri": "https://fintechx/products/trackxpense", - "revocationUri": "https://fintechx/products/trackxpense/revoke", - "redirectUris": "https://fintechx/products/trackxpense/cb https://fintechx/products/trackxpense/cb2", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "a1ca85da-7be8-4020-9c27-c9623eca582b", - "legalEntityName": "Xray Software Pty Ltd", - "logoUri": "https://xraysoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "112341234", - "acn": "12341243", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000006", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "fe123396-4eba-4518-aade-b245ceea78af", - "brandName": "XRay Financial", - "brandGroup": null, - "logoUri": "https://xraysoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "6a25c22b-0810-4f41-8e41-f48d162c517d", - "softwareProductName": "Budget direct", - "softwareProductDescription": "A product to help you manage your budget", - "logoUri": "https://xraysoftware/budgetdirect/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://xraysoftware/budgetdirect", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://api.xrayoftware/budgetdirect", - "revocationUri": "https://api.xraysoftware/budgetdirect/revoke", - "redirectUris": "https://api.xraysoftware/budgetdirect/callback", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "8ff78c90-74c2-4c51-9c04-9d829476687a", - "legalEntityName": "WOW Software Company", - "logoUri": "https://wowsoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "88778877", - "acn": "99889988", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000007", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "8fe9791a-e4a8-4104-b1cb-e0df41189520", - "brandName": "WOW", - "brandGroup": null, - "logoUri": "https://wowsoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-02-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "9788e6d3-75a1-47eb-a891-dd752ced0f61", - "softwareProductName": "MyBudgetHelper", - "softwareProductDescription": "A product to help you manage your budget", - "logoUri": "https://wowsoftware/mybudgetapp/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://wowsoftware/mybudgetapp", - "tosUri": "https://wowsoftware/mybudgetapp/terms", - "policyUri": "https://wowsoftware/mybudgetapp/policy", - "recipientBaseUri": "https://api.wowsoftware/mybudgetapp", - "revocationUri": "https://api.wowsoftware/mybudgetapp/revoke", - "redirectUris": "https://api.wowsoftware/mybudgetapp/callback https://api.mocksoftware/mybudgetapp/return", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "4a29856c-2634-4fea-bf9b-74c99c337e2f", - "legalEntityName": "olm Software Company", - "logoUri": "https://olmsoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "88778877", - "acn": "99889988", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000008", - "accreditationLevelId": 0, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "a7171ba3-fd05-456f-a859-be4e1cbcc17d", - "brandName": "OLM Software", - "brandGroup": null, - "logoUri": "https://olmsoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "05d7dfd7-1d8f-4abf-b987-cf56c9115e8d", - "softwareProductName": "Budgeter", - "softwareProductDescription": "A product to help you manage your budget", - "logoUri": "https://olmsoftware/mybudgetapp/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://olmsoftware/mybudgetapp", - "tosUri": "https://olmsoftware/mybudgetapp/terms", - "policyUri": "https://olmsoftware/mybudgetapp/policy", - "recipientBaseUri": "https://api.olmsoftware/mybudgetapp", - "revocationUri": "https://api.olmsoftware/mybudgetapp/revoke", - "redirectUris": "https://api.olmsoftware/mybudgetapp/redirect", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "f138d974-0d12-4150-ad0f-c77af745c60b", - "legalEntityName": "xlogical Software Company", - "logoUri": "https://xlogical/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": null, - "acn": null, - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR001009", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "8a3441aa-1242-493a-b466-dcbfffe5a441", - "brandName": "xlogical", - "brandGroup": null, - "logoUri": "https://xlogical/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "25ee528f-35ac-4a66-a67c-6166602c9322", - "softwareProductName": "Loan Calculator ", - "softwareProductDescription": "Loan applications", - "logoUri": "https://xlogical/products/loancalculator/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://xlogical/products/loancalculator", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://xlogical/products/loancalculator", - "revocationUri": "https://xlogical/products/loancalculator/revocation", - "redirectUris": "https://xlogical/products/loancalculator/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:payees:read bank:regular_payments:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "f72ab707-a619-4dc1-a90b-177d61bcf574", - "legalEntityName": "HotFinTech", - "logoUri": "https://hotfintech/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "01944123445", - "acn": "123412345", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR001002", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "46b33515-b4a5-4b1c-b5b4-25654d675be6", - "brandName": "HotFinTech", - "brandGroup": null, - "logoUri": "https://hotfintech/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-05T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "d3c44425-e003-4604-aa45-4137e45dfbc4", - "softwareProductName": "Pay advance", - "softwareProductDescription": "Buy first and pay later product", - "logoUri": "https://hotfintech/products/payadvance/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://hotfintech/products/payadvance ", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://hotfintech/products/payadvance", - "revocationUri": "https://hotfintech/products/payadvance/revocation", - "redirectUris": "https://hotfintech/products/payadvance/redirect", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - }, - { - "softwareProductId": "9926a894-cc29-4d63-b3b4-e404066ae6f2", - "softwareProductName": "Track sheet", - "softwareProductDescription": "Application to allow you to track your expenses", - "logoUri": "https://hotfintech/products/tracksheet/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://hotfintech/products/tracksheet/", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://hotfintech/products/tracksheet", - "revocationUri": "https://hotfintech/products/tracksheet/revoke", - "redirectUris": "https://hotfintech/products/tracksheet/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "c70456f3-843f-4407-a988-577c108a7816", - "legalEntityName": "ZeroFintech", - "logoUri": "https://zerofintech/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "98765987654", - "acn": "987659876", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR001004", - "accreditationLevelId": 1, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "ebbcc2f2-817e-42b8-8a28-cd45902159e0", - "brandName": "ZeroFintech", - "brandGroup": null, - "logoUri": "https://zerofintech/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-05T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "5d03d1a6-b83b-4176-a2f4-d0074a205695", - "softwareProductName": "Mortgage", - "softwareProductDescription": "calculate the mortgage value", - "logoUri": "https://zerofintech/products/mortgage/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://zerofintech/products/mortgage", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://zerofintech/products/mortgage", - "revocationUri": "https://zerofintech/products/mortgage/revocation", - "redirectUris": "https://zerofintech/products/mortgage/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - }, - { - "softwareProductId": "dafa09db-4433-4203-907a-bdf797c8cd21", - "softwareProductName": "Reward program", - "softwareProductDescription": "Application to allow you to track your expenses", - "logoUri": "https://zerofintech//products/rewards/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://zerofintech/products/rewards", - "tosUri": null, - "policyUri": null, - "recipientBaseUri": "https://zerofintech/products/rewards", - "revocationUri": "https://hotfintech/products/rewards/revoke", - "redirectUris": "https://zerofintech/products/rewards/cb", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - }, - { - "legalEntityId": "de815a93-85b3-4fe8-9513-33ad8f4359d0", - "legalEntityName": "yoyo Software Company", - "logoUri": "https://yoyosoftware/img/logo.png", - "registrationNumber": null, - "registrationDate": null, - "registeredCountry": null, - "abn": "11222333444", - "acn": "222333444", - "arbn": null, - "anzsicDivision": null, - "organisationTypeId": null, - "legalEntityStatusId": 1, - "accreditationNumber": "ADR000005", - "accreditationLevelId": 0, - "participations": [ - { - "participationTypeId": 2, - "industryId": null, - "statusId": 1, - "brands": [ - { - "brandId": "f3f0c40b-9df8-491a-af1d-81cb9ab5f021", - "brandName": "YoYo", - "brandGroup": null, - "logoUri": "https://yoyosoftware/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "softwareProducts": [ - { - "softwareProductId": "6f7a1b8e-8799-48a8-9011-e3920391f713", - "softwareProductName": "MyBudgetHelper", - "softwareProductDescription": "A product to help you manage your budget", - "logoUri": "https://yoyosoftware/mybudgetapp/img/logo.png", - "sectorIdentifierUri": null, - "clientUri": "https://yoyosoftware/mybudgetapp", - "tosUri": "https://yoyosoftware/mybudgetapp/terms", - "policyUri": "https://yoyosoftware/mybudgetapp/policy", - "recipientBaseUri": "https://api.yoyosoftware/mybudgetapp", - "revocationUri": "https://api.yoyosoftware/mybudgetapp/revoke", - "redirectUris": "https://api.yoyosoftware/mybudgetapp/callback https://api.yoyosoftware/mybudgetapp/return", - "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", - "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", - "statusId": 1, - "certificates": [ - { - "commonName": "MockDataRecipient", - "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file + ] + } + ] + }, + { + "legalEntityId": "8ff78c90-74c2-4c51-9c04-9d829476687a", + "legalEntityName": "WOW Software Company", + "logoUri": "https://wowsoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "88778877", + "acn": "99889988", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000007", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "8fe9791a-e4a8-4104-b1cb-e0df41189520", + "brandName": "WOW", + "logoUri": "https://wowsoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-02-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "9788e6d3-75a1-47eb-a891-dd752ced0f61", + "softwareProductName": "MyBudgetHelper", + "softwareProductDescription": "A product to help you manage your budget", + "logoUri": "https://wowsoftware/mybudgetapp/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://wowsoftware/mybudgetapp", + "tosUri": "https://wowsoftware/mybudgetapp/terms", + "policyUri": "https://wowsoftware/mybudgetapp/policy", + "recipientBaseUri": "https://api.wowsoftware/mybudgetapp", + "revocationUri": "https://api.wowsoftware/mybudgetapp/revoke", + "redirectUris": "https://api.wowsoftware/mybudgetapp/callback https://api.mocksoftware/mybudgetapp/return", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "4a29856c-2634-4fea-bf9b-74c99c337e2f", + "legalEntityName": "olm Software Company", + "logoUri": "https://olmsoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "88778877", + "acn": "99889988", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000008", + "accreditationLevelId": 0, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "a7171ba3-fd05-456f-a859-be4e1cbcc17d", + "brandName": "OLM Software", + "logoUri": "https://olmsoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "05d7dfd7-1d8f-4abf-b987-cf56c9115e8d", + "softwareProductName": "Budgeter", + "softwareProductDescription": "A product to help you manage your budget", + "logoUri": "https://olmsoftware/mybudgetapp/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://olmsoftware/mybudgetapp", + "tosUri": "https://olmsoftware/mybudgetapp/terms", + "policyUri": "https://olmsoftware/mybudgetapp/policy", + "recipientBaseUri": "https://api.olmsoftware/mybudgetapp", + "revocationUri": "https://api.olmsoftware/mybudgetapp/revoke", + "redirectUris": "https://api.olmsoftware/mybudgetapp/redirect", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "f138d974-0d12-4150-ad0f-c77af745c60b", + "legalEntityName": "xlogical Software Company", + "logoUri": "https://xlogical/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": null, + "acn": null, + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR001009", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "8a3441aa-1242-493a-b466-dcbfffe5a441", + "brandName": "xlogical", + "logoUri": "https://xlogical/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "25ee528f-35ac-4a66-a67c-6166602c9322", + "softwareProductName": "Loan Calculator ", + "softwareProductDescription": "Loan applications", + "logoUri": "https://xlogical/products/loancalculator/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://xlogical/products/loancalculator", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://xlogical/products/loancalculator", + "revocationUri": "https://xlogical/products/loancalculator/revocation", + "redirectUris": "https://xlogical/products/loancalculator/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:payees:read bank:regular_payments:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "f72ab707-a619-4dc1-a90b-177d61bcf574", + "legalEntityName": "HotFinTech", + "logoUri": "https://hotfintech/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "01944123445", + "acn": "123412345", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR001002", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "46b33515-b4a5-4b1c-b5b4-25654d675be6", + "brandName": "HotFinTech", + "logoUri": "https://hotfintech/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-05T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "d3c44425-e003-4604-aa45-4137e45dfbc4", + "softwareProductName": "Pay advance", + "softwareProductDescription": "Buy first and pay later product", + "logoUri": "https://hotfintech/products/payadvance/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://hotfintech/products/payadvance ", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://hotfintech/products/payadvance", + "revocationUri": "https://hotfintech/products/payadvance/revocation", + "redirectUris": "https://hotfintech/products/payadvance/redirect", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + }, + { + "softwareProductId": "9926a894-cc29-4d63-b3b4-e404066ae6f2", + "softwareProductName": "Track sheet", + "softwareProductDescription": "Application to allow you to track your expenses", + "logoUri": "https://hotfintech/products/tracksheet/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://hotfintech/products/tracksheet/", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://hotfintech/products/tracksheet", + "revocationUri": "https://hotfintech/products/tracksheet/revoke", + "redirectUris": "https://hotfintech/products/tracksheet/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "c70456f3-843f-4407-a988-577c108a7816", + "legalEntityName": "ZeroFintech", + "logoUri": "https://zerofintech/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "98765987654", + "acn": "987659876", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR001004", + "accreditationLevelId": 1, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "ebbcc2f2-817e-42b8-8a28-cd45902159e0", + "brandName": "ZeroFintech", + "logoUri": "https://zerofintech/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-05T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "5d03d1a6-b83b-4176-a2f4-d0074a205695", + "softwareProductName": "Mortgage", + "softwareProductDescription": "calculate the mortgage value", + "logoUri": "https://zerofintech/products/mortgage/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://zerofintech/products/mortgage", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://zerofintech/products/mortgage", + "revocationUri": "https://zerofintech/products/mortgage/revocation", + "redirectUris": "https://zerofintech/products/mortgage/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + }, + { + "softwareProductId": "dafa09db-4433-4203-907a-bdf797c8cd21", + "softwareProductName": "Reward program", + "softwareProductDescription": "Application to allow you to track your expenses", + "logoUri": "https://zerofintech//products/rewards/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://zerofintech/products/rewards", + "tosUri": null, + "policyUri": null, + "recipientBaseUri": "https://zerofintech/products/rewards", + "revocationUri": "https://hotfintech/products/rewards/revoke", + "redirectUris": "https://zerofintech/products/rewards/cb", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + }, + { + "legalEntityId": "de815a93-85b3-4fe8-9513-33ad8f4359d0", + "legalEntityName": "yoyo Software Company", + "logoUri": "https://yoyosoftware/img/logo.png", + "registrationNumber": null, + "registrationDate": null, + "registeredCountry": null, + "abn": "11222333444", + "acn": "222333444", + "arbn": null, + "anzsicDivision": null, + "organisationTypeId": null, + "legalEntityStatusId": 1, + "accreditationNumber": "ADR000005", + "accreditationLevelId": 0, + "participations": [ + { + "participationTypeId": 2, + "industryId": null, + "statusId": 1, + "brands": [ + { + "brandId": "f3f0c40b-9df8-491a-af1d-81cb9ab5f021", + "brandName": "YoYo", + "logoUri": "https://yoyosoftware/img/logo.png", + "brandStatusId": 1, + "lastUpdated": "2021-04-06T11:58:00", + "softwareProducts": [ + { + "softwareProductId": "6f7a1b8e-8799-48a8-9011-e3920391f713", + "softwareProductName": "MyBudgetHelper", + "softwareProductDescription": "A product to help you manage your budget", + "logoUri": "https://yoyosoftware/mybudgetapp/img/logo.png", + "sectorIdentifierUri": null, + "clientUri": "https://yoyosoftware/mybudgetapp", + "tosUri": "https://yoyosoftware/mybudgetapp/terms", + "policyUri": "https://yoyosoftware/mybudgetapp/policy", + "recipientBaseUri": "https://api.yoyosoftware/mybudgetapp", + "revocationUri": "https://api.yoyosoftware/mybudgetapp/revoke", + "redirectUris": "https://api.yoyosoftware/mybudgetapp/callback https://api.yoyosoftware/mybudgetapp/return", + "jwksUri": "https://localhost:7006/loopback/MockDataRecipientJwks", + "scope": "openid profile common:customer.basic:read common:customer.detail:read bank:accounts.basic:read bank:accounts.detail:read bank:transactions:read bank:regular_payments:read bank:payees:read energy:accounts.basic:read energy:accounts.detail:read energy:accounts.concessions:read energy:accounts.paymentschedule:read energy:billing:read energy:electricity.servicepoints.basic:read energy:electricity.servicepoints.detail:read energy:electricity.der:read energy:electricity.usage:read cdr:registration", + "statusId": 1, + "certificates": [ + { + "commonName": "MockDataRecipient", + "thumbprint": "f0e5146a51f16e236844cf0353d791f11865e405" + } + ] + } + ] + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/README.md b/README.md index b5b63fd..42b3174 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Consumer Data Right Logo](./cdr-logo.png?raw=true) -[![Consumer Data Standards v1.36.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.36.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.36.0/#introduction) +[![Consumer Data Standards v1.34.0](https://img.shields.io/badge/Consumer%20Data%20Standards-v1.34.0-blue.svg)](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) [![made-with-dotnet](https://img.shields.io/badge/Made%20with-.NET-1f425Ff.svg)](https://dotnet.microsoft.com/) [![made-with-csharp](https://img.shields.io/badge/Made%20with-C%23-1f425Ff.svg)](https://docs.microsoft.com/en-us/dotnet/csharp/) [![MIT License](https://img.shields.io/github/license/ConsumerDataRight/mock-register)](./LICENSE) @@ -12,7 +12,7 @@ This project includes source code, documentation and instructions for the Consum The ACCC operates the CDR Register within the CDR ecosystem. This repository contains a mock implementation of the CDR Register and is offered to help the community in the development and testing of their CDR solutions. ## Mock Register - Alignment -The Mock Register aligns to [v1.36.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.36.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.36.0/#introduction). +The Mock Register aligns to [v1.34.0](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction) of the [Consumer Data Standards](https://consumerdatastandardsaustralia.github.io/standards-archives/standards-1.34.0/#introduction). ## Getting Started There are a number of ways that the artefacts within this project can be used: diff --git a/Source/.editorconfig b/Source/.editorconfig index 0d14e5e..33cd81c 100644 --- a/Source/.editorconfig +++ b/Source/.editorconfig @@ -169,22 +169,7 @@ dotnet_diagnostic.SA1601.severity = none dotnet_diagnostic.S6960.severity = none # In the context of ASP.NET Core MVC web applications, both model binding and model validation are processes that take place prior to the execution of a controller action. dotnet_diagnostic.S6967.severity = none -csharp_style_prefer_null_check_over_type_check = true:suggestion - -# Allow endpoint versions to be marked as obsolete to hint they need to be cleaned up eventually without blocking the build as we need to maintain parity with the real register -# S1133: Deprecated code should be removed -dotnet_diagnostic.S1133.severity = suggestion [Program.cs] # Using platform dependent API on a component makes the code no longer work across all platforms. dotnet_diagnostic.CA1416.severity = none - - -# Allow model / mapping classes to be marked as obsolete to hint they need to be cleaned up -# but not block the build as we will need to maintain this obsolete functionality to match the real register -[**/Business/**.cs] -# S1133: Deprecated code should be removed -dotnet_diagnostic.S1133.severity = suggestion - -# CS0618: Type or member is obsolete -dotnet_diagnostic.CS0618.severity = suggestion \ No newline at end of file diff --git a/Source/.trivyignore b/Source/.trivyignore deleted file mode 100644 index ba80870..0000000 --- a/Source/.trivyignore +++ /dev/null @@ -1,3 +0,0 @@ -# AutoMapper Vulnerable to Denial of Service (DoS) via Uncontrolled Recursion -CVE-2026-32933 # (workaround applied, licensing for new version underway) -GHSA-rvv3-g6hj-g44x # same as above \ No newline at end of file diff --git a/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Models/CdrApiOptionsTests.cs b/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Models/CdrApiOptionsTests.cs deleted file mode 100644 index 4fb80f7..0000000 --- a/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Models/CdrApiOptionsTests.cs +++ /dev/null @@ -1,82 +0,0 @@ -using CDR.Register.API.Infrastructure.Models; -using Xunit; - -namespace CDR.Register.API.Infrastructure.Tests.UnitTests.Models -{ - [Trait("Category", "UnitTests")] - public partial class CdrApiOptionsTests - { - // DH Brands Endpoint Versions - public const int DhBrandsVersionMin = 2; - public const int DhBrandsVersionMax = 3; - - // DH Status Endpoint Versions - public const int DhStatusVersionMin = 1; - public const int DhStatusVersionMax = 2; - - // ADR Endpoint Versions - public const int AdrVersionMin = 3; - public const int AdrVersionMax = 4; - - // ADR Status Endpoint Versions - public const int AdrStatusVersionMin = 2; - public const int AdrStatusVersionMax = 3; - - // ADR Software Product Status Endpoint Versions - public const int AdrSoftwareProductStatusVersionMin = 2; - public const int AdrSoftwareProductStatusVersionMax = 3; - - // ADR SSA - public const int AdrSsaVersionMin = 3; - public const int AdrSsaVersionMax = 4; - - private readonly CdrApiOptions _underTest = new(); - -#pragma warning disable SA1515 // Single-line comment should be preceded by blank line - [Theory] - // DH Brands - [InlineData("/cdr-Register/v1/all/data-holders/brands", DhBrandsVersionMin, DhBrandsVersionMax)] - [InlineData("/cdr-register/v1/Banking/data-holders/brands", DhBrandsVersionMin, DhBrandsVersionMax)] - [InlineData("/cdr-register/v1/energy/Data-Holders/brands", DhBrandsVersionMin, DhBrandsVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-holders/Brands", DhBrandsVersionMin, DhBrandsVersionMax)] - [InlineData("/cdr-register/v1/telco/data-holders/brands", DhBrandsVersionMin, DhBrandsVersionMax)] - // DH Status - [InlineData("/CDR-register/v1/all/data-holders/status", DhStatusVersionMin, DhStatusVersionMax)] - [InlineData("/cdr-register/v1/banking/Data-Holders/status", DhStatusVersionMin, DhStatusVersionMax)] - [InlineData("/cdr-register/v1/Energy/data-holders/status", DhStatusVersionMin, DhStatusVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-holders/Status", DhStatusVersionMin, DhStatusVersionMax)] - [InlineData("/cdr-register/V1/telco/data-holders/status", DhStatusVersionMin, DhStatusVersionMax)] - // Adr - [InlineData("/CDR-register/v1/all/data-recipients", AdrVersionMin, AdrVersionMax)] - [InlineData("/cdr-register/v1/banking/Data-Recipients", AdrVersionMin, AdrVersionMax)] - [InlineData("/cdr-register/v1/Energy/data-recipients", AdrVersionMin, AdrVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-recipients", AdrVersionMin, AdrVersionMax)] - [InlineData("/cdr-register/V1/telco/data-recipients", AdrVersionMin, AdrVersionMax)] - // ADR Status - [InlineData("/CDR-register/v1/all/data-recipients/status", AdrStatusVersionMin, AdrStatusVersionMax)] - [InlineData("/cdr-register/v1/banking/Data-Recipients/status", AdrStatusVersionMin, AdrStatusVersionMax)] - [InlineData("/cdr-register/v1/Energy/data-recipients/status", AdrStatusVersionMin, AdrStatusVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-recipients/Status", AdrStatusVersionMin, AdrStatusVersionMax)] - [InlineData("/cdr-register/V1/telco/data-recipients/status", AdrStatusVersionMin, AdrStatusVersionMax)] - // ADR Software Product Status - [InlineData("/CDR-register/v1/all/data-recipients/brands/software-products/status", AdrSoftwareProductStatusVersionMin, AdrSoftwareProductStatusVersionMax)] - [InlineData("/cdr-register/v1/banking/Data-Recipients/brands/software-products/status", AdrSoftwareProductStatusVersionMin, AdrSoftwareProductStatusVersionMax)] - [InlineData("/cdr-register/v1/Energy/data-recipients/brands/software-products/status", AdrSoftwareProductStatusVersionMin, AdrSoftwareProductStatusVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-recipients/Brands/software-products/Status", AdrSoftwareProductStatusVersionMin, AdrSoftwareProductStatusVersionMax)] - [InlineData("/cdr-register/V1/telco/data-recipients/brands/Software-Products/status", AdrSoftwareProductStatusVersionMin, AdrSoftwareProductStatusVersionMax)] - // ADR SSA - [InlineData("/CDR-register/v1/all/data-recipients/brands/da7da031-ad91-449e-83e6-d07e7328ef66/software-products/69A28fF3-413F-4255-aF86-3Bd6df7f6Bc3/ssa", AdrSsaVersionMin, AdrSsaVersionMax)] - [InlineData("/cdr-register/v1/banking/Data-Recipients/brands/da7da031-ad91-449e-83e6-d07e7328ef66/software-products/69A28FF3-413F-4255-AF86-3BD6DF7F6BC3/ssa", AdrSsaVersionMin, AdrSsaVersionMax)] - [InlineData("/cdr-register/v1/non-bank-lending/data-recipients/Brands/DA7DA031-AD91-449E-83E6-D07E7328EF66/software-products/69a28ff3-413f-4255-af86-3bd6df7f6bc3/ssa", AdrSsaVersionMin, AdrSsaVersionMax)] - [InlineData("/cdr-register/V1/telco/data-recipients/brands/da7da031-ad91-449e-83e6-d07e7328ef66/Software-Products/69a28ff3-413f-4255-af86-3bd6df7f6bc3/ssa", AdrSsaVersionMin, AdrSsaVersionMax)] -#pragma warning restore SA1515 // Single-line comment should be preceded by blank line - public void GetApiEndpointVersionOption_ShouldReturnEndpoint(string path, int min, int max) - { - var result = this._underTest.GetApiEndpointVersionOption(path); - Assert.NotNull(result); - Assert.True(result.IsVersioned); - Assert.Equal(result.CurrentMinVersion, min); - Assert.Equal(result.CurrentMaxVersion, max); - } - } -} diff --git a/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Versioning/CdrVersionReaderTests.cs b/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Versioning/CdrVersionReaderTests.cs index 67a62aa..3ec7fad 100644 --- a/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Versioning/CdrVersionReaderTests.cs +++ b/Source/CDR.Register.API.Infrastructure.Tests.UnitTests/Versioning/CdrVersionReaderTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using CDR.Register.API.Infrastructure.Models; using CDR.Register.API.Infrastructure.Versioning; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; @@ -16,8 +15,8 @@ public partial class CdrVersionReaderTests public void Read_DataHolderStatus_NoXvHeader_ShouldReturn1() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["1"]; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "1"; var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/status")); @@ -33,13 +32,11 @@ public void Read_DataHolderStatus_NoXvHeader_ShouldReturn1() public void Read_DataHolderStatus_EmptyXvHeader_ShouldReturn1() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["1"]; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "1"; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues(string.Empty) }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues(string.Empty)); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/status")); @@ -57,164 +54,151 @@ public void Read_DataHolderStatus_EmptyXvHeader_ShouldReturn1() public void Read_NoXvHeader_ShouldReturnMissingVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); + var expectedVersion = "Missing Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_EmptyXvHeader_ShouldReturnMissingVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues(string.Empty) }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues(string.Empty)); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Missing Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_NullXvHeader_ShouldReturnMissingVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", default }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", default); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Missing Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_InvalidXvHeader_ShouldReturnInvalidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("foo") }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("foo")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Invalid Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_SetToZeroXvHeader_ShouldReturnInvalidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("0") }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("0")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Invalid Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_LessThanZeroXvHeader_ShouldReturnInvalidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("-1") }, - }; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("-1")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Invalid Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_GreaterThanMaxXvHeader_ShouldReturnUnsupportedVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("99") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("99")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Unsupported Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - Assert.Throws(action); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_ValidXvHeader_ShouldReturnValidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["2"]; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("2") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "2"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("2")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); @@ -232,12 +216,10 @@ public void Read_ValidXvHeader_ShouldReturnValidVersion() public void Read_UppercaseXvHeader_ShouldReturnValidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["2"]; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "X-V", new StringValues("2") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "2"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("X-V", new StringValues("2")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-holders/brands")); @@ -255,12 +237,10 @@ public void Read_UppercaseXvHeader_ShouldReturnValidVersion() public void Read_InvalidPath_ShouldReturn1() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["1"]; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "X-V", new StringValues("1") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "1"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("X-V", new StringValues("1")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/invalid/path")); @@ -278,13 +258,11 @@ public void Read_InvalidPath_ShouldReturn1() public void Read_WithRange_ShouldReturnMaxVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["4"]; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("5") }, - { "x-min-v", new StringValues("4") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "3"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("4")); + mockHttpHeaders.Add("x-min-v", new StringValues("3")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-recipients")); @@ -302,14 +280,11 @@ public void Read_WithRange_ShouldReturnMaxVersion() public void Read_WithUppercaseXminV_ShouldReturnMaxVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["4"]; - - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("5") }, - { "X-MIN-V", new StringValues("4") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "3"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("4")); + mockHttpHeaders.Add("X-MIN-V", new StringValues("3")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-recipients")); @@ -327,13 +302,11 @@ public void Read_WithUppercaseXminV_ShouldReturnMaxVersion() public void Read_XminVGreaterThanXV_ShouldBeIgnored() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - IReadOnlyCollection expectedVersion = ["3"]; - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("3") }, - { "x-min-v", new StringValues("4") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var expectedVersion = "3"; + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("3")); + mockHttpHeaders.Add("x-min-v", new StringValues("4")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-recipients")); @@ -351,45 +324,42 @@ public void Read_XminVGreaterThanXV_ShouldBeIgnored() public void Read_InvalidRange_ShouldReturnUnsupportedVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("6") }, - { "x-min-v", new StringValues("5") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("5")); + mockHttpHeaders.Add("x-min-v", new StringValues("4")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-recipients")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Unsupported Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - Assert.Throws(action); + Assert.Equal(expectedVersion, actualVersion); } [Fact] public void Read_ValidXvInvalidXminV_ShouldReturnInvalidVersion() { // Arrange. - var apiVersionReader = new CdrVersionReader(new CdrApiOptions()); - var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)) - { - { "x-v", new StringValues("3") }, - { "x-min-v", new StringValues("foo") }, - }; + var apiVersionReader = new CdrVersionReader(new Models.CdrApiOptions()); + var mockHttpHeaders = new HeaderDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); + mockHttpHeaders.Add("x-v", new StringValues("3")); + mockHttpHeaders.Add("x-min-v", new StringValues("foo")); var mockHttpRequest = Substitute.For(); mockHttpRequest.Path.Returns(new PathString("/cdr-register/v1/all/data-recipients")); mockHttpRequest.Headers.Returns(mockHttpHeaders); + var expectedVersion = "Invalid Version"; // Act. - var action = () => apiVersionReader.Read(mockHttpRequest); + var actualVersion = apiVersionReader.Read(mockHttpRequest); // Assert. - var ex = Assert.Throws(action); - Assert.Equal("x-min-v", ex.HeaderName); + Assert.Equal(expectedVersion, actualVersion); } } } diff --git a/Source/CDR.Register.API.Infrastructure/CDR.Register.API.Infrastructure.csproj b/Source/CDR.Register.API.Infrastructure/CDR.Register.API.Infrastructure.csproj index 3523833..14df0a6 100644 --- a/Source/CDR.Register.API.Infrastructure/CDR.Register.API.Infrastructure.csproj +++ b/Source/CDR.Register.API.Infrastructure/CDR.Register.API.Infrastructure.csproj @@ -16,7 +16,7 @@ true - + true diff --git a/Source/CDR.Register.API.Infrastructure/Configuration/ConfigureSwaggerOptions.cs b/Source/CDR.Register.API.Infrastructure/Configuration/ConfigureSwaggerOptions.cs index bd38fd7..ba9275b 100644 --- a/Source/CDR.Register.API.Infrastructure/Configuration/ConfigureSwaggerOptions.cs +++ b/Source/CDR.Register.API.Infrastructure/Configuration/ConfigureSwaggerOptions.cs @@ -1,5 +1,5 @@ -using Asp.Versioning.ApiExplorer; -using CDR.Register.API.Infrastructure.Models; +using CDR.Register.API.Infrastructure.Models; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Swashbuckle.AspNetCore.SwaggerGen; diff --git a/Source/CDR.Register.API.Infrastructure/Extensions.cs b/Source/CDR.Register.API.Infrastructure/Extensions.cs index ef52dc5..d6551f8 100644 --- a/Source/CDR.Register.API.Infrastructure/Extensions.cs +++ b/Source/CDR.Register.API.Infrastructure/Extensions.cs @@ -7,14 +7,10 @@ using System.Security.Cryptography.X509Certificates; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Asp.Versioning; -using Asp.Versioning.ApiExplorer; using CDR.Register.API.Infrastructure.Authorization; using CDR.Register.API.Infrastructure.Configuration; using CDR.Register.API.Infrastructure.Models; using CDR.Register.API.Infrastructure.SwaggerFilters; -using CDR.Register.API.Infrastructure.Versioning; -using CDR.Register.Domain.Extensions; using CDR.Register.Repository.Infrastructure; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; @@ -71,7 +67,7 @@ public static bool ValidateIssuer(this HttpContext context) return false; } - // For a stronger match validating dynamic base path with an conformance ID rather than only the ID + // For a stronger match validating dynamic base path with an conformance ID instead of confromanceId only return issuer?.Contains(context.Request.PathBase) ?? false; } @@ -170,7 +166,7 @@ public static void AddAuthenticationAuthorization(this IServiceCollection servic { var allAuthPolicies = AuthorisationPolicies.GetAllPolicies(); - // Apply all listed policies from a single source of truth that is also used for self-documentation + // Apply all listed policities from a single source of truth that is also used for self-documentation foreach (var pol in allAuthPolicies) { options.AddPolicy(pol.Name, policy => @@ -320,20 +316,16 @@ public static string GetHostNameAsUri(this ControllerBase controller, IConfigura return new Uri(url.Replace(currentHost, newHostName)); } - /// - /// Converts to an value. - /// - /// The industry string. - /// The appropriate enumeration value. - /// Thrown when the provided industry cannot be matched to an enum value. public static Industry ToIndustry(this string industry) { - if (EnumExtensions.TryParseFromDescription(industry, out var value)) + if (Enum.IsDefined(typeof(Industry), industry.ToUpper())) { - return value; + return (Industry)Enum.Parse(typeof(Industry), industry, true); + } + else + { + throw new NotSupportedException($"Invalid industry: {industry}"); } - - throw new NotSupportedException($"Invalid industry: {industry}"); } public static IEnumerable GetValueAsList(this IConfiguration configuration, string key, string delimiter) @@ -433,28 +425,6 @@ public static string GetCommonNameFromDistinguishedName(this string distinguishe } } - /// - /// Add CDR-specific API versioning and API explorer. - /// - /// The services. - /// Additional setup actions to configure beyond the default settings. - /// Additional setup actions to configure beyond the default settings. - /// The versioning builder. - public static IApiVersioningBuilder AddCdrApiVersioning(this IServiceCollection services, Action? setupVersioningAction = null, Action? setupExplorerAction = null) - { - return services - .AddApiVersioning(options => - { - options.ApiVersionReader = new CdrVersionReader(new CdrApiOptions()); // uses default options atm - setupVersioningAction?.Invoke(options); - }) - .AddApiExplorer(options => - { - options.GroupNameFormat = Constants.Versioning.GroupNameFormat; - setupExplorerAction?.Invoke(options); - }); - } - public static IServiceCollection AddCdrSwaggerGen(this IServiceCollection services, Action configureRegisterSwaggerOptions, bool isVersioned = true) { var options = new CdrSwaggerOptions(); @@ -465,6 +435,12 @@ public static IServiceCollection AddCdrSwaggerGen(this IServiceCollection servic if (isVersioned) { services.AddTransient, ConfigureSwaggerOptions>(); + + // Required for our Swagger setup to work when endpoints have been versioned + services.AddVersionedApiExplorer(opt => + { + opt.GroupNameFormat = options.VersionedApiGroupNameFormat; + }); } else { @@ -483,7 +459,6 @@ public static IServiceCollection AddCdrSwaggerGen(this IServiceCollection servic c.SchemaFilter(); c.OperationFilter(); c.OperationFilter(); - c.OperationFilter(); if (options.IncludeAuthentication) { diff --git a/Source/CDR.Register.API.Infrastructure/Extensions/CdrSwaggerMiddlewareExtensions.cs b/Source/CDR.Register.API.Infrastructure/Extensions/CdrSwaggerMiddlewareExtensions.cs index 0780669..3fd94ac 100644 --- a/Source/CDR.Register.API.Infrastructure/Extensions/CdrSwaggerMiddlewareExtensions.cs +++ b/Source/CDR.Register.API.Infrastructure/Extensions/CdrSwaggerMiddlewareExtensions.cs @@ -1,6 +1,6 @@ using System.Linq; -using Asp.Versioning.ApiExplorer; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.DependencyInjection; namespace CDR.Register.API.Infrastructure diff --git a/Source/CDR.Register.API.Infrastructure/Filters/CheckIndustryAttribute.cs b/Source/CDR.Register.API.Infrastructure/Filters/CheckIndustryAttribute.cs index 99e88aa..4ed0ec8 100644 --- a/Source/CDR.Register.API.Infrastructure/Filters/CheckIndustryAttribute.cs +++ b/Source/CDR.Register.API.Infrastructure/Filters/CheckIndustryAttribute.cs @@ -1,6 +1,4 @@ using System; -using System.Linq; -using CDR.Register.Domain.Extensions; using CDR.Register.Domain.Models; using CDR.Register.Repository.Infrastructure; using Microsoft.AspNetCore.Mvc; @@ -9,36 +7,23 @@ namespace CDR.Register.API.Infrastructure.Filters { /// - /// Checks the industry parameter(s) are supported, if not then responds with and appropriate payload. + /// Checks the industry parameter is supported, if not then responds with BadRequest and appropriate ResponseErrorList. /// - /// The industry parameter is case-insensitive. [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)] public class CheckIndustryAttribute : ActionFilterAttribute { - /// - /// Initializes a new instance of the class, configured to allow any valid industry. - /// + private readonly string _industryRestriction; + public CheckIndustryAttribute() { - this.IndustryRestrictions = []; + this._industryRestriction = string.Empty; } - /// - /// Initializes a new instance of the class, configured to only allow industries specified in . - /// - /// The specific industries this endpoint allows. - public CheckIndustryAttribute(params Industry[] industryRestrictions) + public CheckIndustryAttribute(Industry industryRestriction) { - this.IndustryRestrictions = industryRestrictions; + this._industryRestriction = industryRestriction.ToString().ToUpper(); } - public Industry[] IndustryRestrictions { get; } - - /// - /// Validate that the industry provided is allowed based on the industry restrictions configured for this instance. - /// - /// Changes the action result to a with an appropriate error message if the industry is not allowed. - /// The executing action context. public override void OnActionExecuting(ActionExecutingContext context) { if (context.ActionArguments["industry"] is string industry && !this.IsValidIndustry(industry)) @@ -49,17 +34,6 @@ public override void OnActionExecuting(ActionExecutingContext context) base.OnActionExecuting(context); } - /// - /// Validate the industry provided is: - /// - /// not null - /// a valid industry - /// allowed based on restrictions - /// - /// - /// The industry requested. - /// Industry value is case-insensitive. - /// A flag indicating if the industry is valid, and allowed. private bool IsValidIndustry(string industry) { // Industry needs to be provided. @@ -69,13 +43,13 @@ private bool IsValidIndustry(string industry) } // Convert the incoming industry value to an enum. - if (!EnumExtensions.TryParseFromDescription(industry, out Industry industryItem)) + if (!Enum.TryParse(industry.ToUpper(), out Industry industryItem)) { return false; } - // Check that the incoming industry matches the industry restriction, if any are specified. - if (this.IndustryRestrictions.Any() && !this.IndustryRestrictions.Contains(industryItem)) + // Check that the incoming industry matches the industry restriction, if set. + if (!string.IsNullOrEmpty(this._industryRestriction) && !string.Equals(this._industryRestriction, industryItem.ToString(), StringComparison.CurrentCultureIgnoreCase)) { return false; } diff --git a/Source/CDR.Register.API.Infrastructure/Middleware/ApiExceptionHandler.cs b/Source/CDR.Register.API.Infrastructure/Middleware/ApiExceptionHandler.cs index 7d10161..714fa3f 100644 --- a/Source/CDR.Register.API.Infrastructure/Middleware/ApiExceptionHandler.cs +++ b/Source/CDR.Register.API.Infrastructure/Middleware/ApiExceptionHandler.cs @@ -1,5 +1,4 @@ -using System; -using System.Net; +using System.Net; using System.Threading.Tasks; using CDR.Register.API.Infrastructure.Versioning; using CDR.Register.Domain.Models; @@ -13,47 +12,53 @@ namespace CDR.Register.API.Infrastructure.Middleware { public static class ApiExceptionHandler { - private static readonly JsonSerializerSettings SerializerSettings = new() - { - Formatting = Formatting.Indented, - NullValueHandling = NullValueHandling.Ignore, - ContractResolver = new DefaultContractResolver - { - NamingStrategy = new CamelCaseNamingStrategy(), - }, - }; - public static async Task Handle(HttpContext context) { var exceptionDetails = context.Features.Get(); var ex = exceptionDetails?.Error; - if (ex == null) + if (ex != null) { - return; - } + var handledError = string.Empty; + var statusCode = (int)HttpStatusCode.BadRequest; + var jsonSerializerSettings = new JsonSerializerSettings() + { + Formatting = Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore, + ContractResolver = new DefaultContractResolver + { + NamingStrategy = new CamelCaseNamingStrategy(), + }, + }; - (HttpStatusCode statusCode, ResponseErrorList errors) = ex switch - { - InvalidVersionException => - (HttpStatusCode.BadRequest, new ResponseErrorList().AddInvalidXVInvalidVersion()), - - UnsupportedVersionException => - (HttpStatusCode.NotAcceptable, new ResponseErrorList().AddInvalidXVUnsupportedVersion()), + if (ex is InvalidVersionException) + { + statusCode = (int)HttpStatusCode.BadRequest; + handledError = JsonConvert.SerializeObject(new ResponseErrorList().AddInvalidXVInvalidVersion(), jsonSerializerSettings); + } - MissingRequiredHeaderException missingRequiredHeaderException when missingRequiredHeaderException?.HeaderName == Headers.X_V => - (HttpStatusCode.BadRequest, new ResponseErrorList().AddInvalidXVMissingRequiredHeader()), + if (ex is UnsupportedVersionException) + { + statusCode = (int)HttpStatusCode.NotAcceptable; + handledError = JsonConvert.SerializeObject(new ResponseErrorList().AddInvalidXVUnsupportedVersion(), jsonSerializerSettings); + } - _ => - (HttpStatusCode.InternalServerError, new ResponseErrorList().AddUnexpectedError()), - }; + if (ex.GetType() == typeof(MissingRequiredHeaderException)) + { + var missingRequiredHeaderException = ex as MissingRequiredHeaderException; + if (missingRequiredHeaderException?.HeaderName == Headers.X_V) + { + statusCode = (int)HttpStatusCode.BadRequest; + handledError = JsonConvert.SerializeObject(new ResponseErrorList().AddInvalidXVMissingRequiredHeader(), jsonSerializerSettings); + } + } - if (errors.HasErrors()) - { - var handledError = JsonConvert.SerializeObject(errors, SerializerSettings); - context.Response.StatusCode = (int)statusCode; - context.Response.ContentType = "application/json"; - await context.Response.WriteAsync(handledError).ConfigureAwait(false); + if (!string.IsNullOrEmpty(handledError)) + { + context.Response.StatusCode = statusCode; + context.Response.ContentType = "application/json"; + await context.Response.WriteAsync(handledError).ConfigureAwait(false); + } } } } diff --git a/Source/CDR.Register.API.Infrastructure/Models/CdrApiOptions.cs b/Source/CDR.Register.API.Infrastructure/Models/CdrApiOptions.cs index f9adfd3..56fb2bc 100644 --- a/Source/CDR.Register.API.Infrastructure/Models/CdrApiOptions.cs +++ b/Source/CDR.Register.API.Infrastructure/Models/CdrApiOptions.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Http; @@ -7,28 +6,25 @@ namespace CDR.Register.API.Infrastructure.Models { public class CdrApiOptions { - private const string Id = @"[A-Za-z0-9\-]*"; // any letter, number, or hyphen - private const string Industry = @"(%7B)*[A-Za-z-]*(%7D)*"; // (%7B)* and (%7D)* represent the possibility of a { and } in the path, to cover the value '{industry}' for OAS generation purposes - private const string BasePathV1 = @$"\/cdr-register\/v1\/{Industry}"; - private const string AdminBasePath = @"\/admin"; + private static readonly List _supportedApiVersions = new List + { + // (?i) is to make the regex case insensitive + // (%7B)* and (%7D)* represent the possibility of a { and } in the path, to cover the value '{industry}' for OAS generation purposes - private static readonly CdrApiEndpointVersionOptions[] _supportedApiVersions = - [ - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-holders\/brands", true, 2, 3, 3), - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-holders\/status", false, 1, 2, 2), // This is intentionally not enforcing x-v header to be mandatory inline with v1 of the standards, if v1 becomes obsolete isXvMandatory should be true. - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-recipients", true, 3, 4, 4), - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-recipients\/status", true, 2, 3, 3), - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-recipients\/brands\/software-products\/status", true, 2, 3, 3), - new CdrApiEndpointVersionOptions(@$"{BasePathV1}\/data-recipients\/brands\/{Id}\/software-products\/{Id}\/ssa", true, 3, 4, 4), - ]; + // Register + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-holders\/brands", true, 2), + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-holders\/status", false, 1), + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-recipients", true, 3), + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-recipients\/status", true, 2), + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-recipients\/brands\/software-products\/status", true, 2), + new CdrApiEndpointVersionOptions(@"(?i)\/cdr-register\/v1\/(%7B)*[A-Za-z]*(%7D)*\/data-recipients\/brands\/[A-Za-z0-9\-]*\/software-products\/[A-Za-z0-9\-]*\/ssa", true, 3), - private static readonly CdrApiEndpointVersionOptions[] _supportedAdminVersions = - [ - new CdrApiEndpointVersionOptions(@$"{AdminBasePath}\/metadata\/data-holders", true, 1), - new CdrApiEndpointVersionOptions(@$"{AdminBasePath}\/metadata\/data-recipients", true, 1), - ]; + // Admin + new CdrApiEndpointVersionOptions(@"(?i)\/admin\/metadata\/data-holders", true, 1), + new CdrApiEndpointVersionOptions(@"(?i)\/admin\/metadata\/data-recipients", true, 1), + }; - public List EndpointVersionOptions { get; } = [.. _supportedApiVersions, .. _supportedAdminVersions]; + public List EndpointVersionOptions { get; } = _supportedApiVersions; public string DefaultVersion { get; set; } = "1"; @@ -36,7 +32,7 @@ public class CdrApiOptions { foreach (var supportedApi in this.EndpointVersionOptions.OrderByDescending(v => v.Path.Length)) { - var regEx = new System.Text.RegularExpressions.Regex(supportedApi.Path, System.Text.RegularExpressions.RegexOptions.IgnoreCase, TimeSpan.FromSeconds(2)); + var regEx = new System.Text.RegularExpressions.Regex(supportedApi.Path); if (regEx.IsMatch(path)) { return supportedApi; diff --git a/Source/CDR.Register.API.Infrastructure/Models/JsonWebKey.cs b/Source/CDR.Register.API.Infrastructure/Models/JsonWebKey.cs index 92fcf1e..182393a 100644 --- a/Source/CDR.Register.API.Infrastructure/Models/JsonWebKey.cs +++ b/Source/CDR.Register.API.Infrastructure/Models/JsonWebKey.cs @@ -1,41 +1,35 @@ -using Newtonsoft.Json; +using System; +using Newtonsoft.Json; namespace CDR.Register.API.Infrastructure.Models { public class JsonWebKey { - [JsonProperty("alg", NullValueHandling = NullValueHandling.Ignore)] - public string? Alg { get; set; } = null; + [JsonProperty("alg")] + public string Alg { get; set; } = string.Empty; - [JsonProperty("e", NullValueHandling = NullValueHandling.Ignore)] - public string? E { get; set; } = null; + [JsonProperty("e")] + public string E { get; set; } = string.Empty; [JsonProperty("key_ops")] - public string[]? Key_ops { get; set; } = null; + public string[] Key_ops { get; set; } = []; - [JsonProperty("kid", NullValueHandling = NullValueHandling.Ignore)] - public string? Kid { get; set; } = null; + [JsonProperty("kid")] + public string Kid { get; set; } = string.Empty; - [JsonProperty("kty", Required = Required.Always)] + [JsonProperty("kty")] public string Kty { get; set; } = string.Empty; - [JsonProperty("n", NullValueHandling = NullValueHandling.Ignore)] - public string? N { get; set; } = null; + [JsonProperty("n")] + public string N { get; set; } = string.Empty; - [JsonProperty("use", NullValueHandling = NullValueHandling.Ignore)] - public string? Use { get; set; } = null; + [JsonProperty("use")] + public string Use { get; set; } = string.Empty; - [JsonProperty("x5t", NullValueHandling = NullValueHandling.Ignore)] - public string? X5t { get; set; } = null; + [JsonProperty("x5t")] + public string X5t { get; set; } = string.Empty; [JsonProperty("x5c")] - public string[]? X5c { get; set; } = null; - - // ------------------------- - // Serialization controls - // ------------------------- - public bool ShouldSerializeKey_ops() => this.Key_ops is { Length: > 0 }; - - public bool ShouldSerializeX5c() => this.X5c is { Length: > 0 }; + public string[] X5c { get; set; } = []; } } diff --git a/Source/CDR.Register.API.Infrastructure/Services/DataRecipientStatusCheckService.cs b/Source/CDR.Register.API.Infrastructure/Services/DataRecipientStatusCheckService.cs index d9faff1..9c21282 100644 --- a/Source/CDR.Register.API.Infrastructure/Services/DataRecipientStatusCheckService.cs +++ b/Source/CDR.Register.API.Infrastructure/Services/DataRecipientStatusCheckService.cs @@ -26,7 +26,7 @@ public DataRecipientStatusCheckService(IRegisterDiscoveryRepository registerDisc public async Task ValidateSoftwareProductStatus(Guid softwareProductId) { // Get the latest data recipient details from the repository - var softwareProduct = await this._registerDiscoveryRepository.GetSoftwareProductId(softwareProductId); + var softwareProduct = await this._registerDiscoveryRepository.GetSoftwareProductIdAsync(softwareProductId); // Perform validations ResponseErrorList errorList = new ResponseErrorList(); diff --git a/Source/CDR.Register.API.Infrastructure/SwaggerFilters/IndustryParamsOperationFilter.cs b/Source/CDR.Register.API.Infrastructure/SwaggerFilters/IndustryParamsOperationFilter.cs deleted file mode 100644 index 369a0e1..0000000 --- a/Source/CDR.Register.API.Infrastructure/SwaggerFilters/IndustryParamsOperationFilter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Linq; -using System.Reflection; -using CDR.Register.Domain.Extensions; -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace CDR.Register.API.Infrastructure.SwaggerFilters -{ - public class IndustryParamsOperationFilter : IOperationFilter - { - public void Apply(OpenApiOperation operation, OperationFilterContext context) - { - foreach (var s in operation.Parameters.Where(o => o.Name == "industry")) - { - var checkIndustries = context.MethodInfo.GetCustomAttributes().SingleOrDefault(); - - if (checkIndustries != null) - { - var examples = checkIndustries.IndustryRestrictions.Select(x => new OpenApiString(EnumExtensions.GetDescription(x))); - - s.Schema.Enum = [..examples]; - } - } - } - } -} diff --git a/Source/CDR.Register.API.Infrastructure/SwaggerFilters/SetupApiVersionParamsOperationFilter.cs b/Source/CDR.Register.API.Infrastructure/SwaggerFilters/SetupApiVersionParamsOperationFilter.cs index 81fbbf6..508f3ce 100644 --- a/Source/CDR.Register.API.Infrastructure/SwaggerFilters/SetupApiVersionParamsOperationFilter.cs +++ b/Source/CDR.Register.API.Infrastructure/SwaggerFilters/SetupApiVersionParamsOperationFilter.cs @@ -1,11 +1,8 @@ using System.Linq; using CDR.Register.API.Infrastructure.Models; -using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; -using static CDR.Register.API.Infrastructure.Constants; namespace CDR.Register.API.Infrastructure.SwaggerFilters { @@ -22,34 +19,13 @@ public void Apply(OpenApiOperation operation, OperationFilterContext context) { var versionOption = this._options.GetApiEndpointVersionOption($"/{context.ApiDescription.RelativePath}"); - foreach (var s in operation.Parameters.Where(o => o.Name == Headers.X_V || o.Name == Headers.X_MIN_V)) + foreach (var s in operation.Parameters.Where(o => o.Name == "x-v" || o.Name == "x-min-v")) { s.Required = false; - var apiVersion = context.ApiDescription.GetApiVersion(); - - switch (s.Name) + if (versionOption != null && versionOption.IsXVHeaderMandatory && s.Name == "x-v") { - case Headers.X_V: - if (versionOption?.IsXVHeaderMandatory == true) - { - s.Required = true; - } - - if (apiVersion != null) - { - s.Example = new OpenApiString(apiVersion.MajorVersion.ToString()); - } - - break; - - case Headers.X_MIN_V: - if (versionOption != null) - { - s.Example = new OpenApiString(versionOption.CurrentMinVersion.ToString()); - } - - break; + s.Required = true; } } } diff --git a/Source/CDR.Register.API.Infrastructure/Versioning/ApiVersionErrorResponse.cs b/Source/CDR.Register.API.Infrastructure/Versioning/ApiVersionErrorResponse.cs new file mode 100644 index 0000000..640c461 --- /dev/null +++ b/Source/CDR.Register.API.Infrastructure/Versioning/ApiVersionErrorResponse.cs @@ -0,0 +1,50 @@ +using CDR.Register.Domain.Models; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Versioning; +using Microsoft.Extensions.Logging; + +namespace CDR.Register.API.Infrastructure.Versioning +{ + public class ApiVersionErrorResponse : DefaultErrorResponseProvider + { + private readonly ILogger _logger; + + public ApiVersionErrorResponse() + { + this._logger = new LoggerFactory().CreateLogger(); + } + + public override IActionResult CreateResponse(ErrorResponseContext context) + { + var errorList = new ResponseErrorList(); + int statusCode; + + // Determine what the return status code and message will be, default to 500 - Internal Server Error + if (context.Message.Contains(Domain.Constants.ErrorTitles.MissingVersion)) + { + errorList.AddInvalidXVMissingRequiredHeader(); + statusCode = StatusCodes.Status400BadRequest; + } + else if (context.Message.Contains(Domain.Constants.ErrorTitles.InvalidVersion)) + { + errorList.AddInvalidXVInvalidVersion(); + statusCode = StatusCodes.Status400BadRequest; + } + else if (context.Message.Contains(Domain.Constants.ErrorTitles.UnsupportedVersion)) + { + errorList.AddInvalidXVUnsupportedVersion(); + statusCode = StatusCodes.Status406NotAcceptable; + } + else + { + errorList.AddUnexpectedError(); + statusCode = StatusCodes.Status500InternalServerError; + } + + this._logger.LogError("Error detail {Detail}", errorList.Errors[0].Detail); + + return new ObjectResult(errorList) { StatusCode = statusCode }; + } + } +} diff --git a/Source/CDR.Register.API.Infrastructure/Versioning/CdrVersionReader.cs b/Source/CDR.Register.API.Infrastructure/Versioning/CdrVersionReader.cs index 9923660..d349259 100644 --- a/Source/CDR.Register.API.Infrastructure/Versioning/CdrVersionReader.cs +++ b/Source/CDR.Register.API.Infrastructure/Versioning/CdrVersionReader.cs @@ -1,9 +1,7 @@ -using System.Collections.Generic; -using Asp.Versioning; -using CDR.Register.API.Infrastructure.Models; +using CDR.Register.API.Infrastructure.Models; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Versioning; using Microsoft.Extensions.Primitives; -using static CDR.Register.API.Infrastructure.Constants; namespace CDR.Register.API.Infrastructure.Versioning { @@ -21,11 +19,11 @@ public CdrVersionReader(CdrApiOptions options) public void AddParameters(IApiVersionParameterDescriptionContext context) { - context.AddParameter(Headers.X_V, ApiVersionParameterLocation.Header); - context.AddParameter(Headers.X_MIN_V, ApiVersionParameterLocation.Header); + context.AddParameter("x-v", ApiVersionParameterLocation.Header); + context.AddParameter("x-min-v", ApiVersionParameterLocation.Header); } - public IReadOnlyList Read(HttpRequest request) + public string? Read(HttpRequest request) { var endpointOption = this._options.GetApiEndpointVersionOption(request.Path); @@ -36,34 +34,34 @@ public IReadOnlyList Read(HttpRequest request) } else if (!endpointOption.IsVersioned) { - return [this._options.DefaultVersion]; + return this._options.DefaultVersion; } // If x-min-v is passed in, we expect it to be a Positive Integer, the x-v value is parsed out of the header and will be validated by the Package itself // Refer to Standards here - https://consumerdatastandardsaustralia.github.io/standards/#http-headers // When there is error in x-min-v, we return custom String x-min-v '' this is then manipulated in ApiVersionErrorResponse for a user friendly error message. - if (!request.Headers.TryGetValue(Headers.X_V, out var xvValue) || string.IsNullOrWhiteSpace(xvValue)) + if (!request.Headers.TryGetValue("x-v", out var xvValue) || string.IsNullOrWhiteSpace(xvValue)) { if (endpointOption.IsXVHeaderMandatory) { - throw new MissingRequiredHeaderException(Headers.X_V); + return Domain.Constants.ErrorTitles.MissingVersion; } xvValue = endpointOption.CurrentMinVersion.ToString(); - request.Headers.Remove(Headers.X_V); // Added this to handle both the missing header (just add) and the header with a blank value (update) - request.Headers.Append(Headers.X_V, xvValue); + request.Headers.Remove("x-v"); // Added this to handle both the missing header (just add) and the header with a blank value (update) + request.Headers.Append("x-v", xvValue); } if (int.TryParse(xvValue, out int xvInt) && xvInt > 0) { - request.Headers.TryGetValue(Headers.X_MIN_V, out var xvMinValue); + request.Headers.TryGetValue("x-min-v", out var xvMinValue); xvValue = CalculateVersion(xvInt, xvMinValue, endpointOption); return xvValue; } - throw new InvalidVersionException(Headers.X_V); + return Domain.Constants.ErrorTitles.InvalidVersion; } private static string? CalculateVersion(int xvInt, string? xvMinString, CdrApiEndpointVersionOptions endpointOption) @@ -72,14 +70,14 @@ public IReadOnlyList Read(HttpRequest request) { if (!int.TryParse(xvMinString, out int xvMinInt) || xvMinInt < 1) { - throw new InvalidVersionException(Headers.X_MIN_V); + return Domain.Constants.ErrorTitles.InvalidVersion; } if (xvMinInt < xvInt) { if (xvMinInt > endpointOption.CurrentMaxVersion || xvInt < endpointOption.CurrentMinVersion) { - throw new UnsupportedVersionException(); + return Domain.Constants.ErrorTitles.UnsupportedVersion; } return xvInt > endpointOption.CurrentMaxVersion ? endpointOption.CurrentMaxVersion.ToString() : xvInt.ToString(); @@ -88,7 +86,7 @@ public IReadOnlyList Read(HttpRequest request) if (xvInt < endpointOption.CurrentMinVersion || xvInt > endpointOption.CurrentMaxVersion) { - throw new UnsupportedVersionException(); + return Domain.Constants.ErrorTitles.UnsupportedVersion; } return xvInt.ToString(); diff --git a/Source/CDR.Register.Admin.API/Business/AdminMappingProfile.cs b/Source/CDR.Register.Admin.API/Business/AdminMappingProfile.cs index 64774ac..08c85da 100644 --- a/Source/CDR.Register.Admin.API/Business/AdminMappingProfile.cs +++ b/Source/CDR.Register.Admin.API/Business/AdminMappingProfile.cs @@ -3,6 +3,7 @@ using CDR.Register.Admin.API.Business.Model; using CDR.Register.Domain.Entities; using CDR.Register.Repository.Enums; +using Microsoft.Extensions.Configuration; using DomainEntities = CDR.Register.Domain.Entities; namespace CDR.Register.Admin.API.Business @@ -11,32 +12,28 @@ public class AdminMappingProfile : Profile { public AdminMappingProfile() { - this.CreateMap() + this.CreateMap() .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source)) - .ForMember(dest => dest.DataRecipientBrands, source => source.MapFrom(source => source.DataRecipientBrands)) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.DataRecipientBrands, source => source.MapFrom(source => source.DataRecipientBrands)); - this.CreateMap() - .ForMember(dest => dest.AccreditationLevelId, source => source.MapFrom(source => source.AccreditationLevel)) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + this.CreateMap() + .ForMember(dest => dest.AccreditationLevelId, source => source.MapFrom(source => source.AccreditationLevel)); - this.CreateMap() + this.CreateMap() .ForMember(dest => dest.BrandStatus, source => source.MapFrom(source => source.Status)) - .ForMember(dest => dest.BrandId, source => source.MapFrom(source => source.DataRecipientBrandId)) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.BrandId, source => source.MapFrom(source => source.DataRecipientBrandId)); - this.CreateMap() + this.CreateMap() .ForMember(dest => dest.RedirectUri, source => source.MapFrom(src => src.RedirectUris != null ? string.Join(" ", src.RedirectUris) : string.Empty)) .ForMember(dest => dest.RedirectUris, opts => opts.Ignore()) // Ignore this as it is a computed property with no setter - .ForMember(dest => dest.Scope, opt => opt.MapFrom(src => src.Scope ?? string.Empty)) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Scope, opt => opt.MapFrom(src => src.Scope ?? string.Empty)); - this.CreateMap().MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + this.CreateMap(); // DH Brand Mappings - this.CreateMap().MaxDepth(Domain.Constants.MappingConstants.MaxDepth); - this.CreateMap().MaxDepth(Domain.Constants.MappingConstants.MaxDepth); - this.CreateMap().MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + this.CreateMap(); + this.CreateMap(); + this.CreateMap(); this.CreateMap() .ForMember(dest => dest.LegalEntityId, source => source.MapFrom(source => source.LegalEntityId)) @@ -50,15 +47,13 @@ public AdminMappingProfile() .ForMember(dest => dest.Arbn, source => source.MapFrom(source => source.Arbn)) .ForMember(dest => dest.AnzsicDivision, source => source.MapFrom(source => source.AnzsicDivision)) .ForMember(dest => dest.OrganisationType, source => source.MapFrom(source => source.OrganisationType)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.ToUpper())) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.ToUpper())); this.CreateMap() .ForMember(dest => dest.Industries, (IMemberConfigurationExpression> source) => source.MapFrom(source => source.Industries)) - .ForMember(dest => dest.Industry, source => source.MapFrom(source => source.Industries.Length > 0 ? source.Industries[0].ToLowerInvariant() : string.Empty)) + .ForMember(dest => dest.Industry, source => source.MapFrom(source => source.Industries.Length > 0 ? source.Industries[0] : string.Empty)) .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source == null ? null : source.LegalEntity)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.LegalEntity == null ? string.Empty : source.LegalEntity.Status.ToUpper())) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.LegalEntity == null ? string.Empty : source.LegalEntity.Status.ToUpper())); this.CreateMap() .ForMember(dest => dest.BrandId, source => source.MapFrom(source => source.DataHolderBrandId)) @@ -68,8 +63,7 @@ public AdminMappingProfile() .ForMember(dest => dest.IsActive, source => source.MapFrom(source => string.Compare(source.Status, BrandStatusType.Active.ToString(), true))) .ForMember(dest => dest.DataHolderAuthentications, source => source.MapFrom(source => new[] { source.AuthDetails })) .ForMember(dest => dest.DataHolderBrandServiceEndpoint, source => source.MapFrom(source => source.EndpointDetail)) - .ForMember(dest => dest.DataHolder, source => source.MapFrom(source => source)) - .MaxDepth(Domain.Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.DataHolder, source => source.MapFrom(source => source)); } } } diff --git a/Source/CDR.Register.Admin.API/Business/Model/DataHolderBrandModel.cs b/Source/CDR.Register.Admin.API/Business/Model/DataHolderBrandModel.cs index 729dd58..18e7370 100644 --- a/Source/CDR.Register.Admin.API/Business/Model/DataHolderBrandModel.cs +++ b/Source/CDR.Register.Admin.API/Business/Model/DataHolderBrandModel.cs @@ -12,8 +12,6 @@ public class DataHolderBrandModel public string BrandName { get; set; } = string.Empty; - public string BrandGroup { get; set; } = string.Empty; - public string[] Industries { get; set; } = []; public string LogoUri { get; set; } = string.Empty; diff --git a/Source/CDR.Register.Admin.API/Business/Model/DataHolderEndpointModel.cs b/Source/CDR.Register.Admin.API/Business/Model/DataHolderEndpointModel.cs index 5087ed5..789f38e 100644 --- a/Source/CDR.Register.Admin.API/Business/Model/DataHolderEndpointModel.cs +++ b/Source/CDR.Register.Admin.API/Business/Model/DataHolderEndpointModel.cs @@ -6,8 +6,6 @@ public class DataHolderEndpointModel public string PublicBaseUri { get; set; } = string.Empty; - public string ProductBaseUri { get; set; } = string.Empty; - public string ResourceBaseUri { get; set; } = string.Empty; public string InfosecBaseUri { get; set; } = string.Empty; diff --git a/Source/CDR.Register.Admin.API/Business/Validators/DataHolderBrandValidator.cs b/Source/CDR.Register.Admin.API/Business/Validators/DataHolderBrandValidator.cs index c06e68e..066c095 100644 --- a/Source/CDR.Register.Admin.API/Business/Validators/DataHolderBrandValidator.cs +++ b/Source/CDR.Register.Admin.API/Business/Validators/DataHolderBrandValidator.cs @@ -1,7 +1,6 @@ using System; using CDR.Register.Admin.API.Business.Model; using CDR.Register.Domain.Enums; -using CDR.Register.Domain.Extensions; using FluentValidation; using static CDR.Register.Domain.Constants; @@ -22,7 +21,7 @@ public DataHolderBrandValidator() this.RuleFor(x => x.AuthDetails).Must(x => x != null).WithErrorCode(ErrorCodes.Cds.MissingRequiredField).WithMessage(ErrorTitles.MissingRequiredField); // Enum Validations - this.RuleForEach(x => x.Industries).Must(x => EnumExtensions.TryParseFromDescription(x, out Industry _)).WithErrorCode(ErrorCodes.Cds.InvalidField).WithMessage(ErrorTitles.InvalidField); + this.RuleForEach(x => x.Industries).Must(x => Enum.TryParse(x, true, out Industry _)).WithErrorCode(ErrorCodes.Cds.InvalidField).WithMessage(ErrorTitles.InvalidField); this.RuleFor(x => x.Status).Must(x => Enum.TryParse(x, true, out DhParticipationStatus _)).WithErrorCode(ErrorCodes.Cds.InvalidField).WithMessage(ErrorTitles.InvalidField); // Length Validations diff --git a/Source/CDR.Register.Admin.API/Controllers/AdminController.cs b/Source/CDR.Register.Admin.API/Controllers/AdminController.cs index 52dfd9f..be0a655 100644 --- a/Source/CDR.Register.Admin.API/Controllers/AdminController.cs +++ b/Source/CDR.Register.Admin.API/Controllers/AdminController.cs @@ -2,7 +2,6 @@ using System.IO; using System.Text.Json; using System.Threading.Tasks; -using Asp.Versioning; using AutoMapper; using CDR.Register.Admin.API.Business.Model; using CDR.Register.Admin.API.Business.Validators; diff --git a/Source/CDR.Register.Admin.API/Controllers/LoopbackController.cs b/Source/CDR.Register.Admin.API/Controllers/LoopbackController.cs index 3584e0e..38f58e7 100644 --- a/Source/CDR.Register.Admin.API/Controllers/LoopbackController.cs +++ b/Source/CDR.Register.Admin.API/Controllers/LoopbackController.cs @@ -3,7 +3,6 @@ using System.Security.Claims; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; -using Asp.Versioning; using CDR.Register.API.Infrastructure.Filters; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; diff --git a/Source/CDR.Register.Admin.API/Data/seed-data.Container.json b/Source/CDR.Register.Admin.API/Data/seed-data.Container.json index ee809b7..3cfb74d 100644 --- a/Source/CDR.Register.Admin.API/Data/seed-data.Container.json +++ b/Source/CDR.Register.Admin.API/Data/seed-data.Container.json @@ -24,7 +24,6 @@ { "brandId": "cfcaf0df-401b-47f2-98af-94787289eca8", "brandName": "Mock Data Holder (Energy)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://smarterenergy/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T10:00:00", @@ -37,7 +36,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8100", - "productBaseUri": "https://host.docker.internal:8100", "resourceBaseUri": "https://host.docker.internal:8102", "infoSecBaseUri": "https://host.docker.internal:8101", "extensionBaseUri": "", @@ -47,7 +45,6 @@ { "brandId": "6859d9f9-9cf9-486d-bc85-5d43a7e116de", "brandName": "Cut Price Energy -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://cutpriceenergy/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T11:00:00", @@ -60,7 +57,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8100", - "productBaseUri": "https://localhost:8100", "resourceBaseUri": "https://localhost:8102", "infoSecBaseUri": "https://localhost:8101", "extensionBaseUri": "", @@ -95,7 +91,6 @@ { "brandId": "d50b74cf-e992-42fd-86d4-582ac9d72dbb", "brandName": "Mock Energy Tool", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T09:00:00", @@ -152,7 +147,6 @@ { "brandId": "804fc2fb-18a7-4235-9a49-2af393d18bc7", "brandName": "Mock Data Holder (Banking)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://bank1/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -165,7 +159,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -176,54 +169,6 @@ } ] }, - { - "legalEntityId": "07568be9-ed72-4268-8a8f-83cf60608dff", - "legalEntityName": "Non Bank Legal Entity 1", - "logoUri": "https://non-bank/logo.png", - "registrationNumber": "48219", - "registrationDate": "2021-12-01T10:00:00", - "registeredCountry": "AUSTRALIA", - "abn": "58392017462", - "acn": "473915802", - "arbn": null, - "anzsicDivision": "6221", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 3, - "statusId": 1, - "brands": [ - { - "brandId": "7f3c2a41-9b8e-4e6c-9df1-12c4b8f0a6e3", - "brandName": "Mock Data Holder (Non-Bank Lending)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://non-bank1/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.non.bank1/jwks" - } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://host.docker.internal:8200", - "productBaseUri": "https://host.docker.internal:8200", - "resourceBaseUri": "https://host.docker.internal:8202", - "infoSecBaseUri": "https://host.docker.internal:8201", - "extensionBaseUri": "", - "websiteUri": "https://non-bank1/" - } - } - ] - } - ] - }, { "legalEntityId": "18b75a76-5821-4c9e-b465-4709291cf0f4", "legalEntityName": "Mock Software Company", @@ -248,7 +193,6 @@ { "brandId": "ffb1c8ba-279e-44d8-96f0-1bc34a6b436f", "brandName": "Mock Finance Tools", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -305,7 +249,6 @@ { "brandId": "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55", "brandName": "New Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://newbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -318,7 +261,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": null, // intentionally not provided "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -353,7 +295,6 @@ { "brandId": "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d", "brandName": "Sun -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sunbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -366,7 +307,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -376,7 +316,6 @@ { "brandId": "a2cd9cd1-e3c7-493b-86d8-f9f319ca0732", "brandName": "Brighter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://brighterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-01-01T11:58:00", @@ -389,7 +328,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -424,7 +362,6 @@ { "brandId": "62f4a113-defe-4f99-bd9c-625277bc0e36", "brandName": "mildBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mildbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-11T11:58:00", @@ -437,7 +374,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -447,7 +383,6 @@ { "brandId": "81d3d5cc-cdb6-4253-a78b-b17155dde7fd", "brandName": "extrahotBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://extrahotbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-16T11:58:00", @@ -460,7 +395,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.extrahotbank", - "productBaseUri": "https://publicapi.extrahotbank", "resourceBaseUri": "https://api.extrahotbank", "infoSecBaseUri": "https://idp.extrahotbank", "extensionBaseUri": "", @@ -495,7 +429,6 @@ { "brandId": "9928cf0f-70c7-40ea-b7ad-cad190232f68", "brandName": "Ive Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://ivebank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-03T11:58:00", @@ -508,7 +441,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -543,7 +475,6 @@ { "brandId": "7c97c3b5-fe64-4b35-8ae0-17fa5d4aa0a8", "brandName": "Eva Bank corp -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://evabankcorp/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-26T11:58:00", @@ -556,7 +487,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -591,7 +521,6 @@ { "brandId": "a5252bde-d1a6-413f-8f53-f7e2f6ab3f77", "brandName": "Royal Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://royalbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -604,7 +533,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -639,7 +567,6 @@ { "brandId": "c1ff7731-5843-4384-88d8-6062afde7c5b", "brandName": "central bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://centralbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-03-06T11:58:00", @@ -652,7 +579,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -687,7 +613,6 @@ { "brandId": "2192a459-5ef5-4493-afe1-56c3d03fc1ba", "brandName": "Fox Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://foxbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-21T11:58:00", @@ -700,7 +625,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -735,7 +659,6 @@ { "brandId": "8aa8e9a6-1dc7-4428-baea-d1f4533428b9", "brandName": "Grand Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://grandbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-29T11:58:00", @@ -748,7 +671,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -783,7 +705,6 @@ { "brandId": "85168ace-9211-45e3-bb75-f85c54e66f10", "brandName": "Kiss Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://kissbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -796,7 +717,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -831,7 +751,6 @@ { "brandId": "bb03be60-5c46-422e-a27e-aefa0015078d", "brandName": "Luna -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://lunabank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -844,7 +763,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -879,7 +797,6 @@ { "brandId": "52d23611-4493-4a21-9095-44ae9eb85841", "brandName": "Mu Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mubank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -892,7 +809,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -927,7 +843,6 @@ { "brandId": "557f42e8-4e00-4b03-a9c9-d97796b6418b", "brandName": "Noon Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://noonbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -940,7 +855,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -975,7 +889,6 @@ { "brandId": "a5e45351-d13c-4690-93d1-3da515e71a92", "brandName": "Oppo Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://oppobank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -988,7 +901,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1023,7 +935,6 @@ { "brandId": "97e53112-73b2-482a-b352-39d389d67916", "brandName": "Pepper Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://pepperbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1036,7 +947,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1071,7 +981,6 @@ { "brandId": "895e54c5-93e0-405f-8072-0a9871bac8b5", "brandName": "QQ Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://qqbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1084,7 +993,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1119,7 +1027,6 @@ { "brandId": "975375f7-2bd9-44b5-a188-43d65ca8eaae", "brandName": "Run Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://runbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1132,7 +1039,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1167,7 +1073,6 @@ { "brandId": "b648f694-0dee-4f5e-bd2c-9837ac08fb7b", "brandName": "SaS Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sasbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1180,7 +1085,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1215,7 +1119,6 @@ { "brandId": "f8bce914-ac8d-436a-b265-19baca6d1df2", "brandName": "TnT Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://tntbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1228,7 +1131,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1263,7 +1165,6 @@ { "brandId": "e748eadf-4aa4-4e2f-b3da-fb4a9d511994", "brandName": "Bank Brand 2 -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://bank2/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1276,7 +1177,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1311,7 +1211,6 @@ { "brandId": "9f8df3e2-6866-42af-91d4-5faa3204f0b8", "brandName": "Smarter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://smarterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1324,7 +1223,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1334,7 +1232,6 @@ { "brandId": "81d3d5cb-cdb6-4253-a78b-b17155dde7fd", "brandName": "MyBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1347,7 +1244,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.mybank", - "productBaseUri": "https://publicapi.mybank", "resourceBaseUri": "https://api.mybank", "infoSecBaseUri": "https://idp.mybank", "extensionBaseUri": "", @@ -1382,7 +1278,6 @@ { "brandId": "cf217aba-e00d-48d5-9c3d-03af0b91cb80", "brandName": "Hall Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallardbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-19T11:58:00", @@ -1395,7 +1290,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1405,7 +1299,6 @@ { "brandId": "920f296d-5f2f-49de-876c-15a4aa1b4a79", "brandName": "Hallway -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallwaybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1418,7 +1311,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.hallwaybank", - "productBaseUri": "https://publicapi.hallwaybank", "resourceBaseUri": "https://api.hallwaybank", "infoSecBaseUri": "https://idp.hallwaybank", "extensionBaseUri": "", @@ -1453,7 +1345,6 @@ { "brandId": "bc144967-d6f8-47a6-8590-07caf522141b", "brandName": "Jobs Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jobsbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1466,7 +1357,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://host.docker.internal:8000", - "productBaseUri": "https://host.docker.internal:8000", "resourceBaseUri": "https://host.docker.internal:8002", "infoSecBaseUri": "https://host.docker.internal:8001", "extensionBaseUri": "", @@ -1476,7 +1366,6 @@ { "brandId": "7b47ecf8-a991-4dd3-adef-b89564005e8e", "brandName": "offer bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://offerbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1489,7 +1378,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.offerbank", - "productBaseUri": "https://publicapi.offerbank", "resourceBaseUri": "https://api.offerbank", "infoSecBaseUri": "https://idp.offerbank", "extensionBaseUri": "", @@ -1499,7 +1387,6 @@ { "brandId": "c3176245-4258-4383-b945-cd2f7c828d3c", "brandName": "J bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1512,7 +1399,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.jbank", - "productBaseUri": "https://publicapi.jbank", "resourceBaseUri": "https://api.jbank", "infoSecBaseUri": "https://idp.jbank", "extensionBaseUri": "", @@ -1547,7 +1433,6 @@ { "brandId": "20c0864b-ceef-4de0-8944-eb0962f825eb", "brandName": "Finance X", - "brandGroup": null, "logoUri": "https://fintechx/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1670,7 +1555,6 @@ { "brandId": "fe123396-4eba-4518-aade-b245ceea78af", "brandName": "XRay Financial", - "brandGroup": null, "logoUri": "https://xraysoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1727,7 +1611,6 @@ { "brandId": "8fe9791a-e4a8-4104-b1cb-e0df41189520", "brandName": "WOW", - "brandGroup": null, "logoUri": "https://wowsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-02-06T11:58:00", @@ -1784,7 +1667,6 @@ { "brandId": "a7171ba3-fd05-456f-a859-be4e1cbcc17d", "brandName": "OLM Software", - "brandGroup": null, "logoUri": "https://olmsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1841,7 +1723,6 @@ { "brandId": "8a3441aa-1242-493a-b466-dcbfffe5a441", "brandName": "xlogical", - "brandGroup": null, "logoUri": "https://xlogical/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1898,7 +1779,6 @@ { "brandId": "46b33515-b4a5-4b1c-b5b4-25654d675be6", "brandName": "HotFinTech", - "brandGroup": null, "logoUri": "https://hotfintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -1977,7 +1857,6 @@ { "brandId": "ebbcc2f2-817e-42b8-8a28-cd45902159e0", "brandName": "ZeroFintech", - "brandGroup": null, "logoUri": "https://zerofintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -2056,7 +1935,6 @@ { "brandId": "f3f0c40b-9df8-491a-af1d-81cb9ab5f021", "brandName": "YoYo", - "brandGroup": null, "logoUri": "https://yoyosoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", diff --git a/Source/CDR.Register.Admin.API/Data/seed-data.Development.json b/Source/CDR.Register.Admin.API/Data/seed-data.Development.json index 3604a9f..6c2d45b 100644 --- a/Source/CDR.Register.Admin.API/Data/seed-data.Development.json +++ b/Source/CDR.Register.Admin.API/Data/seed-data.Development.json @@ -24,7 +24,6 @@ { "brandId": "cfcaf0df-401b-47f2-98af-94787289eca8", "brandName": "Mock Data Holder (Energy)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://smarterenergy/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T10:00:00", @@ -37,7 +36,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8100", - "productBaseUri": "https://localhost:8100", "resourceBaseUri": "https://localhost:8102", "infoSecBaseUri": "https://localhost:8101", "extensionBaseUri": "", @@ -47,7 +45,6 @@ { "brandId": "6859d9f9-9cf9-486d-bc85-5d43a7e116de", "brandName": "Cut Price Energy -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://cutpriceenergy/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T11:00:00", @@ -60,7 +57,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8100", - "productBaseUri": "https://localhost:8100", "resourceBaseUri": "https://localhost:8102", "infoSecBaseUri": "https://localhost:8101", "extensionBaseUri": "", @@ -95,7 +91,6 @@ { "brandId": "d50b74cf-e992-42fd-86d4-582ac9d72dbb", "brandName": "Mock Energy Tool", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T09:00:00", @@ -152,7 +147,6 @@ { "brandId": "804fc2fb-18a7-4235-9a49-2af393d18bc7", "brandName": "Mock Data Holder (Banking)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://bank1/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -165,7 +159,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -176,54 +169,6 @@ } ] }, - { - "legalEntityId": "07568be9-ed72-4268-8a8f-83cf60608dff", - "legalEntityName": "Non Bank Legal Entity 1", - "logoUri": "https://non-bank/logo.png", - "registrationNumber": "48219", - "registrationDate": "2021-12-01T10:00:00", - "registeredCountry": "AUSTRALIA", - "abn": "58392017462", - "acn": "473915802", - "arbn": null, - "anzsicDivision": "6221", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 3, - "statusId": 1, - "brands": [ - { - "brandId": "7f3c2a41-9b8e-4e6c-9df1-12c4b8f0a6e3", - "brandName": "Mock Data Holder (Non-Bank Lending)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://non-bank1/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.non.bank1/jwks" - } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://localhost:8200", - "productBaseUri": "https://localhost:8200", - "resourceBaseUri": "https://localhost:8202", - "infoSecBaseUri": "https://localhost:8201", - "extensionBaseUri": "", - "websiteUri": "https://non-bank1/" - } - } - ] - } - ] - }, { "legalEntityId": "18b75a76-5821-4c9e-b465-4709291cf0f4", "legalEntityName": "Mock Software Company", @@ -248,7 +193,6 @@ { "brandId": "ffb1c8ba-279e-44d8-96f0-1bc34a6b436f", "brandName": "Mock Finance Tools", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -305,7 +249,6 @@ { "brandId": "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55", "brandName": "New Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://newbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -318,7 +261,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": null, // intentionally not provided "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -353,7 +295,6 @@ { "brandId": "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d", "brandName": "Sun -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sunbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -366,7 +307,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -376,7 +316,6 @@ { "brandId": "a2cd9cd1-e3c7-493b-86d8-f9f319ca0732", "brandName": "Brighter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://brighterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-01-01T11:58:00", @@ -389,7 +328,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -424,7 +362,6 @@ { "brandId": "62f4a113-defe-4f99-bd9c-625277bc0e36", "brandName": "mildBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mildbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-11T11:58:00", @@ -437,7 +374,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -447,7 +383,6 @@ { "brandId": "81d3d5cc-cdb6-4253-a78b-b17155dde7fd", "brandName": "extrahotBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://extrahotbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-16T11:58:00", @@ -460,7 +395,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.extrahotbank", - "productBaseUri": "https://publicapi.extrahotbank", "resourceBaseUri": "https://api.extrahotbank", "infoSecBaseUri": "https://idp.extrahotbank", "extensionBaseUri": "", @@ -495,7 +429,6 @@ { "brandId": "9928cf0f-70c7-40ea-b7ad-cad190232f68", "brandName": "Ive Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://ivebank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-03T11:58:00", @@ -508,7 +441,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -543,7 +475,6 @@ { "brandId": "7c97c3b5-fe64-4b35-8ae0-17fa5d4aa0a8", "brandName": "Eva Bank corp -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://evabankcorp/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-26T11:58:00", @@ -556,7 +487,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -591,7 +521,6 @@ { "brandId": "a5252bde-d1a6-413f-8f53-f7e2f6ab3f77", "brandName": "Royal Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://royalbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -604,7 +533,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -639,7 +567,6 @@ { "brandId": "c1ff7731-5843-4384-88d8-6062afde7c5b", "brandName": "central bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://centralbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-03-06T11:58:00", @@ -652,7 +579,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -687,7 +613,6 @@ { "brandId": "2192a459-5ef5-4493-afe1-56c3d03fc1ba", "brandName": "Fox Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://foxbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-21T11:58:00", @@ -700,7 +625,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -735,7 +659,6 @@ { "brandId": "8aa8e9a6-1dc7-4428-baea-d1f4533428b9", "brandName": "Grand Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://grandbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-29T11:58:00", @@ -748,7 +671,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -783,7 +705,6 @@ { "brandId": "85168ace-9211-45e3-bb75-f85c54e66f10", "brandName": "Kiss Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://kissbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -796,7 +717,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -831,7 +751,6 @@ { "brandId": "bb03be60-5c46-422e-a27e-aefa0015078d", "brandName": "Luna -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://lunabank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -844,7 +763,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -879,7 +797,6 @@ { "brandId": "52d23611-4493-4a21-9095-44ae9eb85841", "brandName": "Mu Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mubank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -892,7 +809,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -927,7 +843,6 @@ { "brandId": "557f42e8-4e00-4b03-a9c9-d97796b6418b", "brandName": "Noon Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://noonbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -940,7 +855,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -975,7 +889,6 @@ { "brandId": "a5e45351-d13c-4690-93d1-3da515e71a92", "brandName": "Oppo Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://oppobank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -988,7 +901,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1023,7 +935,6 @@ { "brandId": "97e53112-73b2-482a-b352-39d389d67916", "brandName": "Pepper Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://pepperbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1036,7 +947,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1071,7 +981,6 @@ { "brandId": "895e54c5-93e0-405f-8072-0a9871bac8b5", "brandName": "QQ Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://qqbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1084,7 +993,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1119,7 +1027,6 @@ { "brandId": "975375f7-2bd9-44b5-a188-43d65ca8eaae", "brandName": "Run Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://runbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1132,7 +1039,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1167,7 +1073,6 @@ { "brandId": "b648f694-0dee-4f5e-bd2c-9837ac08fb7b", "brandName": "SaS Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sasbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1180,7 +1085,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1215,7 +1119,6 @@ { "brandId": "f8bce914-ac8d-436a-b265-19baca6d1df2", "brandName": "TnT Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://tntbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1228,7 +1131,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1263,7 +1165,6 @@ { "brandId": "e748eadf-4aa4-4e2f-b3da-fb4a9d511994", "brandName": "Bank Brand 2 -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://bank2/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1276,7 +1177,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1311,7 +1211,6 @@ { "brandId": "9f8df3e2-6866-42af-91d4-5faa3204f0b8", "brandName": "Smarter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://smarterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1324,7 +1223,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1334,7 +1232,6 @@ { "brandId": "81d3d5cb-cdb6-4253-a78b-b17155dde7fd", "brandName": "MyBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1347,7 +1244,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.mybank", - "productBaseUri": "https://publicapi.mybank", "resourceBaseUri": "https://api.mybank", "infoSecBaseUri": "https://idp.mybank", "extensionBaseUri": "", @@ -1382,7 +1278,6 @@ { "brandId": "cf217aba-e00d-48d5-9c3d-03af0b91cb80", "brandName": "Hall Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallardbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-19T11:58:00", @@ -1395,7 +1290,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1405,7 +1299,6 @@ { "brandId": "920f296d-5f2f-49de-876c-15a4aa1b4a79", "brandName": "Hallway -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallwaybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1418,7 +1311,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.hallwaybank", - "productBaseUri": "https://publicapi.hallwaybank", "resourceBaseUri": "https://api.hallwaybank", "infoSecBaseUri": "https://idp.hallwaybank", "extensionBaseUri": "", @@ -1453,7 +1345,6 @@ { "brandId": "bc144967-d6f8-47a6-8590-07caf522141b", "brandName": "Jobs Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jobsbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1466,7 +1357,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://localhost:8000", - "productBaseUri": "https://localhost:8000", "resourceBaseUri": "https://localhost:8002", "infoSecBaseUri": "https://localhost:8001", "extensionBaseUri": "", @@ -1476,7 +1366,6 @@ { "brandId": "7b47ecf8-a991-4dd3-adef-b89564005e8e", "brandName": "offer bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://offerbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1489,7 +1378,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.offerbank", - "productBaseUri": "https://publicapi.offerbank", "resourceBaseUri": "https://api.offerbank", "infoSecBaseUri": "https://idp.offerbank", "extensionBaseUri": "", @@ -1499,7 +1387,6 @@ { "brandId": "c3176245-4258-4383-b945-cd2f7c828d3c", "brandName": "J bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1512,7 +1399,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.jbank", - "productBaseUri": "https://publicapi.jbank", "resourceBaseUri": "https://api.jbank", "infoSecBaseUri": "https://idp.jbank", "extensionBaseUri": "", @@ -1547,7 +1433,6 @@ { "brandId": "20c0864b-ceef-4de0-8944-eb0962f825eb", "brandName": "Finance X", - "brandGroup": null, "logoUri": "https://fintechx/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1670,7 +1555,6 @@ { "brandId": "fe123396-4eba-4518-aade-b245ceea78af", "brandName": "XRay Financial", - "brandGroup": null, "logoUri": "https://xraysoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1727,7 +1611,6 @@ { "brandId": "8fe9791a-e4a8-4104-b1cb-e0df41189520", "brandName": "WOW", - "brandGroup": null, "logoUri": "https://wowsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-02-06T11:58:00", @@ -1784,7 +1667,6 @@ { "brandId": "a7171ba3-fd05-456f-a859-be4e1cbcc17d", "brandName": "OLM Software", - "brandGroup": null, "logoUri": "https://olmsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1841,7 +1723,6 @@ { "brandId": "8a3441aa-1242-493a-b466-dcbfffe5a441", "brandName": "xlogical", - "brandGroup": null, "logoUri": "https://xlogical/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1898,7 +1779,6 @@ { "brandId": "46b33515-b4a5-4b1c-b5b4-25654d675be6", "brandName": "HotFinTech", - "brandGroup": null, "logoUri": "https://hotfintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -1977,7 +1857,6 @@ { "brandId": "ebbcc2f2-817e-42b8-8a28-cd45902159e0", "brandName": "ZeroFintech", - "brandGroup": null, "logoUri": "https://zerofintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -2056,7 +1935,6 @@ { "brandId": "f3f0c40b-9df8-491a-af1d-81cb9ab5f021", "brandName": "YoYo", - "brandGroup": null, "logoUri": "https://yoyosoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -2113,7 +1991,6 @@ { "brandId": "2dda1b75-aa5e-4ff3-abff-af0863cf9ffc", "brandName": "Another Energy Tool", - "brandGroup": null, "logoUri": "https://anotherenergytool/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T09:00:00", diff --git a/Source/CDR.Register.Admin.API/Data/seed-data.Release.json b/Source/CDR.Register.Admin.API/Data/seed-data.Release.json index 2a986f2..a915524 100644 --- a/Source/CDR.Register.Admin.API/Data/seed-data.Release.json +++ b/Source/CDR.Register.Admin.API/Data/seed-data.Release.json @@ -24,7 +24,6 @@ { "brandId": "cfcaf0df-401b-47f2-98af-94787289eca8", "brandName": "Mock Data Holder (Energy)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://smarterenergy/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T10:00:00", @@ -37,7 +36,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://mock-data-holder-energy:8100", - "productBaseUri": "https://mock-data-holder-energy:8100", "resourceBaseUri": "https://mock-data-holder-energy:8102", "infoSecBaseUri": "https://mock-data-holder-energy:8101", "extensionBaseUri": "", @@ -47,7 +45,6 @@ { "brandId": "6859d9f9-9cf9-486d-bc85-5d43a7e116de", "brandName": "Cut Price Energy -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://cutpriceenergy/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T11:00:00", @@ -60,7 +57,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://api.cutpriceenergy:8100", - "productBaseUri": "https://api.cutpriceenergy:8100", "resourceBaseUri": "https://api.cutpriceenergy:8102", "infoSecBaseUri": "https://api.cutpriceenergy:8101", "extensionBaseUri": "", @@ -95,7 +91,6 @@ { "brandId": "d50b74cf-e992-42fd-86d4-582ac9d72dbb", "brandName": "Mock Energy Tool", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-12-01T09:00:00", @@ -152,7 +147,6 @@ { "brandId": "804fc2fb-18a7-4235-9a49-2af393d18bc7", "brandName": "Mock Data Holder (Banking)", - "brandGroup": "CDR Mock Brands", "logoUri": "https://bank1/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -165,7 +159,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://mock-data-holder:8000", - "productBaseUri": "https://mock-data-holder:8000", "resourceBaseUri": "https://mock-data-holder:8002", "infoSecBaseUri": "https://mock-data-holder:8001", "extensionBaseUri": "", @@ -176,54 +169,6 @@ } ] }, - { - "legalEntityId": "07568be9-ed72-4268-8a8f-83cf60608dff", - "legalEntityName": "Non Bank Legal Entity 1", - "logoUri": "https://non-bank/logo.png", - "registrationNumber": "48219", - "registrationDate": "2021-12-01T10:00:00", - "registeredCountry": "AUSTRALIA", - "abn": "58392017462", - "acn": "473915802", - "arbn": null, - "anzsicDivision": "6221", - "organisationTypeId": 2, - "legalEntityStatusId": 1, - "accreditationNumber": null, - "accreditationLevelId": null, - "participations": [ - { - "participationTypeId": 1, - "industryId": 3, - "statusId": 1, - "brands": [ - { - "brandId": "7f3c2a41-9b8e-4e6c-9df1-12c4b8f0a6e3", - "brandName": "Mock Data Holder (Non-Bank Lending)", - "brandGroup": "CDR Mock Brands", - "logoUri": "https://non-bank1/img/logo.png", - "brandStatusId": 1, - "lastUpdated": "2021-04-06T11:58:00", - "authDetails": [ - { - "registerUTypeId": 1, - "jwksEndpoint": "https://idp.non.bank1/jwks" - } - ], - "endpoint": { - "version": 1, - "publicBaseUri": "https://mock-data-holder:8200", - "productBaseUri": "https://mock-data-holder:8200", - "resourceBaseUri": "https://mock-data-holder:8202", - "infoSecBaseUri": "https://mock-data-holder:8201", - "extensionBaseUri": "", - "websiteUri": "https://non-bank1/" - } - } - ] - } - ] - }, { "legalEntityId": "18b75a76-5821-4c9e-b465-4709291cf0f4", "legalEntityName": "Mock Software Company", @@ -248,7 +193,6 @@ { "brandId": "ffb1c8ba-279e-44d8-96f0-1bc34a6b436f", "brandName": "Mock Finance Tools", - "brandGroup": null, "logoUri": "https://mocksoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -305,7 +249,6 @@ { "brandId": "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55", "brandName": "New Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://newbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -318,7 +261,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.newbank", - "productBaseUri": null, // intentionally not provided "resourceBaseUri": "https://api.newbank", "infoSecBaseUri": "https://idp.newbank", "extensionBaseUri": "", @@ -353,7 +295,6 @@ { "brandId": "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d", "brandName": "Sun -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sunbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -366,7 +307,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.sunbank", - "productBaseUri": "https://publicapi.sunbank", "resourceBaseUri": "https://api.sunbank", "infoSecBaseUri": "https://idp.sunbank", "extensionBaseUri": "", @@ -376,7 +316,6 @@ { "brandId": "a2cd9cd1-e3c7-493b-86d8-f9f319ca0732", "brandName": "Brighter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://brighterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-01-01T11:58:00", @@ -389,7 +328,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.brighterbank", - "productBaseUri": "https://publicapi.brighterbank", "resourceBaseUri": "https://api.brighterbank", "infoSecBaseUri": "https://idp.brighterbank", "extensionBaseUri": "", @@ -424,7 +362,6 @@ { "brandId": "62f4a113-defe-4f99-bd9c-625277bc0e36", "brandName": "mildBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mildbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-11T11:58:00", @@ -437,7 +374,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.mildbank", - "productBaseUri": "https://publicapi.mildbank", "resourceBaseUri": "https://api.mildbank", "infoSecBaseUri": "https://idp.mildbank", "extensionBaseUri": "", @@ -447,7 +383,6 @@ { "brandId": "81d3d5cc-cdb6-4253-a78b-b17155dde7fd", "brandName": "extrahotBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://extrahotbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-16T11:58:00", @@ -460,7 +395,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.extrahotbank", - "productBaseUri": "https://publicapi.extrahotbank", "resourceBaseUri": "https://api.extrahotbank", "infoSecBaseUri": "https://idp.extrahotbank", "extensionBaseUri": "", @@ -495,7 +429,6 @@ { "brandId": "9928cf0f-70c7-40ea-b7ad-cad190232f68", "brandName": "Ive Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://ivebank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-03T11:58:00", @@ -508,7 +441,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.ivebank", - "productBaseUri": "https://publicapi.ivebank", "resourceBaseUri": "https://api.ivebank", "infoSecBaseUri": "https://idp.ivebank", "extensionBaseUri": "", @@ -543,7 +475,6 @@ { "brandId": "7c97c3b5-fe64-4b35-8ae0-17fa5d4aa0a8", "brandName": "Eva Bank corp -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://evabankcorp/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-26T11:58:00", @@ -556,7 +487,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.evabank", - "productBaseUri": "https://publicapi.evabank", "resourceBaseUri": "https://api.evabank", "infoSecBaseUri": "https://idp.evabank", "extensionBaseUri": "", @@ -591,7 +521,6 @@ { "brandId": "a5252bde-d1a6-413f-8f53-f7e2f6ab3f77", "brandName": "Royal Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://royalbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-01T11:58:00", @@ -604,7 +533,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.royalbank", - "productBaseUri": "https://publicapi.royalbank", "resourceBaseUri": "https://api.royalbank", "infoSecBaseUri": "https://idp.royalbank", "extensionBaseUri": "", @@ -639,7 +567,6 @@ { "brandId": "c1ff7731-5843-4384-88d8-6062afde7c5b", "brandName": "central bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://centralbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-03-06T11:58:00", @@ -652,7 +579,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.centralbank", - "productBaseUri": "https://publicapi.centralbank", "resourceBaseUri": "https://api.centralbank", "infoSecBaseUri": "https://idp.centralbank", "extensionBaseUri": "", @@ -687,7 +613,6 @@ { "brandId": "2192a459-5ef5-4493-afe1-56c3d03fc1ba", "brandName": "Fox Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://foxbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-21T11:58:00", @@ -700,7 +625,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.foxbank", - "productBaseUri": "https://publicapi.foxbank", "resourceBaseUri": "https://api.foxbank", "infoSecBaseUri": "https://idp.foxbank", "extensionBaseUri": "", @@ -735,7 +659,6 @@ { "brandId": "8aa8e9a6-1dc7-4428-baea-d1f4533428b9", "brandName": "Grand Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://grandbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-29T11:58:00", @@ -748,7 +671,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.grandbank", - "productBaseUri": "https://publicapi.grandbank", "resourceBaseUri": "https://api.grandbank", "infoSecBaseUri": "https://idp.grandbank", "extensionBaseUri": "", @@ -783,7 +705,6 @@ { "brandId": "85168ace-9211-45e3-bb75-f85c54e66f10", "brandName": "Kiss Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://kissbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -796,7 +717,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.kissbank", - "productBaseUri": "https://publicapi.kissbank", "resourceBaseUri": "https://api.kissbank", "infoSecBaseUri": "https://idp.kissbank", "extensionBaseUri": "", @@ -831,7 +751,6 @@ { "brandId": "bb03be60-5c46-422e-a27e-aefa0015078d", "brandName": "Luna -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://lunabank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-12T11:58:00", @@ -844,7 +763,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.lunabank", - "productBaseUri": "https://publicapi.lunabank", "resourceBaseUri": "https://api.lunabank", "infoSecBaseUri": "https://idp.lunabank", "extensionBaseUri": "", @@ -879,7 +797,6 @@ { "brandId": "52d23611-4493-4a21-9095-44ae9eb85841", "brandName": "Mu Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mubank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -892,7 +809,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.mubank", - "productBaseUri": "https://publicapi.mubank", "resourceBaseUri": "https://api.mubank", "infoSecBaseUri": "https://idp.mubank", "extensionBaseUri": "", @@ -927,7 +843,6 @@ { "brandId": "557f42e8-4e00-4b03-a9c9-d97796b6418b", "brandName": "Noon Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://noonbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -940,7 +855,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.noonbank", - "productBaseUri": "https://publicapi.noonbank", "resourceBaseUri": "https://api.noonbank", "infoSecBaseUri": "https://idp.noonbank", "extensionBaseUri": "", @@ -975,7 +889,6 @@ { "brandId": "a5e45351-d13c-4690-93d1-3da515e71a92", "brandName": "Oppo Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://oppobank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -988,7 +901,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.oppobank", - "productBaseUri": "https://publicapi.oppobank", "resourceBaseUri": "https://api.oppobank", "infoSecBaseUri": "https://idp.oppobank", "extensionBaseUri": "", @@ -1023,7 +935,6 @@ { "brandId": "97e53112-73b2-482a-b352-39d389d67916", "brandName": "Pepper Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://pepperbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1036,7 +947,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.pepperbank", - "productBaseUri": "https://publicapi.pepperbank", "resourceBaseUri": "https://api.pepperbank", "infoSecBaseUri": "https://idp.pepperbank", "extensionBaseUri": "", @@ -1071,7 +981,6 @@ { "brandId": "895e54c5-93e0-405f-8072-0a9871bac8b5", "brandName": "QQ Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://qqbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1084,7 +993,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.qqbank", - "productBaseUri": "https://publicapi.qqbank", "resourceBaseUri": "https://api.qqbank", "infoSecBaseUri": "https://idp.qqbank", "extensionBaseUri": "", @@ -1119,7 +1027,6 @@ { "brandId": "975375f7-2bd9-44b5-a188-43d65ca8eaae", "brandName": "Run Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://runbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1132,7 +1039,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.runbank", - "productBaseUri": "https://publicapi.runbank", "resourceBaseUri": "https://api.runbank", "infoSecBaseUri": "https://idp.runbank", "extensionBaseUri": "", @@ -1167,7 +1073,6 @@ { "brandId": "b648f694-0dee-4f5e-bd2c-9837ac08fb7b", "brandName": "SaS Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://sasbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1180,7 +1085,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.sasbank", - "productBaseUri": "https://publicapi.sasbank", "resourceBaseUri": "https://api.sasbank", "infoSecBaseUri": "https://idp.sasbank", "extensionBaseUri": "", @@ -1215,7 +1119,6 @@ { "brandId": "f8bce914-ac8d-436a-b265-19baca6d1df2", "brandName": "TnT Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://tntbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-09T11:58:00", @@ -1228,7 +1131,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.tntbank", - "productBaseUri": "https://publicapi.tntbank", "resourceBaseUri": "https://api.tntbank", "infoSecBaseUri": "https://idp.tntbank", "extensionBaseUri": "", @@ -1263,7 +1165,6 @@ { "brandId": "e748eadf-4aa4-4e2f-b3da-fb4a9d511994", "brandName": "Bank Brand 2 -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://bank2/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1276,7 +1177,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.bank2", - "productBaseUri": "https://publicapi.bank2", "resourceBaseUri": "https://api.bank2", "infoSecBaseUri": "https://idp.bank2", "extensionBaseUri": "", @@ -1311,7 +1211,6 @@ { "brandId": "9f8df3e2-6866-42af-91d4-5faa3204f0b8", "brandName": "Smarter Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://smarterbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1324,7 +1223,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.smarterbank", - "productBaseUri": "https://publicapi.smarterbank", "resourceBaseUri": "https://api.smarterbank", "infoSecBaseUri": "https://idp.smarterbank", "extensionBaseUri": "", @@ -1334,7 +1232,6 @@ { "brandId": "81d3d5cb-cdb6-4253-a78b-b17155dde7fd", "brandName": "MyBank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://mybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1347,7 +1244,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.mybank", - "productBaseUri": "https://publicapi.mybank", "resourceBaseUri": "https://api.mybank", "infoSecBaseUri": "https://idp.mybank", "extensionBaseUri": "", @@ -1382,7 +1278,6 @@ { "brandId": "cf217aba-e00d-48d5-9c3d-03af0b91cb80", "brandName": "Hall Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallardbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-19T11:58:00", @@ -1395,7 +1290,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.hallbank", - "productBaseUri": "https://publicapi.hallbank", "resourceBaseUri": "https://api.hallbank", "infoSecBaseUri": "https://idp.hallbank", "extensionBaseUri": "", @@ -1405,7 +1299,6 @@ { "brandId": "920f296d-5f2f-49de-876c-15a4aa1b4a79", "brandName": "Hallway -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://hallwaybank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1418,7 +1311,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.hallwaybank", - "productBaseUri": "https://publicapi.hallwaybank", "resourceBaseUri": "https://api.hallwaybank", "infoSecBaseUri": "https://idp.hallwaybank", "extensionBaseUri": "", @@ -1453,7 +1345,6 @@ { "brandId": "bc144967-d6f8-47a6-8590-07caf522141b", "brandName": "Jobs Bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jobsbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1466,7 +1357,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.jobsbank", - "productBaseUri": "https://publicapi.jobsbank", "resourceBaseUri": "https://api.jobsbank", "infoSecBaseUri": "https://idp.jobsbank", "extensionBaseUri": "", @@ -1476,7 +1366,6 @@ { "brandId": "7b47ecf8-a991-4dd3-adef-b89564005e8e", "brandName": "offer bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://offerbank/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1489,7 +1378,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.offerbank", - "productBaseUri": "https://publicapi.offerbank", "resourceBaseUri": "https://api.offerbank", "infoSecBaseUri": "https://idp.offerbank", "extensionBaseUri": "", @@ -1499,7 +1387,6 @@ { "brandId": "c3176245-4258-4383-b945-cd2f7c828d3c", "brandName": "J bank -- dummy data holder -- do not use", - "brandGroup": null, "logoUri": "https://jbank/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-18T11:58:00", @@ -1512,7 +1399,6 @@ "endpoint": { "version": 1, "publicBaseUri": "https://publicapi.jbank", - "productBaseUri": "https://publicapi.jbank", "resourceBaseUri": "https://api.jbank", "infoSecBaseUri": "https://idp.jbank", "extensionBaseUri": "", @@ -1547,7 +1433,6 @@ { "brandId": "20c0864b-ceef-4de0-8944-eb0962f825eb", "brandName": "Finance X", - "brandGroup": null, "logoUri": "https://fintechx/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1670,7 +1555,6 @@ { "brandId": "fe123396-4eba-4518-aade-b245ceea78af", "brandName": "XRay Financial", - "brandGroup": null, "logoUri": "https://xraysoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1727,7 +1611,6 @@ { "brandId": "8fe9791a-e4a8-4104-b1cb-e0df41189520", "brandName": "WOW", - "brandGroup": null, "logoUri": "https://wowsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-02-06T11:58:00", @@ -1784,7 +1667,6 @@ { "brandId": "a7171ba3-fd05-456f-a859-be4e1cbcc17d", "brandName": "OLM Software", - "brandGroup": null, "logoUri": "https://olmsoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1841,7 +1723,6 @@ { "brandId": "8a3441aa-1242-493a-b466-dcbfffe5a441", "brandName": "xlogical", - "brandGroup": null, "logoUri": "https://xlogical/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", @@ -1898,7 +1779,6 @@ { "brandId": "46b33515-b4a5-4b1c-b5b4-25654d675be6", "brandName": "HotFinTech", - "brandGroup": null, "logoUri": "https://hotfintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -1977,7 +1857,6 @@ { "brandId": "ebbcc2f2-817e-42b8-8a28-cd45902159e0", "brandName": "ZeroFintech", - "brandGroup": null, "logoUri": "https://zerofintech/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-05T11:58:00", @@ -2056,7 +1935,6 @@ { "brandId": "f3f0c40b-9df8-491a-af1d-81cb9ab5f021", "brandName": "YoYo", - "brandGroup": null, "logoUri": "https://yoyosoftware/img/logo.png", "brandStatusId": 1, "lastUpdated": "2021-04-06T11:58:00", diff --git a/Source/CDR.Register.Admin.API/Startup.cs b/Source/CDR.Register.Admin.API/Startup.cs index a4b8001..2a67e7b 100644 --- a/Source/CDR.Register.Admin.API/Startup.cs +++ b/Source/CDR.Register.Admin.API/Startup.cs @@ -6,7 +6,8 @@ using CDR.Register.Admin.API.Business.Validators; using CDR.Register.Admin.API.Extensions; using CDR.Register.API.Infrastructure; -using CDR.Register.API.Infrastructure.Middleware; +using CDR.Register.API.Infrastructure.Models; +using CDR.Register.API.Infrastructure.Versioning; using CDR.Register.Domain.Extensions; using CDR.Register.Repository.Infrastructure; using FluentValidation; @@ -53,9 +54,11 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); - services.AddCdrApiVersioning(opt => + services.AddApiVersioning(options => { - opt.ReportApiVersions = true; + options.ApiVersionReader = new CdrVersionReader(new CdrApiOptions()); // uses default options atm + options.ErrorResponses = new ApiVersionErrorResponse(); + options.ReportApiVersions = true; }); var enableSwagger = this.Configuration.GetValue(ConfigurationKeys.EnableSwagger); @@ -87,11 +90,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger< app.UseDeveloperExceptionPage(); } - app.UseExceptionHandler(exceptionHandlerApp => - { - exceptionHandlerApp.Run(async context => await ApiExceptionHandler.Handle(context)); - }); - app.UseSerilogRequestLogging(); app.UseHttpsRedirection(); @@ -133,7 +131,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger< var context = serviceScope.ServiceProvider.GetRequiredService(); if (context == null) { - logger.LogError("Migration failed. Unable to get {Name}", nameof(RegisterDatabaseContext)); + logger.LogError("Mirgation failed. Unable to get {Name}", nameof(RegisterDatabaseContext)); throw new InvalidOperationException($"Unable to get {nameof(RegisterDatabaseContext)}"); } diff --git a/Source/CDR.Register.Discovery.API.UnitTests/CDR.Register.Discovery.API.UnitTests.csproj b/Source/CDR.Register.Discovery.API.UnitTests/CDR.Register.Discovery.API.UnitTests.csproj deleted file mode 100644 index 18b9899..0000000 --- a/Source/CDR.Register.Discovery.API.UnitTests/CDR.Register.Discovery.API.UnitTests.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - false - false - $(TargetFrameworkVersion) - $(Version) - $(Version) - $(Version) - True - true - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/Source/CDR.Register.Discovery.API.UnitTests/DiscoveryServiceTests.cs b/Source/CDR.Register.Discovery.API.UnitTests/DiscoveryServiceTests.cs deleted file mode 100644 index c7d0bc3..0000000 --- a/Source/CDR.Register.Discovery.API.UnitTests/DiscoveryServiceTests.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using AutoMapper; -using CDR.Register.Discovery.API.Business; -using CDR.Register.Repository.Infrastructure; -using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; -using Google.Protobuf.Compiler; -using NSubstitute; - -namespace CDR.Register.Discovery.API.UnitTests -{ - public class DiscoveryServiceTests - { - private readonly IRegisterDiscoveryRepository _repository = Substitute.For(); - private readonly IMapper _mapper = Substitute.For(); - - [Theory] - [InlineData(2, typeof(BrandSpecifications.ExcludeNblIndustry))] - [InlineData(3, typeof(BrandSpecifications.AllIndustries))] - public async Task GetDataHolderBrands_UsesCorrectSpecification(int version, Type expectedType) - { - // Arrange - Type specificationType = null; - _ = await this._repository.GetDataHolderBrands(Industry.ALL, Arg.Do(x => specificationType = x.GetType()), Arg.Any(), Arg.Any(), Arg.Any()); - var service = new DiscoveryService(this._repository, this._mapper); - - // Act - _ = await service.GetDataHolderBrands(Industry.ALL, DateTime.UtcNow, 1, 1, version); - - // Assert - Assert.Equal(expectedType, specificationType); - } - - [Fact] - public async Task GetDataHolderBrands_ThrowsExceptionForUnsupportedVersion() - { - // Arrange - var service = new DiscoveryService(this._repository, this._mapper); - - // Act - var action = async () => await service.GetDataHolderBrands(Industry.ALL, DateTime.UtcNow, 1, 1, 1); - - // Assert - await Assert.ThrowsAsync(action); - } - } -} diff --git a/Source/CDR.Register.Discovery.API/Business/DiscoveryService.cs b/Source/CDR.Register.Discovery.API/Business/DiscoveryService.cs index 2697780..a789a90 100644 --- a/Source/CDR.Register.Discovery.API/Business/DiscoveryService.cs +++ b/Source/CDR.Register.Discovery.API/Business/DiscoveryService.cs @@ -1,39 +1,35 @@ using System; using System.Threading.Tasks; using AutoMapper; -using CDR.Register.Discovery.API.Business.Models; using CDR.Register.Discovery.API.Business.Responses; using CDR.Register.Repository.Infrastructure; using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; namespace CDR.Register.Discovery.API.Business { - public class DiscoveryService(IRegisterDiscoveryRepository registerDiscoveryRepository, IMapper mapper) : IDiscoveryService + public class DiscoveryService : IDiscoveryService { - public async Task> GetDataHolderBrands(Industry industry, DateTime? updatedSince, int page, int pageSize, int version) - { - IBrandSpecification specification = version switch - { - 2 => new BrandSpecifications.ExcludeNblIndustry(), - 3 => new BrandSpecifications.AllIndustries(), - _ => throw new NotImplementedException("Unknown version"), - }; + private readonly IRegisterDiscoveryRepository _registerDiscoveryRepository; + private readonly IMapper _mapper; - var entity = await registerDiscoveryRepository.GetDataHolderBrands(industry, specification, updatedSince, page, pageSize); + public DiscoveryService( + IRegisterDiscoveryRepository registerDiscoveryRepository, + IMapper mapper) + { + this._registerDiscoveryRepository = registerDiscoveryRepository; + this._mapper = mapper; + } - return version switch - { - 2 => mapper.Map(entity), - 3 => mapper.Map(entity), - _ => throw new NotImplementedException("Unknown version"), - }; + public async Task GetDataHolderBrandsAsync(Industry industry, DateTime? updatedSince, int page, int pageSize) + { + var entity = await this._registerDiscoveryRepository.GetDataHolderBrandsAsync(industry, updatedSince, page, pageSize); + return this._mapper.Map(entity); } - public async Task GetDataRecipientsAsync() + public async Task GetDataRecipientsAsync(Industry industry) { - var entity = await registerDiscoveryRepository.GetDataRecipientsAsync(); - return mapper.Map(entity); + var entity = await this._registerDiscoveryRepository.GetDataRecipientsAsync(industry); + return this._mapper.Map(entity); } } } diff --git a/Source/CDR.Register.Discovery.API/Business/IDiscoveryService.cs b/Source/CDR.Register.Discovery.API/Business/IDiscoveryService.cs index 04ca8c2..4091824 100644 --- a/Source/CDR.Register.Discovery.API/Business/IDiscoveryService.cs +++ b/Source/CDR.Register.Discovery.API/Business/IDiscoveryService.cs @@ -1,6 +1,5 @@ using System; using System.Threading.Tasks; -using CDR.Register.Discovery.API.Business.Models; using CDR.Register.Discovery.API.Business.Responses; using CDR.Register.Repository.Infrastructure; @@ -8,8 +7,8 @@ namespace CDR.Register.Discovery.API.Business { public interface IDiscoveryService { - Task> GetDataHolderBrands(Industry industry, DateTime? updatedSince, int page, int pageSize, int version); + Task GetDataHolderBrandsAsync(Industry industry, DateTime? updatedSince, int page, int pageSize); - Task GetDataRecipientsAsync(); + Task GetDataRecipientsAsync(Industry industry); } } diff --git a/Source/CDR.Register.Discovery.API/Business/MappingProfile.cs b/Source/CDR.Register.Discovery.API/Business/MappingProfile.cs index c6e1d23..bead95f 100644 --- a/Source/CDR.Register.Discovery.API/Business/MappingProfile.cs +++ b/Source/CDR.Register.Discovery.API/Business/MappingProfile.cs @@ -3,7 +3,6 @@ using CDR.Register.API.Infrastructure.Models; using CDR.Register.Discovery.API.Business.Models; using CDR.Register.Discovery.API.Business.Responses; -using CDR.Register.Domain; using CDR.Register.Domain.Entities; using CDR.Register.Domain.ValueObjects; @@ -13,12 +12,11 @@ public class MappingProfile : Profile { public MappingProfile() { - this.CreateMap(typeof(Page<>), typeof(MetaPaginated)).MaxDepth(Constants.MappingConstants.MaxDepth); + this.CreateMap(typeof(Page<>), typeof(MetaPaginated)); - this.CreateMap().MaxDepth(Constants.MappingConstants.MaxDepth); + this.CreateMap(); - this.CreateMap().MaxDepth(Constants.MappingConstants.MaxDepth); - this.CreateMap().MaxDepth(Constants.MappingConstants.MaxDepth); + this.CreateMap(); this.CreateMap() .ForMember(dest => dest.LegalEntityId, source => source.MapFrom(source => source.LegalEntityId)) @@ -32,49 +30,29 @@ public MappingProfile() .ForMember(dest => dest.Arbn, source => source.MapFrom(source => source.Arbn)) .ForMember(dest => dest.AnzsicDivision, source => source.MapFrom(source => source.AnzsicDivision)) .ForMember(dest => dest.OrganisationType, source => source.MapFrom(source => source.OrganisationType)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.ToUpper())) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.ToUpper())); this.CreateMap, ResponseRegisterDataHolderBrandList>() .ForMember(dest => dest.Data, source => source.MapFrom(source => source.Data)) - .ForMember(dest => dest.Meta, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Meta, source => source.MapFrom(source => source)); - this.CreateMap, ResponseRegisterDataHolderBrandListV2>() - .ForMember(dest => dest.Data, source => source.MapFrom(source => source.Data)) - .ForMember(dest => dest.Meta, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); - - this.CreateMap() + this.CreateMap() .ForMember(dest => dest.DataHolderBrandId, source => source.MapFrom(source => source.BrandId)) .ForMember(dest => dest.Industries, source => source.MapFrom(source => new List { source.DataHolder.Industry.ToLower() })) .ForMember(dest => dest.Status, source => source.MapFrom(source => source.BrandStatus)) .ForMember(dest => dest.AuthDetails, source => source.MapFrom(source => source.DataHolderAuthentications)) .ForMember(dest => dest.EndpointDetail, source => source.MapFrom(source => source.DataHolderBrandServiceEndpoint)) - .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source.DataHolder.LegalEntity)) - .MaxDepth(Constants.MappingConstants.MaxDepth); - - this.CreateMap() - .ForMember(dest => dest.DataHolderBrandId, source => source.MapFrom(source => source.BrandId)) - .ForMember(dest => dest.BrandGroup, source => source.MapFrom(source => source.BrandGroup)) - .ForMember(dest => dest.Industries, source => source.MapFrom(source => new List { source.DataHolder.Industry.ToLower() })) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.BrandStatus)) - .ForMember(dest => dest.AuthDetails, source => source.MapFrom(source => source.DataHolderAuthentications)) - .ForMember(dest => dest.EndpointDetail, source => source.MapFrom(source => source.DataHolderBrandServiceEndpoint)) - .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source.DataHolder.LegalEntity)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source.DataHolder.LegalEntity)); this.CreateMap() .ForMember(dest => dest.DataRecipientBrandId, source => source.MapFrom(source => source.BrandId)) .ForMember(dest => dest.BrandName, source => source.MapFrom(source => source.BrandName)) .ForMember(dest => dest.LogoUri, source => source.MapFrom(source => source.LogoUri)) .ForMember(dest => dest.Status, source => source.MapFrom(source => source.BrandStatus)) - .ForMember(dest => dest.SoftwareProducts, source => source.MapFrom(source => source.SoftwareProducts)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.SoftwareProducts, source => source.MapFrom(source => source.SoftwareProducts)); this.CreateMap() - .ForMember(dest => dest.Data, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Data, source => source.MapFrom(source => source)); this.CreateMap() .ForMember(dest => dest.LegalEntityId, source => source.MapFrom(source => source.LegalEntity.LegalEntityId)) @@ -84,15 +62,13 @@ public MappingProfile() .ForMember(dest => dest.LogoUri, source => source.MapFrom(source => source.LegalEntity.LogoUri)) .ForMember(dest => dest.DataRecipientBrands, source => source.MapFrom(source => source.DataRecipientBrands)) .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)) - .ForMember(dest => dest.LastUpdated, source => source.MapFrom(source => source.LastUpdated)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.LastUpdated, source => source.MapFrom(source => source.LastUpdated)); this.CreateMap() .ForMember(dest => dest.SoftwareProductId, source => source.MapFrom(source => source.SoftwareProductId)) .ForMember(dest => dest.SoftwareProductName, source => source.MapFrom(source => source.SoftwareProductName)) .ForMember(dest => dest.LogoUri, source => source.MapFrom(source => source.LogoUri)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)); } } } diff --git a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpointV2.cs b/Source/CDR.Register.Discovery.API/Business/Models/EndPointDetailModel.cs similarity index 77% rename from Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpointV2.cs rename to Source/CDR.Register.Discovery.API/Business/Models/EndPointDetailModel.cs index 827ee61..6d4a4c5 100644 --- a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpointV2.cs +++ b/Source/CDR.Register.Discovery.API/Business/Models/EndPointDetailModel.cs @@ -1,11 +1,9 @@ namespace CDR.Register.Discovery.API.Business.Models { - public class RegisterDataHolderBrandServiceEndpointV2 + public class EndpointDetailModel { public string Version { get; set; } - public string ProductBaseUri { get; set; } - public string PublicBaseUri { get; set; } public string ResourceBaseUri { get; set; } diff --git a/Source/CDR.Register.Discovery.API/Business/Models/IRegisterDataHolderBrand.cs b/Source/CDR.Register.Discovery.API/Business/Models/IRegisterDataHolderBrand.cs deleted file mode 100644 index 834a1d4..0000000 --- a/Source/CDR.Register.Discovery.API/Business/Models/IRegisterDataHolderBrand.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace CDR.Register.Discovery.API.Business.Models -{ - public interface IRegisterDataHolderBrand - { - } -} diff --git a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrand.cs b/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrand.cs deleted file mode 100644 index a10c1c8..0000000 --- a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrand.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace CDR.Register.Discovery.API.Business.Models -{ - [Obsolete("Deprecated in the standards, used by versions prior to V1.35.0. This is aligned with RAAP implementation and can be removed when the endpoint is no longer supported.", false)] - public class RegisterDataHolderBrand : IRegisterDataHolderBrand - { - public string DataHolderBrandId { get; set; } - - public string BrandName { get; set; } - - public List Industries { get; set; } - - public string LogoUri { get; set; } - - public DataHolderLegalEntityModel LegalEntity { get; set; } - - public string Status { get; set; } - - public AuthDetailModel[] AuthDetails { get; set; } - - public DateTime LastUpdated { get; set; } - - public RegisterDataHolderBrandServiceEndpoint EndpointDetail { get; set; } - } -} diff --git a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandV2.cs b/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandModel.cs similarity index 72% rename from Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandV2.cs rename to Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandModel.cs index 5ac6fa8..18db58f 100644 --- a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandV2.cs +++ b/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandModel.cs @@ -3,7 +3,7 @@ namespace CDR.Register.Discovery.API.Business.Models { - public class RegisterDataHolderBrandV2 : IRegisterDataHolderBrand + public class RegisterDataHolderBrandModel { public string DataHolderBrandId { get; set; } @@ -17,12 +17,10 @@ public class RegisterDataHolderBrandV2 : IRegisterDataHolderBrand public string Status { get; set; } + public EndpointDetailModel EndpointDetail { get; set; } + public AuthDetailModel[] AuthDetails { get; set; } public DateTime LastUpdated { get; set; } - - public string BrandGroup { get; set; } - - public RegisterDataHolderBrandServiceEndpointV2 EndpointDetail { get; set; } } } diff --git a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpoint.cs b/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpoint.cs deleted file mode 100644 index 418db4c..0000000 --- a/Source/CDR.Register.Discovery.API/Business/Models/RegisterDataHolderBrandServiceEndpoint.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace CDR.Register.Discovery.API.Business.Models -{ - [Obsolete("Deprecated in the standards, used by versions prior to V1.35.0. This is aligned with RAAP implementation and can be removed when the endpoint is no longer supported.", false)] - public class RegisterDataHolderBrandServiceEndpoint - { - public string Version { get; set; } - - public string PublicBaseUri { get; set; } - - public string ResourceBaseUri { get; set; } - - public string InfosecBaseUri { get; set; } - - public string ExtensionBaseUri { get; set; } - - public string WebsiteUri { get; set; } - } -} diff --git a/Source/CDR.Register.Discovery.API/Business/Responses/IResponseRegisterDataHolderBrandList.cs b/Source/CDR.Register.Discovery.API/Business/Responses/IResponseRegisterDataHolderBrandList.cs deleted file mode 100644 index bce0cfc..0000000 --- a/Source/CDR.Register.Discovery.API/Business/Responses/IResponseRegisterDataHolderBrandList.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using CDR.Register.API.Infrastructure.Models; -using CDR.Register.Discovery.API.Business.Models; - -namespace CDR.Register.Discovery.API.Business.Responses -{ - /// - /// Response with list of DH Brands. - /// - /// The DH Brand collection. - public interface IResponseRegisterDataHolderBrandList - where T : IRegisterDataHolderBrand - { - IEnumerable Data { get; } - - LinksPaginated Links { get; set; } - - MetaPaginated Meta { get; set; } - } -} diff --git a/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandList.cs b/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandList.cs index ac319af..d6ab71f 100644 --- a/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandList.cs +++ b/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandList.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using CDR.Register.API.Infrastructure.Models; using CDR.Register.Discovery.API.Business.Models; namespace CDR.Register.Discovery.API.Business.Responses { - [Obsolete("Deprecated in the standards, used by versions prior to V1.35.0. This is aligned with RAAP implementation and can be removed when the endpoint is no longer supported.", false)] - public class ResponseRegisterDataHolderBrandList : IResponseRegisterDataHolderBrandList + public class ResponseRegisterDataHolderBrandList { - public IEnumerable Data { get; set; } + public IEnumerable Data { get; set; } public LinksPaginated Links { get; set; } = new LinksPaginated(); diff --git a/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandListV2.cs b/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandListV2.cs deleted file mode 100644 index 0c6a428..0000000 --- a/Source/CDR.Register.Discovery.API/Business/Responses/ResponseRegisterDataHolderBrandListV2.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using CDR.Register.API.Infrastructure.Models; -using CDR.Register.Discovery.API.Business.Models; - -namespace CDR.Register.Discovery.API.Business.Responses -{ - public class ResponseRegisterDataHolderBrandListV2 : IResponseRegisterDataHolderBrandList - { - public IEnumerable Data { get; set; } - - public LinksPaginated Links { get; set; } = new LinksPaginated(); - - public MetaPaginated Meta { get; set; } = new MetaPaginated(); - } -} diff --git a/Source/CDR.Register.Discovery.API/ConsumerDataRight.ParticipantTooling.MockRegister.API.Discovery.xml b/Source/CDR.Register.Discovery.API/ConsumerDataRight.ParticipantTooling.MockRegister.API.Discovery.xml index f4eb5d3..0892b3d 100644 --- a/Source/CDR.Register.Discovery.API/ConsumerDataRight.ParticipantTooling.MockRegister.API.Discovery.xml +++ b/Source/CDR.Register.Discovery.API/ConsumerDataRight.ParticipantTooling.MockRegister.API.Discovery.xml @@ -4,12 +4,6 @@ CDR.Register.Discovery.API - - - Response with list of DH Brands. - - The DH Brand collection. - Performs checks against the software product id from the access token. diff --git a/Source/CDR.Register.Discovery.API/Controllers/DiscoveryController.cs b/Source/CDR.Register.Discovery.API/Controllers/DiscoveryController.cs index 03559bc..f8f8f4b 100644 --- a/Source/CDR.Register.Discovery.API/Controllers/DiscoveryController.cs +++ b/Source/CDR.Register.Discovery.API/Controllers/DiscoveryController.cs @@ -2,7 +2,6 @@ using System.Globalization; using System.Net; using System.Threading.Tasks; -using Asp.Versioning; using CDR.Register.API.Infrastructure; using CDR.Register.API.Infrastructure.Authorization; using CDR.Register.API.Infrastructure.Filters; @@ -23,9 +22,7 @@ public class DiscoveryController : ControllerBase { // Route names. private const string ROUTE_GET_DATA_HOLDER_BRANDS_XV2 = "GetDataHolderBrandsXV2"; - private const string ROUTE_GET_DATA_HOLDER_BRANDS_XV3 = "GetDataHolderBrandsXV3"; private const string ROUTE_GET_DATA_RECIPIENTS_XV3 = "GetDataRecipientsXV3"; - private const string ROUTE_GET_DATA_RECIPIENTS_XV4 = "GetDataRecipientsXV4"; private readonly IDiscoveryService _discoveryService; private readonly IDataRecipientStatusCheckService _statusCheckService; @@ -41,71 +38,18 @@ public DiscoveryController( this._statusCheckService = statusCheckService; } - [Obsolete("Deprecated in the standards, used by versions prior to V1.35.0. This is aligned with RAAP implementation and can be removed when the endpoint is no longer supported.", false)] [HttpGet("v1/{industry}/data-holders/brands", Name = ROUTE_GET_DATA_HOLDER_BRANDS_XV2)] [PolicyAuthorize(RegisterAuthorisationPolicy.DataHolderBrandsApiMultiIndustry)] [ApiVersion("2")] [ReturnXV("2")] [ETag] - [CheckIndustry(Repository.Infrastructure.Industry.BANKING, Repository.Infrastructure.Industry.ENERGY, Repository.Infrastructure.Industry.TELCO, Repository.Infrastructure.Industry.ALL)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataHolderBrandsXV2( - string industry, - [FromQuery(Name = "updated-since"), CheckDate] string updatedSince, - [FromQuery(Name = "page"), CheckPage] string page, - [FromQuery(Name = "page-size"), CheckPageSize] string pageSize) - => this.GetDataHolderBrands(2, ROUTE_GET_DATA_HOLDER_BRANDS_XV2, industry, updatedSince, page, pageSize); - - [HttpGet("v1/{industry}/data-holders/brands", Name = ROUTE_GET_DATA_HOLDER_BRANDS_XV3)] - [PolicyAuthorize(RegisterAuthorisationPolicy.DataHolderBrandsApiMultiIndustry)] - [ApiVersion("3")] - [ReturnXV("3")] - [ETag] [CheckIndustry] [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataHolderBrandsXV3( + public async Task GetDataHolderBrandsXV2( string industry, [FromQuery(Name = "updated-since"), CheckDate] string updatedSince, [FromQuery(Name = "page"), CheckPage] string page, [FromQuery(Name = "page-size"), CheckPageSize] string pageSize) - => this.GetDataHolderBrands(3, ROUTE_GET_DATA_HOLDER_BRANDS_XV3, industry, updatedSince, page, pageSize); - - [HttpGet("v1/{industry}/data-recipients", Name = ROUTE_GET_DATA_RECIPIENTS_XV3)] - [ReturnXV("3")] - [ApiVersion("3")] - [ETag] - [CheckIndustry(Repository.Infrastructure.Industry.BANKING, Repository.Infrastructure.Industry.ENERGY, Repository.Infrastructure.Industry.TELCO, Repository.Infrastructure.Industry.ALL)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public async Task GetDataRecipientsXV3(string industry) - { - return await this.GetDataRecipients(); - } - - [HttpGet("v1/{industry}/data-recipients", Name = ROUTE_GET_DATA_RECIPIENTS_XV4)] - [ReturnXV("4")] - [ApiVersion("4")] - [ETag] - [CheckIndustry(Repository.Infrastructure.Industry.ALL)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public async Task GetDataRecipientsXV4(string industry) - { - return await this.GetDataRecipients(); - } - - private async Task GetDataRecipients() - { - var response = await this._discoveryService.GetDataRecipientsAsync(); - response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); - return this.Ok(response); - } - - private async Task GetDataHolderBrands( - int version, - string routeName, - string industry, - string updatedSince, - string page, - string pageSize) { // CTS conformance ID validations var basePathExpression = this._configuration.GetValue(Constants.ConfigurationKeys.BasePathExpression); @@ -129,7 +73,7 @@ private async Task GetDataHolderBrands( DateTime? updatedSinceDate = string.IsNullOrEmpty(updatedSince) ? (DateTime?)null : DateTime.Parse(updatedSince, CultureInfo.InvariantCulture); int pageNumber = string.IsNullOrEmpty(page) ? 1 : int.Parse(page); int pageSizeNumber = string.IsNullOrEmpty(pageSize) ? 25 : int.Parse(pageSize); - var response = await this._discoveryService.GetDataHolderBrands(industry.ToIndustry(), updatedSinceDate, pageNumber, pageSizeNumber, version); + var response = await this._discoveryService.GetDataHolderBrandsAsync(industry.ToIndustry(), updatedSinceDate, pageNumber, pageSizeNumber); // Check if the given page number is out of range if (pageNumber != 1 && pageNumber > response.Meta.TotalPages) @@ -139,7 +83,7 @@ private async Task GetDataHolderBrands( // Set pagination meta data response.Links = this.GetPaginated( - routeName, + ROUTE_GET_DATA_HOLDER_BRANDS_XV2, this._configuration, updatedSinceDate, pageNumber, @@ -151,6 +95,19 @@ private async Task GetDataHolderBrands( return this.Ok(response); } + [HttpGet("v1/{industry}/data-recipients", Name = ROUTE_GET_DATA_RECIPIENTS_XV3)] + [ReturnXV("3")] + [ApiVersion("3")] + [ETag] + [CheckIndustry] + [ServiceFilter(typeof(LogActionEntryAttribute))] + public async Task GetDataRecipientsXV3(string industry) + { + var response = await this._discoveryService.GetDataRecipientsAsync(industry.ToIndustry()); + response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); + return this.Ok(response); + } + /// /// Performs checks against the software product id from the access token. /// diff --git a/Source/CDR.Register.Discovery.API/Startup.cs b/Source/CDR.Register.Discovery.API/Startup.cs index df4ff1f..9815640 100644 --- a/Source/CDR.Register.Discovery.API/Startup.cs +++ b/Source/CDR.Register.Discovery.API/Startup.cs @@ -41,7 +41,11 @@ public void ConfigureServices(IServiceCollection services) options.InvalidModelStateResponseFactory = ModelStateErrorMiddleware.ExecuteResult; }); - services.AddCdrApiVersioning(); + services.AddApiVersioning(options => + { + options.ApiVersionReader = new CdrVersionReader(new CdrApiOptions()); // uses default options atm + options.ErrorResponses = new ApiVersionErrorResponse(); + }); var enableSwagger = this.Configuration.GetValue(ConfigurationKeys.EnableSwagger); if (enableSwagger) diff --git a/Source/CDR.Register.Domain.UnitTests/Extensions/EnumExtensionsTests.cs b/Source/CDR.Register.Domain.UnitTests/Extensions/EnumExtensionsTests.cs deleted file mode 100644 index 409e21d..0000000 --- a/Source/CDR.Register.Domain.UnitTests/Extensions/EnumExtensionsTests.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.ComponentModel; -using CDR.Register.Domain.Extensions; -using Xunit; - -namespace CDR.Register.Domain.UnitTests -{ - public class EnumExtensionsTests - { - private const string ExpectedDescription = "Value With Description"; - - public enum TestValue - { - [Description(ExpectedDescription)] - WithDescription = 100, - SansDescription = 200, - } - - [Theory] - [InlineData(nameof(TestValue.WithDescription), true, TestValue.WithDescription)] - [InlineData(nameof(TestValue.SansDescription), true, TestValue.SansDescription)] - [InlineData(TestValue.WithDescription, true, TestValue.WithDescription)] - [InlineData(TestValue.SansDescription, true, TestValue.SansDescription)] - [InlineData(100, true, TestValue.WithDescription)] - [InlineData(200, true, TestValue.SansDescription)] - [InlineData("invalid", false, default)] - [InlineData("", false, default)] - [InlineData(0, false, default)] - public void TryParseFromDescription_ReturnsExpectedValue(object obj, bool expectedResult, TestValue? expectedValue) - { - var input = obj.ToString(); - - var result = input.TryParseFromDescription(out var value); - - Assert.Equal(expectedResult, result); - - if (result) - { - Assert.Equal(expectedValue, value); - } - } - - [Theory] - [InlineData(nameof(TestValue.WithDescription), TestValue.WithDescription)] - [InlineData(nameof(TestValue.SansDescription), TestValue.SansDescription)] - [InlineData(TestValue.WithDescription, TestValue.WithDescription)] - [InlineData(TestValue.SansDescription, TestValue.SansDescription)] - [InlineData(100, TestValue.WithDescription)] - [InlineData(200, TestValue.SansDescription)] - public void ParseFromDescription_ReturnsExpectedValue(object obj, TestValue? expectedValue) - { - var input = obj.ToString(); - - var result = input.ParseFromDescription(); - - Assert.Equal(expectedValue, result); - } - - [Theory] - [InlineData(TestValue.WithDescription, ExpectedDescription)] - [InlineData(TestValue.SansDescription, null)] - public void GetDescription_ReturnsExpectedValue(TestValue value, string expected) - { - var result = value.GetDescription(); - - Assert.Equal(expected, result); - } - } -} diff --git a/Source/CDR.Register.Domain/Constants.cs b/Source/CDR.Register.Domain/Constants.cs index 80f6769..980f485 100644 --- a/Source/CDR.Register.Domain/Constants.cs +++ b/Source/CDR.Register.Domain/Constants.cs @@ -84,10 +84,5 @@ public static class ErrorTitles public const string InvalidIndustry = "Invalid Industry"; public const string InvalidSoftwareProduct = "Invalid Software Product"; } - - public static class MappingConstants - { - public const int MaxDepth = 32; - } } } diff --git a/Source/CDR.Register.Domain/Entities/Brand.cs b/Source/CDR.Register.Domain/Entities/Brand.cs index 89b3e49..9b10eed 100644 --- a/Source/CDR.Register.Domain/Entities/Brand.cs +++ b/Source/CDR.Register.Domain/Entities/Brand.cs @@ -10,8 +10,6 @@ public abstract class Brand public string BrandName { get; set; } - public string BrandGroup { get; set; } - public string LogoUri { get; set; } public string BrandStatus { get; set; } diff --git a/Source/CDR.Register.Domain/Entities/DataHolderBrandServiceEndpoint.cs b/Source/CDR.Register.Domain/Entities/DataHolderBrandServiceEndpoint.cs index 1474d9e..d2045cf 100644 --- a/Source/CDR.Register.Domain/Entities/DataHolderBrandServiceEndpoint.cs +++ b/Source/CDR.Register.Domain/Entities/DataHolderBrandServiceEndpoint.cs @@ -6,8 +6,6 @@ public class DataHolderBrandServiceEndpoint public string PublicBaseUri { get; set; } - public string ProductBaseUri { get; set; } - public string ResourceBaseUri { get; set; } public string InfosecBaseUri { get; set; } diff --git a/Source/CDR.Register.Domain/Enums/Industry.cs b/Source/CDR.Register.Domain/Enums/Industry.cs index 0eb5088..5164956 100644 --- a/Source/CDR.Register.Domain/Enums/Industry.cs +++ b/Source/CDR.Register.Domain/Enums/Industry.cs @@ -1,46 +1,10 @@ -using System.ComponentModel; -using System.Runtime.Serialization; - -namespace CDR.Register.Domain.Enums +namespace CDR.Register.Domain.Enums { - /// - /// The industry. - /// public enum Industry { - /// - /// All industries. - /// - [Description("all")] - [EnumMember(Value = "all")] All = 0, - - /// - /// Banking. - /// - [Description("banking")] - [EnumMember(Value = "banking")] - Banking = 1, - - /// - /// Energy. - /// - [Description("energy")] - [EnumMember(Value = "energy")] - Energy = 2, - - /// - /// Non-Bank Lending. - /// - [Description("non-bank-lending")] - [EnumMember(Value = "non-bank-lending")] - NonBankLending = 3, - - /// - /// Telecoms Company. - /// - [Description("telco")] - [EnumMember(Value = "telco")] - Telco = 4, + Banking, + Energy, + Telco, } } diff --git a/Source/CDR.Register.Domain/Extensions/EnumExtensions.cs b/Source/CDR.Register.Domain/Extensions/EnumExtensions.cs deleted file mode 100644 index 2fa1a8a..0000000 --- a/Source/CDR.Register.Domain/Extensions/EnumExtensions.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.ComponentModel; -using System.Reflection; -using Newtonsoft.Json.Linq; - -namespace CDR.Register.Domain.Extensions -{ - public static class EnumExtensions - { - /// - /// Attempts to match the input with the on the enum value, if present otherwise the value itself. - /// - /// This is case-insensitive. - /// The type of . - /// The input string to match against the enum value name or description. - /// The value of with the matching name or description. - /// A flag indicating whether a matching enum value was found. - public static bool TryParseFromDescription(this string input, out T value) - where T : struct, Enum - { - var type = typeof(T); - - foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Static)) - { - var attribute = field.GetCustomAttribute(); - if (attribute != null && - attribute.Description.Equals(input, StringComparison.OrdinalIgnoreCase)) - { - value = (T)field.GetValue(null)!; - return true; - } - } - - if (Enum.TryParse(input, ignoreCase: true, out value)) - { - return Enum.IsDefined(value); - } - - return false; - } - - /// - /// Gets the description for a value of . - /// - /// The type of . - /// The enum value to fetch a name for. - /// The description of the enum value. - public static string GetDescription(this T value) - where T : struct, Enum - { - var type = typeof(T); - var name = value.ToString(); - - var field = type.GetField(name); - if (field == null) - { - return null; - } - - var attribute = field.GetCustomAttribute(); - return attribute?.Description; - } - - /// - /// Matches the input with the on the enum value, if present otherwise the value itself. - /// - /// This is case-insensitive. - /// The type of . - /// The input string to match against the enum value name or description. - /// A flag indicating whether a matching enum value was found. - public static T ParseFromDescription(this string input) - where T : struct, Enum - { - var type = typeof(T); - - foreach (var field in type.GetFields(BindingFlags.Public | BindingFlags.Static)) - { - var attribute = field.GetCustomAttribute(); - if (attribute != null && - attribute.Description.Equals(input, StringComparison.OrdinalIgnoreCase)) - { - return (T)field.GetValue(null)!; - } - } - - return Enum.Parse(input, true); - } - } -} diff --git a/Source/CDR.Register.Infosec/Controllers/TokenController.cs b/Source/CDR.Register.Infosec/Controllers/TokenController.cs index cce70bd..18a1cdc 100644 --- a/Source/CDR.Register.Infosec/Controllers/TokenController.cs +++ b/Source/CDR.Register.Infosec/Controllers/TokenController.cs @@ -74,20 +74,18 @@ private static (bool IsValid, string? Error, string? ErrorDescription, SoftwareP private static (bool IsValid, string? Error, string? ErrorDescription, SoftwareProductInfosec? Client) ValidateScope(string? scope) { - if (string.IsNullOrWhiteSpace(scope)) + if (string.IsNullOrEmpty(scope)) { return (false, ErrorCodes.Generic.InvalidClient, "empty scope", null); } - var scopes = scope.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); - - // This was rewritten to abide by S3267 code style during patching. - // However, this may lead to a bug in future if the supported scopes are expanded as it does not allow - // scopes that INCLUDE 'cdr-register:read' but rather enforces scopes are ONLY 'cdr-register:read' - // this should probably be !scopes.Contains(Constants.Scopes.RegisterRead, StringComparison.Ordinal) - if (scopes.Any(s => !s.Equals(Constants.Scopes.RegisterRead, StringComparison.Ordinal))) + var scopes = scope.Split(' '); + foreach (var s in scopes) { - return (false, ErrorCodes.Generic.InvalidClient, "invalid scope", null); + if (!s.Equals(Constants.Scopes.RegisterRead)) + { + return (false, ErrorCodes.Generic.InvalidClient, "invalid scope", null); + } } return (true, null, null, null); diff --git a/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataHolderBrandsXV3_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataHolderBrandsXV3_MultiIndustry_Tests.cs deleted file mode 100644 index a4be879..0000000 --- a/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataHolderBrandsXV3_MultiIndustry_Tests.cs +++ /dev/null @@ -1,1156 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using CDR.Register.IntegrationTests.Infrastructure; -using CDR.Register.Repository.Enums; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.Discovery -{ - /// - /// Integration tests for GetDataHolderBrands V3. - /// - /// - /// This is similar to except - /// that for x-v:3 the additional non-bank-lending industry should be supported. - /// - public class GetDataHolderBrandsXV3_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : BaseTest(outputHelper, testFixture) - { - private const string BrandId = "20C0864B-CEEF-4DE0-8944-EB0962F825EB"; - private const string SoftwareProductId = "86ECB655-9EBA-409C-9BE3-59E7ADF7080D"; - - /// - /// The current endpoint version under test. - /// - private const string EndpointVersion = "3"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "2"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "4"; - - /// - /// Actions that need to be performed before the request, such as setting status of Brand or Software Product. - /// - private delegate void BeforeRequest(); - - /// - /// Actions that need to be performed after the request, such as restoring status of Brand or Software Product. - /// - private delegate void AfterRequest(); - - // Participation/Brand/SoftwareProduct Ids - private static string ParticipationId => GetParticipationId(BrandId); // lookup - - /// - /// The request with no additional query parameters should return the expected results using the defaults (first page, 25 records). - /// - /// The industry to request. - /// The expected status code. - /// A representing the asynchronous unit test. - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithNoQueryString_ShouldRespondWith_200OK_First25RecordsAsync(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) - { - await Test_QueryParameters_RespondWithExpectedStatusAndBody(null, null, null, industry, expectedStatusCode); - } - - /// - /// The request with CTS paths and no additional query parameters should return the expected results using the defaults (first page, 25 records). - /// - /// The industry to request. - /// The expected status code. - /// A representing the asynchronous unit test. - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithDynamicPaths_AndNoQueryString_ShouldRespondWith_200OK_First25RecordsAsync(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) - { - // Arrange - string conformanceId = Guid.NewGuid().ToString(); - string tokenEndpoint = $"{GenerateDynamicCtsUrl(IDENTITY_PROVIDER_DOWNSTREAM_BASE_URL, conformanceId)}/idp/connect/token"; - var getDataHolderBrandsUrl = $"{GenerateDynamicCtsUrl(DISCOVERY_DOWNSTREAM_BASE_URL, conformanceId)}/cdr-register/v1/{industry}/data-holders/brands"; - string expectedDataHolderBrandsUrl = ReplaceSecureHostName(getDataHolderBrandsUrl, DISCOVERY_DOWNSTREAM_BASE_URL); - - var expectedResponse = GetExpectedResponse(expectedDataHolderBrandsUrl, expectedDataHolderBrandsUrl, null, null, null, industry); - - // Arrange - Get access token - var accessToken = await new IntegrationTests.Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - Scope = "cdr-register:read", - Audience = ReplaceSecureHostName(tokenEndpoint, IDENTITY_PROVIDER_DOWNSTREAM_BASE_URL), - TokenEndPoint = tokenEndpoint, - CertificateThumbprint = DEFAULT_CERTIFICATE_THUMBPRINT, - CertificateCn = DEFAULT_CERTIFICATE_COMMON_NAME, - }.GetAsync(addCertificateToRequest: false); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = getDataHolderBrandsUrl, - AccessToken = accessToken, - XV = EndpointVersion, - CertificateThumbprint = DEFAULT_CERTIFICATE_THUMBPRINT, - CertificateCn = DEFAULT_CERTIFICATE_COMMON_NAME, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - if (response.StatusCode == HttpStatusCode.OK) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(api.XV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedResponse, response.Content); - } - } - } - - /// - /// The request with page-size and page query parameter should return with the expected page and record count. - /// - /// The industry to request. - /// The page. - /// The page size. - /// The expected status code. - /// A representing the asynchronous unit test. - [Theory] - [InlineData(null, null, 5, HttpStatusCode.NotFound)] - [InlineData("banking", null, 5)] - [InlineData("banking", 3, 5)] - [InlineData("banking", 6, 5)] - public async Task Get_WithPageSize_ShouldRespondWith_200OK_Page1Of5Records(string? industry, int? page = null, int? pageSize = 5, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) - { - await Test_QueryParameters_RespondWithExpectedStatusAndBody(null, page, pageSize, industry, expectedStatusCode); - } - - /// - /// The request with an updated-since query parameter should return the expected page and record count. - /// - /// The industry to request. - /// The value for updated-since query parameter. - /// The value for page query parameter. - /// The value for page-size query parameter. - /// The expected status code. - /// A representing the asynchronous unit test. - [Theory] - [InlineData(null, "2021-04-01T00:00:00Z", null, null, HttpStatusCode.NotFound)] - [InlineData("banking", "2021-04-01T00:00:00Z", 6, 5)] - [InlineData("banking", "2021-04-30T00:00:00Z", null, null)] - [InlineData("energy", "2021-04-30T00:00:00Z", null, null)] - [InlineData("non-bank-lending", "2021-04-30T00:00:00Z", null, null)] - [InlineData("telco", "2021-04-30T00:00:00Z", null, null)] - public async Task Get_WithUpdatedSince_ShouldRespondWith_200OK_ExpectedRecordCount(string? industry, string updatedSince, int? page = null, int? pageSize = 5, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) - { - var updatedSinceDate = DateTime.Parse(updatedSince, CultureInfo.InvariantCulture); - await Test_QueryParameters_RespondWithExpectedStatusAndBody(updatedSinceDate, page, pageSize, industry, expectedStatusCode); - } - - [Theory] - [InlineData("", HttpStatusCode.NotFound, null)] // "" is effectively no date so the filter will not take effect. It won't be invalid, it will be a 200 OK. - [InlineData("foo", HttpStatusCode.NotFound, null)] // abc in AC - [InlineData("32/32/2021", HttpStatusCode.NotFound, null)] - [InlineData("", HttpStatusCode.OK, "banking")] // "" is effectively no date so the filter will not take effect. It won't be invalid, it will be a 200 OK. - [InlineData("foo", HttpStatusCode.BadRequest, "banking")] // abc in AC - [InlineData("32/32/2021", HttpStatusCode.BadRequest, "banking")] - [InlineData("", HttpStatusCode.OK, "energy")] // "" is effectively no date so the filter will not take effect. It won't be invalid, it will be a 200 OK. - [InlineData("foo", HttpStatusCode.BadRequest, "energy")] // abc in AC - [InlineData("32/32/2021", HttpStatusCode.BadRequest, "energy")] - [InlineData("", HttpStatusCode.OK, "telco")] // "" is effectively no date so the filter will not take effect. It won't be invalid, it will be a 200 OK. - [InlineData("foo", HttpStatusCode.BadRequest, "telco")] // abc in AC - [InlineData("32/32/2021", HttpStatusCode.BadRequest, "telco")] - public async Task Get_WithUpdatedSinceInvalidDate_ShouldRespondWith_400BadRequest_InvalidDateTimeString(string updatedSince, HttpStatusCode expectedStatusCode, string? industry) - { - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands?updated-since={updatedSince}", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - // Assert - Check error response - if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.NotFound) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check error response - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/InvalidDateTime", - "title": "Invalid DateTime", - "detail": "updated-since should be valid DateTimeString", - } - ] - } - """; - await Assert_HasContent_Json(expectedContent, response.Content); - } - } - } - - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] // DF: this will be a 404 now. - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithMissingAccessToken_ShouldRespondWith_401Unauthorized(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.Unauthorized) - { - await Test_WithAccessToken_RespondsWithClientErrorStatusCode(null, industry, expectedStatusCode); - } - - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] // DF: this will be a 404 now. - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithInvalidAccessToken_ShouldRespondWith_401Unauthorized(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.Unauthorized) - { - await Test_WithAccessToken_RespondsWithClientErrorStatusCode("foo", industry, expectedStatusCode); - } - - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] // DF: this will be a 404 now. - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithExpiredAccessToken_ShouldRespondWith_401Unauthorized(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.Unauthorized) - { - // Arrange - // Expired at "Tuesday, May 18, 2021 11:33:45 PM GMT+10:00" - var accessToken = "eyJhbGciOiJQUzI1NiIsImtpZCI6IkFBMjRGMTg1RUUzRjY3NTA0ODA4RkM0RTI2QjEzNUI5OUU2M0JEQTkiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJxaVR4aGU0X1oxQklDUHhPSnJFMXVaNWp2YWsifQ.eyJuYmYiOjE2MjEzNDQ1MjUsImV4cCI6MTYyMTM0NDgyNSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NzAwMC9pZHAiLCJhdWQiOiJjZHItcmVnaXN0ZXIiLCJjbGllbnRfaWQiOiI2ZjdhMWI4ZS04Nzk5LTQ4YTgtOTAxMS1lMzkyMDM5MWY3MTMiLCJqdGkiOiJDODRBNTM5MTA2QjI4NUJBODI2RjZGMDQ3MjU4RjBBNCIsImlhdCI6MTYyMTM0NDUyNSwic2NvcGUiOlsiY2RyLXJlZ2lzdGVyOmJhbms6cmVhZCJdLCJjbmYiOnsieDV0I1MyNTYiOiI1OEQ3NkY3QTYxQ0Q3MjZEQTFDNTRGNjg5OEU4RTY5RUE0Qzg4MDYwIn19.RTU-zrqkb-WXcJzCz62SJ4h19lj8MDyGcvLOmg0qx05WFbAsY4mEP3gsoqM1LJfq4ncw7RqSvbkCNQQ-NOnyoBHF8MGe7mzdUh3YrD0_lTg20Dkx1-l044svtP_CKTI3rXT3bZaYWce0Tb1s3mrJzfN3ja23o93FGR-wbIwHp2347b0DxjznpKBw5meLhAjS7OCx6_uMm1la6IziSQgqMd2WaA-od7w8J5br-Nn-QZZi7X1KGiPEKFDFNk8KrUdPc4NCH6t7f-Sbc34KNNEWfAOJkWdDrmsBaifSlWvSlS4nUnurGHYkmimA2JUuv3ZTqzCcLRamEER1ZoTcIs_PDw"; - - await Test_WithAccessToken_RespondsWithClientErrorStatusCode(accessToken, industry, expectedStatusCode); - } - - [Theory] - [InlineData(null, HttpStatusCode.NotFound)] - [InlineData("banking")] - [InlineData("energy")] - [InlineData("non-bank-lending")] - [InlineData("telco")] - public async Task Get_WithDifferentHolderOfKey_ShouldRespondWith_401Unauthorized(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.Unauthorized) - { - // Arrange - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = ADDITIONAL_CERTIFICATE_FILENAME, // ie different holder of key - CertificatePassword = ADDITIONAL_CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - } - } - - [Theory] - [InlineData("", HttpStatusCode.NotFound, null)] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.NotFound, null)] - [InlineData("-1", HttpStatusCode.NotFound, null)] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.NotFound, null)] - [InlineData("foo", HttpStatusCode.NotFound, null)] - [InlineData("", HttpStatusCode.OK, "banking")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "banking")] - [InlineData("-1", HttpStatusCode.BadRequest, "banking")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "banking")] - [InlineData("foo", HttpStatusCode.BadRequest, "banking")] - [InlineData("", HttpStatusCode.OK, "energy")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "energy")] - [InlineData("-1", HttpStatusCode.BadRequest, "energy")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "energy")] - [InlineData("foo", HttpStatusCode.BadRequest, "energy")] - [InlineData("", HttpStatusCode.OK, "non-bank-lending")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("-1", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("foo", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("", HttpStatusCode.OK, "telco")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "telco")] - [InlineData("-1", HttpStatusCode.BadRequest, "telco")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "telco")] - [InlineData("foo", HttpStatusCode.BadRequest, "telco")] - public async Task Get_WithInvalidPageSize_ShouldRespondWith_400BadRequest_PageSizeMustBePositiveInteger(string pageSize, HttpStatusCode expectedStatusCode, string? industry) - { - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/InvalidPageSize", - "title": "Invalid Page Size", - "detail": "Page size not a positive Integer", - } - ] - } - """; - await Test_EndpointRespondsSuccessfullyOrWithExpectedError( - $"page-size={pageSize}", - expectedStatusCode, - expectedContent, - industry); - } - - [Theory] - [InlineData("", HttpStatusCode.NotFound, null)] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.NotFound, null)] - [InlineData("-1", HttpStatusCode.NotFound, null)] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.NotFound, null)] - [InlineData("foo", HttpStatusCode.NotFound, null)] - [InlineData("", HttpStatusCode.OK, "banking")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "banking")] - [InlineData("-1", HttpStatusCode.BadRequest, "banking")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "banking")] - [InlineData("foo", HttpStatusCode.BadRequest, "banking")] - [InlineData("", HttpStatusCode.OK, "energy")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "energy")] - [InlineData("-1", HttpStatusCode.BadRequest, "energy")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "energy")] - [InlineData("foo", HttpStatusCode.BadRequest, "energy")] - [InlineData("", HttpStatusCode.OK, "non-bank-lending")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("-1", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("foo", HttpStatusCode.BadRequest, "non-bank-lending")] - [InlineData("", HttpStatusCode.OK, "telco")] // "" is effectively not providing a page-size, so it will default to 25. - [InlineData("0", HttpStatusCode.BadRequest, "telco")] - [InlineData("-1", HttpStatusCode.BadRequest, "telco")] - [InlineData("99999999999999999999999999999999999999999999999999", HttpStatusCode.BadRequest, "telco")] - [InlineData("foo", HttpStatusCode.BadRequest, "telco")] - public async Task Get_WithInvalidPage_ShouldRespondWith_400BadRequest_PageMustBePositiveInteger(string page, HttpStatusCode expectedStatusCode, string? industry) - { - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/Invalid", - "title": "Invalid Field", - "detail": "Page not a positive integer", - } - ] - } - """; - await Test_EndpointRespondsSuccessfullyOrWithExpectedError( - $"page={page}", - expectedStatusCode, - expectedContent, - industry); - } - - [Theory] - [InlineData(EndpointVersion, null, HttpStatusCode.NotFound)] - [InlineData(EndpointVersion, "banking")] - [InlineData(EndpointVersion, "energy")] - [InlineData(EndpointVersion, "non-bank-lending")] - [InlineData(EndpointVersion, "telco")] - public async Task Get_WithPageOutOfRange_ShouldRespondWith_400BadRequest_PageExceedsMaxNumberOfPages(string page, string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.BadRequest) - { - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/Invalid", - "title": "Invalid Field", - "detail": "Page is out of range", - } - ] - } - """; - await Test_EndpointRespondsSuccessfullyOrWithExpectedError( - $"page={page}", - expectedStatusCode, - expectedContent, - industry); - } - - [Theory] - [InlineData("1001", null, HttpStatusCode.NotFound)] - [InlineData("1001", "banking")] - [InlineData("1001", "energy")] - [InlineData("1001", "non-bank-lending")] - [InlineData("1001", "telco")] - public async Task Get_WithPageSizeTooLarge_ShouldRespondWith_400BadRequest_PageSizeTooLarge(string pageSize, string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.BadRequest) - { - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/Invalid", - "title": "Invalid Field", - "detail": "Page size too large", - } - ] - } - """; - await Test_EndpointRespondsSuccessfullyOrWithExpectedError( - $"page-size={pageSize}", - expectedStatusCode, - expectedContent, - industry); - } - - [Theory] - [InlineData(1, HttpStatusCode.NotFound, null)] // Active - [InlineData(2, HttpStatusCode.NotFound, null)] // Removed - [InlineData(3, HttpStatusCode.NotFound, null)] // Suspended - [InlineData(4, HttpStatusCode.NotFound, null)] // Revoked - [InlineData(5, HttpStatusCode.NotFound, null)] // Surrendered - [InlineData(6, HttpStatusCode.NotFound, null)] // Inactive - [InlineData(1, HttpStatusCode.OK, "banking")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "banking")] // Removed - [InlineData(3, HttpStatusCode.Forbidden, "banking")] // Suspended - [InlineData(4, HttpStatusCode.Forbidden, "banking")] // Revoked - [InlineData(5, HttpStatusCode.Forbidden, "banking")] // Surrendered - [InlineData(6, HttpStatusCode.Forbidden, "banking")] // Inactive - [InlineData(1, HttpStatusCode.OK, "energy")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "energy")] // Removed - [InlineData(3, HttpStatusCode.Forbidden, "energy")] // Suspended - [InlineData(4, HttpStatusCode.Forbidden, "energy")] // Revoked - [InlineData(5, HttpStatusCode.Forbidden, "energy")] // Surrendered - [InlineData(6, HttpStatusCode.Forbidden, "energy")] // Inactive - [InlineData(1, HttpStatusCode.OK, "non-bank-lending")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "non-bank-lending")] // Removed - [InlineData(3, HttpStatusCode.Forbidden, "non-bank-lending")] // Suspended - [InlineData(4, HttpStatusCode.Forbidden, "non-bank-lending")] // Revoked - [InlineData(5, HttpStatusCode.Forbidden, "non-bank-lending")] // Surrendered - [InlineData(6, HttpStatusCode.Forbidden, "non-bank-lending")] // Inactive - [InlineData(1, HttpStatusCode.OK, "telco")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "telco")] // Removed - [InlineData(3, HttpStatusCode.Forbidden, "telco")] // Suspended - [InlineData(4, HttpStatusCode.Forbidden, "telco")] // Revoked - [InlineData(5, HttpStatusCode.Forbidden, "telco")] // Surrendered - [InlineData(6, HttpStatusCode.Forbidden, "telco")] // Inactive - public async Task Get_WithDataRecipientNotActive_ShouldRespondWith_403Forbidden( - int participationStatusId, - HttpStatusCode expectedStatusCode, - string? industry) - { - var saveParticipationStatusId = GetParticipationStatusId(ParticipationId); - - await Test_EndpointValidatesAdrStatus( - expectedStatusCode, - beforeRequest: () => SetParticipationStatusId(ParticipationId, participationStatusId), - afterRequest: () => SetParticipationStatusId(ParticipationId, saveParticipationStatusId), - industry: industry); - } - - [Theory] - [InlineData(1, HttpStatusCode.NotFound, null)] // Active - [InlineData(2, HttpStatusCode.NotFound, null)] // Inactive - [InlineData(3, HttpStatusCode.NotFound, null)] // Removed - [InlineData(1, HttpStatusCode.OK, "banking")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "banking")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "banking")] // Removed - [InlineData(1, HttpStatusCode.OK, "energy")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "energy")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "energy")] // Removed - [InlineData(1, HttpStatusCode.OK, "non-bank-lending")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "non-bank-lending")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "non-bank-lending")] // Removed - [InlineData(1, HttpStatusCode.OK, "telco")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "telco")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "telco")] // Removed - public async Task Get_WithDataRecipientBrandNotActive_ShouldRespondWith_403Forbidden( - int brandStatusId, - HttpStatusCode expectedStatusCode, - string? industry) - { - int saveBrandStatusId = GetBrandStatusId(BrandId); - - await Test_EndpointValidatesAdrStatus( - expectedStatusCode, - beforeRequest: () => SetBrandStatusId(BrandId, brandStatusId), - afterRequest: () => SetBrandStatusId(BrandId, saveBrandStatusId), - industry: industry); - } - - [Theory] - [InlineData(1, HttpStatusCode.NotFound, null)] // Active - [InlineData(2, HttpStatusCode.NotFound, null)] // Inactive - [InlineData(3, HttpStatusCode.NotFound, null)] // Removed - [InlineData(1, HttpStatusCode.OK, "banking")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "banking")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "banking")] // Removed - [InlineData(1, HttpStatusCode.OK, "energy")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "energy")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "energy")] // Removed - [InlineData(1, HttpStatusCode.OK, "non-bank-lending")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "non-bank-lending")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "non-bank-lending")] // Removed - [InlineData(1, HttpStatusCode.OK, "telco")] // Active - [InlineData(2, HttpStatusCode.Forbidden, "telco")] // Inactive - [InlineData(3, HttpStatusCode.Forbidden, "telco")] // Removed - public async Task Get_WithDataRecipientSoftwareProductNotActive_ShouldRespondWith_403Forbidden( - int softwareProductStatusId, - HttpStatusCode expectedStatusCode, - string? industry) - { - int saveSoftwareProductStatusId = GetSoftwareProductStatusId(SoftwareProductId); - - await Test_EndpointValidatesAdrStatus( - expectedStatusCode, - beforeRequest: () => SetSoftwareProductStatusId(SoftwareProductId, softwareProductStatusId), - afterRequest: () => SetSoftwareProductStatusId(SoftwareProductId, saveSoftwareProductStatusId), - industry: industry); - } - - [Theory] - [InlineData("all")] - public async Task Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModified_ETag(string? industry) - { - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - // Arrange - Get brands and save the ETag - var expectedETag = (await new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - IfNoneMatch = null, // ie If-None-Match is not set - }.SendAsync()).Headers.GetValues("ETag").First().Trim('"'); - - // Act - Use Etag - var response = await new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - IfNoneMatch = expectedETag, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.NotModified); - - // Assert - No content - (await response.Content.ReadAsStringAsync()).Should().BeNullOrEmpty(); - } - } - - [Theory] - [InlineData("foo")] - public async Task Get_WithInvalidIndustry_ShouldRespondWith_400BadRequest(string industry) - { - // Arrange - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.BadRequest); - - // Assert - Check error response - if (response.StatusCode != HttpStatusCode.OK) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check error response - var expectedContent = @" - { - ""errors"": [ - { - ""code"": ""urn:au-cds:error:cds-all:Field/Invalid"", - ""title"": ""Invalid Field"", - ""detail"": ""industry"", - } - ] - }"; - await Assert_HasContent_Json(expectedContent, response.Content); - } - } - } - - [Theory] - [InlineData(null, "cdr-register:read", HttpStatusCode.NotFound)] // No industry - [InlineData("banking", "cdr-register:read", HttpStatusCode.OK)] - [InlineData("energy", "cdr-register:read", HttpStatusCode.OK)] - [InlineData("non-bank-lending", "cdr-register:read", HttpStatusCode.OK)] - [InlineData("telco", "cdr-register:read", HttpStatusCode.OK)] - public async Task Get_WithScope_ShouldRespondWith_200OK(string? industry, string scope, HttpStatusCode expectedStatusCode) - { - // Arrange - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - Scope = scope, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - } - } - - [Theory] - [InlineData(EndpointVersion, UnsupportedEndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Should return current version - x-min-v is ignored when > x-v - [InlineData(EndpointVersion, LegacyEndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Should return current version - x-v is supported and higher than x-min-v - [InlineData(EndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Should return current version - x-v is supported equal to x-min-v - [InlineData(UnsupportedEndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Should return current version - x-v is NOT supported and x-min-v is supported - [InlineData(EndpointVersion, UnsupportedEndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "BANKing")] // Valid. Should return current version - x-min-v is ignored when > x-v - [InlineData(EndpointVersion, LegacyEndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "Telco")] // Valid. Should return current version - x-v is supported and higher than x-min-v - [InlineData(EndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "energy")] // Valid. Should return current version - x-v is supported equal to x-min-v - [InlineData(EndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "mining")] // Invalid Industry - - [InlineData(EndpointVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v (not a positive integer) - [InlineData("99", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 - [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", EndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 - [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - - // Also check industry specific calls - [InlineData(UnsupportedEndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "", "banking")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported - [InlineData(UnsupportedEndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "", "energy")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported - [InlineData(UnsupportedEndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "", "non-bank-lending")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported - [InlineData(UnsupportedEndpointVersion, EndpointVersion, EndpointVersion, HttpStatusCode.OK, true, "", "telco")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported - - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "banking")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "energy")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "non-bank-lending")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "telco")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "banking")] // Invalid. x-v header is missing - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "energy")] // Invalid. x-v header is missing - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "non-bank-lending")] // Invalid. x-v header is missing - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "telco")] // Invalid. x-v header is missing - - public async Task ValidateVersionHeader(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expectedError, string industry = "all") - { - // Arrange - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = xv, - XMinV = minXv, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expectedError, response.Content); - } - } - } - - private static async Task Test_QueryParameters_RespondWithExpectedStatusAndBody( - DateTime? updatedSince, - int? queryPage, - int? queryPageSize, - string? industry = null, - HttpStatusCode expectedStatusCode = HttpStatusCode.OK) - { - static string GetUrl(string baseUrl, DateTime? updatedSince, int? queryPage, int? queryPageSize) - { - // Build query - var query = new KeyValuePairBuilder(); - - if (updatedSince != null) - { - query.Add("updated-since", ((DateTime)updatedSince).ToString("yyyy-MM-ddTHH:mm:ssZ")); - } - - if (queryPage != null) - { - query.Add("page", queryPage.Value); - } - - if (queryPageSize != null) - { - query.Add("page-size", queryPageSize.Value); - } - - return query.Count > 0 ? - $"{baseUrl}?{query.Value}" : - baseUrl; - } - - // Arrange - var baseUrl = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands"; - var url = GetUrl(baseUrl, updatedSince, queryPage, queryPageSize); - - var expectedResponse = GetExpectedResponse(baseUrl, url, updatedSince, queryPage, queryPageSize, industry); - - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = url, - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - if (response.StatusCode == HttpStatusCode.OK) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(api.XV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedResponse, response.Content); - } - } - } - - private static string GetExpectedResponse(string baseUrl, string selfUrl, DateTime? updatedSince, int? requestedPage, int? requestedPageSize, string? industry = null) - { - static string Link(string baseUrl, DateTime? updatedSince, int? page = null, int? pageSize = null) - { - var query = new KeyValuePairBuilder(); - - if (updatedSince != null) - { - query.Add("updated-since", ((DateTime)updatedSince).ToString("yyyy-MM-ddTHH\\%3Amm\\%3Ass.fffffffZ")); - } - - if (page != null) - { - query.Add("page", page.Value); - } - - if (pageSize != null) - { - query.Add("page-size", pageSize.Value); - } - - return query.Count == 0 ? - baseUrl : - $"{baseUrl}?{query.Value}"; - } - - if (industry == "all") - { - industry = null; // treat "all" same as no industry - } - - var page = requestedPage ?? 1; - var pageSize = requestedPageSize ?? 25; - - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var allData = dbContext.Brands.AsNoTracking() - .Include(brand => brand.Endpoint) - .Include(brand => brand.BrandStatus) - .Include(brand => brand.AuthDetails) - .ThenInclude(authDetail => authDetail.RegisterUType) - .Include(brand => brand.Participation.LegalEntity.OrganisationType) - .Include(brand => brand.Participation.Industry) - .Where(brand => - brand.Participation.ParticipationTypeId == ParticipationTypes.Dh && - (industry == null || (industry != null && brand.Participation.Industry.IndustryTypeCode == industry))) - .Where(brand => brand.Participation.StatusId == ParticipationStatusType.Active) - .Where(brand => brand.BrandStatusId == BrandStatusType.Active) - .Where(brand => updatedSince == null || brand.LastUpdated > updatedSince); - - var totalRecords = allData.Count(); - var totalPages = (int)Math.Ceiling((double)totalRecords / pageSize); - const int minPage = 1; - if (page < minPage) - { - throw new Exception($"Page {page} out of range. Min Page is {minPage}"); - } - - var maxPage = ((totalRecords - 1) / pageSize) + 1; - if (page > maxPage) - { - throw new Exception($"Page {page} out of range. Max Page is {maxPage} (Records={totalRecords}, PageSize={pageSize})"); - } - - var data = allData - .OrderBy(brand => brand.BrandName).ThenBy(brand => brand.BrandId) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .Select(brand => new - { - dataHolderBrandId = brand.BrandId, - brandName = brand.BrandName, - brandGroup = brand.BrandGroup, - industries = new string[] { brand.Participation.Industry.IndustryTypeCode.ToLower() }, - logoUri = brand.LogoUri, - legalEntity = new - { - legalEntityId = brand.Participation.LegalEntity.LegalEntityId, - legalEntityName = brand.Participation.LegalEntity.LegalEntityName, - logoUri = brand.Participation.LegalEntity.LogoUri, - registrationNumber = brand.Participation.LegalEntity.RegistrationNumber, - registrationDate = brand.Participation.LegalEntity.RegistrationDate == null ? null : brand.Participation.LegalEntity.RegistrationDate.Value.ToString("yyyy-MM-dd"), - registeredCountry = brand.Participation.LegalEntity.RegisteredCountry, - abn = brand.Participation.LegalEntity.Abn, - acn = brand.Participation.LegalEntity.Acn, - arbn = brand.Participation.LegalEntity.Arbn, - anzsicDivision = brand.Participation.LegalEntity.AnzsicDivision, - organisationType = brand.Participation.LegalEntity.OrganisationType.OrganisationTypeCode, - status = brand.Participation.Status.ParticipationStatusCode.ToUpper(), - }, - status = brand.BrandStatus.BrandStatusCode, - endpointDetail = new - { - version = brand.Endpoint.Version, - publicBaseUri = brand.Endpoint.PublicBaseUri, - productBaseUri = brand.Endpoint.ProductBaseUri, - resourceBaseUri = brand.Endpoint.ResourceBaseUri, - infosecBaseUri = brand.Endpoint.InfosecBaseUri, - extensionBaseUri = brand.Endpoint.ExtensionBaseUri, - websiteUri = brand.Endpoint.WebsiteUri, - }, - authDetails = brand.AuthDetails.Select(authDetails => new - { - registerUType = authDetails.RegisterUType.RegisterUTypeCode, - jwksEndpoint = authDetails.JwksEndpoint, - }), - lastUpdated = brand.LastUpdated.ToString("yyyy-MM-ddTHH:mm:ssZ"), - }) - .ToList(); - - var expectedResponse = new - { - data, - links = new - { - first = totalPages == 0 ? - null : - Link(baseUrl, updatedSince, 1, pageSize), - last = totalPages == 0 ? - null : - Link(baseUrl, updatedSince, totalPages, pageSize), - next = totalPages == 0 || page == totalPages ? - null : - Link(baseUrl, updatedSince, page + 1, pageSize), - prev = totalPages == 0 || page == 1 ? - null : - Link(baseUrl, updatedSince, page - 1, pageSize), - self = selfUrl, - }, - meta = new - { - totalRecords, - totalPages, - }, - }; - - return JsonConvert.SerializeObject(expectedResponse); - } - - /// - /// Ensures that the endpoint responds with the expected client error status code for a given access token. - /// - /// The access token. - /// The industry. - /// The expected status code. - /// A representing the asynchronous operation. - private static async Task Test_WithAccessToken_RespondsWithClientErrorStatusCode(string? accessToken, string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.Unauthorized) - { - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - } - } - - /// - /// Validate that the request with the given query string and valid authorization responds successfully, or with an appropriate error message. - /// - /// The query string to test. - /// The expected response status. - /// The expected response error content. - /// The industry. - /// A representing the asynchronous operation. - private static async Task Test_EndpointRespondsSuccessfullyOrWithExpectedError(string queryString, HttpStatusCode expectedStatusCode, string expectedContent, string? industry) - { - // Arrange - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands?{queryString}", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - // Assert - Check error response - if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.NotFound) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check error response - await Assert_HasContent_Json(expectedContent, response.Content); - } - } - } - - /// - /// Validates the ADR status is validated. - /// - /// The expected response status. - /// Set up actions to change state prior to making the request. - /// Post-request actions to reset state. - /// The industry. - /// A representing the asynchronous operation. - private static async Task Test_EndpointValidatesAdrStatus( - HttpStatusCode expectedStatusCode, - BeforeRequest? beforeRequest, - AfterRequest? afterRequest, - string? industry) - { - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-holders/brands", - AccessToken = accessToken, - XV = EndpointVersion, - }; - - beforeRequest?.Invoke(); - try - { - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - // Assert - Check error response - if (response.StatusCode != HttpStatusCode.OK && response.StatusCode != HttpStatusCode.NotFound) - { - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check error response - var expectedContent = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Authorisation/AdrStatusNotActive", - "title": "ADR Status Is Not Active", - "detail": "", - } - ] - } - """; - await Assert_HasContent_Json(expectedContent, response.Content); - } - } - } - finally - { - afterRequest?.Invoke(); - } - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataRecipientsXV4_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataRecipientsXV4_MultiIndustry_Tests.cs deleted file mode 100644 index 02662c4..0000000 --- a/Source/CDR.Register.IntegrationTests/API/Discovery/GetDataRecipientsXV4_MultiIndustry_Tests.cs +++ /dev/null @@ -1,305 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using CDR.Register.Repository.Enums; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.Discovery -{ - /// - /// Integration tests for GetDataRecipients. - /// - public class GetDataRecipientsXV4_MultiIndustry_Tests : BaseTest - { - /// - /// The current endpoint version under test. - /// - private const string SupportedVersion = "4"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "3"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "5"; - - public GetDataRecipientsXV4_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : base(outputHelper, testFixture) - { - } - - [Theory] - [InlineData(SupportedVersion, "all")] - public async Task Get_WithXV_ShouldRespondWith_200OK_DataRecipients(string xv, string industry) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients"; - var expectedDataRecipients = GetExpectedDataRecipients(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // // Assert - Check XV - Assert_HasHeader(xv, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipients, response.Content); - } - } - - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(SupportedVersion, "all")] - public async Task CTS_URL_Get_WithXV_ShouldRespondWith_200OK_DataRecipients(string xv, string industry) - { - // Arrange - var url = $"{GenerateDynamicCtsUrl(DISCOVERY_DOWNSTREAM_BASE_URL)}/cdr-register/v1/{industry}/data-recipients"; - var expectedDataRecipients = GetExpectedDataRecipients(ReplacePublicHostName(url, DISCOVERY_DOWNSTREAM_BASE_URL)); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // // Assert - Check XV - Assert_HasHeader(xv, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipients, response.Content); - } - } - - [Theory] - [InlineData(null)] // AC04 - [InlineData("foo")] // AC06 - public async Task Get_WithIfNoneMatch_ShouldRespondWith_200OK_ETag(string? ifNoneMatch) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/all/data-recipients"; - var expectedDataRecipients = GetExpectedDataRecipients(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = SupportedVersion, - IfNoneMatch = ifNoneMatch, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(SupportedVersion, response.Headers, "x-v"); - - // Assert - Check has any ETag - Assert_HasHeader(null, response.Headers, "ETag"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipients, response.Content); - } - } - - [Fact] - public async Task Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModified_ETag() - { - // Arrange - Get SoftwareProductsStatus and save the ETag - var expectedETag = (await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/all/data-recipients", - XV = SupportedVersion, - IfNoneMatch = null, // ie If-None-Match is not set - }.SendAsync()).Headers.GetValues("ETag").First().Trim('"'); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/all/data-recipients", - XV = SupportedVersion, - IfNoneMatch = expectedETag, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.NotModified); - - // Assert - No content - (await response.Content.ReadAsStringAsync()).Should().BeNullOrEmpty(); - } - } - - [Theory] - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is supported and higher than x-min-v - [InlineData(SupportedVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is supported equal to x-min-v - [InlineData(SupportedVersion, SupportedVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "banking")] // Invalid. Industry other than 'All' - [InlineData(SupportedVersion, LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "ENERGY")] // Invalid.Industry other than 'All' - [InlineData(SupportedVersion, LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "telCO")] // Invalid.Industry other than 'All' - [InlineData(SupportedVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "non-bank-lending")] // Invalid. Industry other than 'All' - [InlineData(SupportedVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "Mining")] // Invalid. Industry other than 'All' - [InlineData(LegacyEndpointVersion, "2", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "non-bank-lending")] // Invalid. Industry other than 'All' - [InlineData(UnsupportedEndpointVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is NOT supported and x-min-v is supported - [InlineData(SupportedVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData("99", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // invalid. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 3 - [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("2", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", SupportedVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 - [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - - public async Task VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError, string industry = "all") - { - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients", - XV = xv, - XMinV = minXv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expecetdError, response.Content); - } - } - } - - // Get expected data recipients - private static string GetExpectedDataRecipients(string url) - { - try - { - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var expectedDataRecipients = new - { - data = dbContext.Participations.AsNoTracking() - .Include(participation => participation.Status) - .Include(participation => participation.Industry) - .Include(participation => participation.LegalEntity) - .Include(participation => participation.Brands) - .ThenInclude(brand => brand.BrandStatus) - .Include(participation => participation.Brands) - .ThenInclude(brand => brand.SoftwareProducts) - .ThenInclude(softwareProduct => softwareProduct.Status) - .Where(participation => participation.ParticipationTypeId == ParticipationTypes.Dr) - .OrderBy(participation => participation.LegalEntityId) - .Select(participation => new - { - legalEntityId = participation.LegalEntityId, - legalEntityName = participation.LegalEntity.LegalEntityName, - accreditationNumber = participation.LegalEntity.AccreditationNumber, - accreditationLevel = participation.LegalEntity.AccreditationLevel.AccreditationLevelCode.ToUpper(), // DF: accreditation level should be uppercase. - logoUri = participation.LegalEntity.LogoUri, - dataRecipientBrands = participation.Brands.OrderBy(b => b.BrandId).Select(brand => new - { - dataRecipientBrandId = brand.BrandId, - brandName = brand.BrandName, - logoUri = brand.LogoUri, - softwareProducts = brand.SoftwareProducts.OrderBy(sp => sp.SoftwareProductId.ToString()).Select(softwareProduct => new - { - softwareProductId = softwareProduct.SoftwareProductId, - softwareProductName = softwareProduct.SoftwareProductName, - softwareProductDescription = softwareProduct.SoftwareProductDescription, - logoUri = softwareProduct.LogoUri, - status = softwareProduct.Status.SoftwareProductStatusCode, - }), - status = brand.BrandStatus.BrandStatusCode, - }), - status = participation.Status.ParticipationStatusCode, - lastUpdated = participation.Brands.OrderByDescending(brand => brand.LastUpdated).First().LastUpdated.ToString("yyyy-MM-ddTHH:mm:ssZ"), - }) - .ToList(), - - // DF: these are new properties that need to be included in the Get Data Recipients payload. - links = new - { - self = url, - }, - meta = new object(), - }; - - string result = JsonConvert.SerializeObject(expectedDataRecipients); - - return result; - } - catch (Exception ex) - { - throw new Exception($"Error getting expected data recipients - {ex.Message}"); - } - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/Discovery/US27560_GetDataRecipients_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Discovery/US27560_GetDataRecipients_MultiIndustry_Tests.cs index 92a4401..a7ce3ae 100644 --- a/Source/CDR.Register.IntegrationTests/API/Discovery/US27560_GetDataRecipients_MultiIndustry_Tests.cs +++ b/Source/CDR.Register.IntegrationTests/API/Discovery/US27560_GetDataRecipients_MultiIndustry_Tests.cs @@ -171,21 +171,21 @@ public async Task AC05_Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModi } [Theory] - [InlineData("3", "5", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v + [InlineData("3", "4", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v [InlineData("3", "2", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported and higher than x-min-v [InlineData("3", "3", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported equal to x-min-v - [InlineData("5", "3", "4", HttpStatusCode.BadRequest, true, "")] // Invalid. Should return v4 - x-v is NOT supported + [InlineData("4", "3", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported [InlineData("3", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) [InlineData("99", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData("5", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // invalid. x-v is not supported and x-min-v invalid - [InlineData("5", "5", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 3 + [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // invalid. x-v is not supported and x-min-v invalid + [InlineData("4", "4", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 3 [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("2", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("foo", "3", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData("5", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 + [InlineData("4", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing diff --git a/Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrands_MultiIndustry_Tests.cs similarity index 96% rename from Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests.cs rename to Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrands_MultiIndustry_Tests.cs index 71bde4e..efb6a88 100644 --- a/Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests.cs +++ b/Source/CDR.Register.IntegrationTests/API/Discovery/US27562_GetDataHolderBrands_MultiIndustry_Tests.cs @@ -21,12 +21,12 @@ namespace CDR.Register.IntegrationTests.API.Discovery /// /// Integration tests for GetDataHolderBrands. /// - public class US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests : BaseTest + public class US27562_GetDataHolderBrands_MultiIndustry_Tests : BaseTest { private const string BRANDID = "20C0864B-CEEF-4DE0-8944-EB0962F825EB"; private const string SOFTWAREPRODUCTID = "86ECB655-9EBA-409C-9BE3-59E7ADF7080D"; - public US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) + public US27562_GetDataHolderBrands_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) : base(outputHelper, testFixture) { } @@ -43,7 +43,6 @@ public US27562_GetDataHolderBrandsXV2_MultiIndustry_Tests(ITestOutputHelper outp [InlineData("banking")] [InlineData("energy")] [InlineData("telco")] - [InlineData("non-bank-lending", HttpStatusCode.BadRequest)] public async Task AC01_Get_WithNoQueryString_ShouldRespondWith_200OK_First25RecordsAsync(string? industry, HttpStatusCode expectedStatusCode = HttpStatusCode.OK) { await Test_AC01_AC02_AC03_AC04_AC05_AC06(null, null, null, industry, expectedStatusCode); @@ -575,7 +574,6 @@ public async Task ACX20_Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotMod [Theory] [InlineData("foo")] - [InlineData("non-bank-lending")] public async Task ACX01_Get_WithInvalidIndustry_ShouldRespondWith_400BadRequest(string industry) { // Arrange @@ -664,35 +662,32 @@ public async Task ACX02_Get_WithScope_ShouldRespondWith_200OK(string? industry, [Theory] [InlineData("2", "3", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-min-v is ignored when > x-v - [InlineData("2", "1", "2", HttpStatusCode.OK, true, "BANKing")] // Valid. Should return v2 - x-v is supported and higher than x-min-v - [InlineData("2", "2", "2", HttpStatusCode.OK, true, "tELCO")] // Valid. Should return v2 - x-v is supported equal to x-min-v + [InlineData("2", "1", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported and higher than x-min-v [InlineData("2", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported but there is a newer version + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported Z [InlineData("2", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v (not a positive integer) - [InlineData("2", "3", "2", HttpStatusCode.OK, true, "ENERGY")] // Valid. Should return v2 - x-min-v is ignored when > x-v [InlineData("99", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v (not a positive integer) - [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData("4", "4", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 + [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Unsupported. x-v is not supported and x-min-v invalid + [InlineData("3", "3", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("foo", "2", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData("4", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 + [InlineData("3", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing // Also check industry specific calls - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "", "banking")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "", "energy")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "", "telco")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported - [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "banking")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "energy")] // Unsupported. x-v is not supported and x-min-v invalid - [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "telco")] // Unsupported. x-v is not supported and x-min-v invalid + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "", "banking")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "", "energy")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "", "telco")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported + [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "banking")] // Unsupported. x-v is not supported and x-min-v invalid + [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "energy")] // Unsupported. x-v is not supported and x-min-v invalid + [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "telco")] // Unsupported. x-v is not supported and x-min-v invalid [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "banking")] // Invalid. x-v header is missing [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "energy")] // Invalid. x-v header is missing [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR, "telco")] // Invalid. x-v header is missing - [InlineData("2", null, "2", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "non-bank-lending")] // Invalid industry. Non-bank lending isn't supported for V2. public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError, string industry = "all") { @@ -859,7 +854,6 @@ static string Link(string baseUrl, DateTime? updatedSince, int? page = null, int .ThenInclude(authDetail => authDetail.RegisterUType) .Include(brand => brand.Participation.LegalEntity.OrganisationType) .Include(brand => brand.Participation.Industry) - .Where(brand => brand.Participation.Industry.IndustryTypeId != Industry.NONBANKLENDING) .Where(brand => brand.Participation.ParticipationTypeId == ParticipationTypes.Dh && (industry == null || (industry != null && brand.Participation.Industry.IndustryTypeCode == industry))) diff --git a/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.AccessTokenType.cs b/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.AccessTokenType.cs deleted file mode 100644 index fdcb9ae..0000000 --- a/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.AccessTokenType.cs +++ /dev/null @@ -1,15 +0,0 @@ -#nullable enable - -namespace CDR.Register.IntegrationTests.API.SSA -{ -public partial class GetSoftwareStatementAssertion_Tests - { - private enum AccessTokenType - { - ValidAccessToken, // Get and send valid access token - InvalidAccessToken, // Send an invalid access token - ExpiredAccessToken, // Send expired access token - NoAccessToken, // Don't send any access token - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.cs b/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.cs deleted file mode 100644 index f25e91c..0000000 --- a/Source/CDR.Register.IntegrationTests/API/SSA/GetSoftwareStatementAssertion_Tests.cs +++ /dev/null @@ -1,590 +0,0 @@ -using System; -using System.IdentityModel.Tokens.Jwt; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Azure.Core; -using CDR.Register.IntegrationTests.Extensions; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.IdentityModel.Tokens; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.SSA -{ - /// - /// Integration tests for GetSoftwareStatementAssertion. - /// - public partial class GetSoftwareStatementAssertion_Tests : BaseTest - { - /// - /// The supported version. - /// - private const string SupportedVersion = "4"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "3"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "5"; - - /// - /// The obsolete (not implemented) endpoint version, which isn't supported. - /// - private const string ObsoleteEndpointVersion = "2"; - - private const string BrandId = "20C0864B-CEEF-4DE0-8944-EB0962F825EB"; - private const string SoftwareProductId = "86ECB655-9EBA-409C-9BE3-59E7ADF7080D"; - - private const string ExpectedContentAdrStatusNotActive = @" - { - ""errors"": [ - { - ""code"": ""urn:au-cds:error:cds-all:Authorisation/AdrStatusNotActive"", - ""title"": ""ADR Status Is Not Active"", - ""detail"": """", - } - ] - }"; - - public GetSoftwareStatementAssertion_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : base(outputHelper, testFixture) - { - } - - private delegate void BeforeSSARequest(); - - private delegate void AfterSSARequest(); - - // Participation/Brand/SoftwareProduct Ids - private static string ParticipationId => GetParticipationId(BrandId); // lookup. - - [Theory] - [InlineData(SupportedVersion)] - public async Task GetSSA_WithXV1_ShouldRespondWith_200OK_V4ofSSA(string xv) - { - // Arrange - Get SoftwareProduct - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - var softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() - .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) - .SingleAsync(); - - // Arrange - Get access token - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - // Act - Send request to SSA API - var response = await new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/all/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa", - XV = xv.ToString(), - AccessToken = accessToken, - }.SendAsync(); - - await AssertSsa(response, softwareProduct, xv); - } - - [Theory] - [InlineData("all")] - public async Task GetSSA_WithDifferentIndustry_ShouldRespondWith_DifferentScopes(string industry) - { - // Arrange - Get SoftwareProduct - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - var softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() - .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) - .SingleAsync(); - - // Arrange - Get access token - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - // Act - Send request to SSA API - var response = await new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa", - XV = SupportedVersion, - AccessToken = accessToken, - }.SendAsync(); - - await AssertSsa(response, softwareProduct, SupportedVersion); - } - - [Theory] - [InlineData(1, HttpStatusCode.OK)] // Active - [InlineData(2, HttpStatusCode.Forbidden)] // Removed - [InlineData(3, HttpStatusCode.Forbidden)] // Suspended - [InlineData(4, HttpStatusCode.Forbidden)] // Revoked - [InlineData(5, HttpStatusCode.Forbidden)] // Surrendered - [InlineData(6, HttpStatusCode.Forbidden)] // Inactive - public async Task GetSSA_WithParticipationStatusNotActive_ShouldRespondWith_403Forbidden( - int participationStatusId, - HttpStatusCode expectedStatusCode) - { - int saveParticipationStatusId = GetParticipationStatusId(ParticipationId); - - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - expectedStatusCode, - beforeRequest: () => SetParticipationStatusId(ParticipationId, participationStatusId), - afterRequest: () => SetParticipationStatusId(ParticipationId, saveParticipationStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); - } - - [Theory] - [InlineData(1, HttpStatusCode.OK)] // Active - [InlineData(2, HttpStatusCode.Forbidden)] // Inactive - [InlineData(3, HttpStatusCode.Forbidden)] // Removed - public async Task GetSSA_WithBrandNotActive_ShouldRespondWith_403Forbidden( - int brandStatusId, - HttpStatusCode expectedStatusCode) - { - int saveBrandStatusId = GetBrandStatusId(BrandId); - - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - expectedStatusCode, - beforeRequest: () => SetBrandStatusId(BrandId, brandStatusId), - afterRequest: () => SetBrandStatusId(BrandId, saveBrandStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); - } - - [Theory] - [InlineData(1, HttpStatusCode.OK)] // Active - [InlineData(2, HttpStatusCode.Forbidden)] // Inactive - [InlineData(3, HttpStatusCode.Forbidden)] // Removed - public async Task GetSSA_WithSoftwareProductNotActive_ShouldRespondWith_403Forbidden( - int softwareProductStatusId, - HttpStatusCode expectedStatusCode) - { - int saveSoftwareProductStatusId = GetSoftwareProductStatusId(SoftwareProductId); - - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - expectedStatusCode, - beforeRequest: () => SetSoftwareProductStatusId(SoftwareProductId, softwareProductStatusId), - afterRequest: () => SetSoftwareProductStatusId(SoftwareProductId, saveSoftwareProductStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); - } - - [Theory] - [InlineData(SupportedVersion)] - public async Task GetSSA_WithNoAccessToken_ShouldRespondWith_401Unauthorized(string x_v) - { - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.Unauthorized, - AccessTokenType.NoAccessToken, - x_v: x_v); - } - - [Theory] - [InlineData(SupportedVersion)] - public async Task GetSSA_WithInvalidAccessToken_ShouldRespondWith_401Unauthorized(string x_v) - { - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.Unauthorized, - AccessTokenType.InvalidAccessToken, - x_v: x_v); - } - - [Theory] - [InlineData(SupportedVersion)] - public async Task GetSSA_WithExpiredAccessToken_ShouldRespondWith_401Unauthorized(string x_v) - { - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.Unauthorized, - AccessTokenType.ExpiredAccessToken, - x_v: x_v); - } - - [Fact] - public async Task GetSSA_DifferentHolderOfKey_ShouldRespondWith_401Unauthorized() - { - await Test_GetSSA( - ADDITIONAL_CERTIFICATE_FILENAME, - ADDITIONAL_CERTIFICATE_PASSWORD, - HttpStatusCode.Unauthorized, - getAccessTokenCertificateFilename: CERTIFICATE_FILENAME, - getAccessTokenCertificatePassword: CERTIFICATE_PASSWORD); - } - - [Theory] - [InlineData(SupportedVersion, "foo")] - public async Task GetSSA_InvalidSoftwareProductId_ShouldRespondWith_404NotFound(string xv, string softwareProductId) - { - var expectedContent = - $@" - {{ - ""errors"": [ - {{ - ""code"": ""urn:au-cds:error:cds-register:Field/InvalidSoftwareProduct"", - ""title"": ""Invalid Software Product"", - ""detail"": ""{softwareProductId}"", - }} - ] - }}"; - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.NotFound, - x_v: xv, - softwareProductId: softwareProductId, - expectedContent: expectedContent); - } - - [Theory] - [InlineData("")] - public async Task GetSSA_WithMissingSoftwareProductId_ShouldRespondWith_404NotFound(string softwareProductId) - { - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.NotFound, - x_v: "3", - softwareProductId: softwareProductId); - } - - [Fact] - public async Task GetSSA_WithRandomBrandId_ShouldRespondWith_404NotFound() - { - await Test_GetSSA( - CERTIFICATE_FILENAME, - CERTIFICATE_PASSWORD, - HttpStatusCode.NotFound, - brandId: Guid.NewGuid().ToString()); - } - - [Theory] - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is supported and higher than x-min-v - [InlineData(SupportedVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is supported equal to x-min-v - [InlineData(SupportedVersion, SupportedVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "banking")] // Invalid. Industry other than 'All' - [InlineData(SupportedVersion, LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "ENERGY")] // Invalid.Industry other than 'All' - [InlineData(SupportedVersion, LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "telCO")] // Invalid.Industry other than 'All' - [InlineData(SupportedVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "non-bank-lending")] // Invalid. Industry other than 'All' - [InlineData(SupportedVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "Mining")] // Invalid. Industry other than 'All' - [InlineData(LegacyEndpointVersion, "2", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "non-bank-lending")] // Invalid. Industry other than 'All' - [InlineData(UnsupportedEndpointVersion, SupportedVersion, "4", HttpStatusCode.OK, true, "")] // Valid. Should return v4 - x-v is NOT supported and x-min-v is supported - [InlineData(SupportedVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 4 - [InlineData(ObsoleteEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", SupportedVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 - [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - - public async Task ACX01_VersionHeaderValidation(string? xv, string? xminv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError, string industry = "all") - { - // Arrange - string url = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa"; - - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - }.GetAsync(); - - var api = new Infrastructure.Api - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - HttpMethod = HttpMethod.Get, - URL = url, - AccessToken = accessToken, - XV = xv, - XMinV = xminv, - }; - - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expecetdError, response.Content); - } - } - } - - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(SupportedVersion)] - public async Task CTS_URL_GetSSA_WithXV1_ShouldRespondWith_200OK_V4ofSSA(string xv) - { - string conformanceId = Guid.NewGuid().ToString(); - string tokenEndpoint = $"{GenerateDynamicCtsUrl(IDENTITY_PROVIDER_DOWNSTREAM_BASE_URL, conformanceId)}/idp/connect/token"; - string ssasEndpoint = $"{GenerateDynamicCtsUrl(SSA_DOWNSTREAM_BASE_URL, conformanceId)}/cdr-register/v1/all/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa"; - - // Arrange - Get SoftwareProduct - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - Repository.Entities.SoftwareProduct softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() - .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) - .SingleAsync(); - - // Arrange - Get access token - var accessToken = await new Infrastructure.AccessToken - { - CertificateFilename = CERTIFICATE_FILENAME, - CertificatePassword = CERTIFICATE_PASSWORD, - Scope = "cdr-register:read", - Audience = ReplaceSecureHostName(tokenEndpoint, IDENTITY_PROVIDER_DOWNSTREAM_BASE_URL), - TokenEndPoint = tokenEndpoint, - CertificateThumbprint = DEFAULT_CERTIFICATE_THUMBPRINT, - CertificateCn = DEFAULT_CERTIFICATE_COMMON_NAME, - }.GetAsync(addCertificateToRequest: false); - - // Act - Send request to SSA API - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = ssasEndpoint, - XV = xv.ToString(), - AccessToken = accessToken, - CertificateThumbprint = DEFAULT_CERTIFICATE_THUMBPRINT, - CertificateCn = DEFAULT_CERTIFICATE_COMMON_NAME, - }.SendAsync(); - - await AssertSsa(response, softwareProduct, xv); - } - - private static async Task AssertSsa(HttpResponseMessage response, Repository.Entities.SoftwareProduct softwareProduct, string xv) - { - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - if (response.StatusCode == HttpStatusCode.OK) - { - // Get the SSA JWKS from the Register. - var ssaJwks = await GetSsaJwks(); - - // Assert - Check XV - Assert_HasHeader(xv.ToString(), response.Headers, "x-v"); - - // Assert - SSA - var ssa = new JwtSecurityTokenHandler().ReadJwtToken(await response.Content.ReadAsStringAsync()); - - // Assert - SSA Header - ssa.Header.Alg.Should().Be("PS256"); - ssa.Header.Kid.Should().Be(ssaJwks.Keys[0].Kid); - ssa.Header.Typ.Should().Be("JWT"); - - // Assert - SSA Claims - ssa.AssertClaim("iss", "cdr-register"); - - ssa.AssertClaim("iat", null); - ssa.AssertClaim("exp", null); - long iat = Convert.ToInt64(ssa.Claim("iat").Value); - long exp = Convert.ToInt64(ssa.Claim("exp").Value); - exp.Should().Be(iat + 600); // Check expiry is 10 minutes (ie 600 seconds) - - ssa.AssertClaim("jti", null); - ssa.AssertClaim("org_id", softwareProduct.Brand.BrandId.ToString()); - ssa.AssertClaim("org_name", softwareProduct.Brand.BrandName); - ssa.AssertClaim("client_name", softwareProduct.SoftwareProductName); - ssa.AssertClaim("client_description", softwareProduct.SoftwareProductDescription); - ssa.AssertClaim("client_uri", softwareProduct.ClientUri); - ssa.AssertClaimIsArray("redirect_uris", softwareProduct.RedirectUris.Split(" ")); - ssa.AssertClaim("logo_uri", softwareProduct.LogoUri); - ssa.AssertClaim("tos_uri", softwareProduct.TosUri, true); - ssa.AssertClaim("policy_uri", softwareProduct.PolicyUri, true); - ssa.AssertClaim("jwks_uri", softwareProduct.JwksUri); - ssa.AssertClaim("revocation_uri", softwareProduct.RevocationUri); - ssa.AssertClaim("software_id", softwareProduct.SoftwareProductId.ToString()); - ssa.AssertClaim("software_roles", "data-recipient-software-product"); - ssa.AssertClaim("scope", softwareProduct.Scope); - - if (int.Parse(xv) >= 2) - { - ssa.AssertClaim("recipient_base_uri", softwareProduct.RecipientBaseUri); - } - - // Assert - Validate SSA Signature - var validationParameters = new TokenValidationParameters() - { - ValidateLifetime = true, - ClockSkew = TimeSpan.FromMinutes(2), - - RequireSignedTokens = true, - ValidateIssuerSigningKey = true, - IssuerSigningKey = ssaJwks.Keys[0], - - ValidateIssuer = true, - ValidIssuer = "cdr-register", - - ValidateAudience = false, - }; - - // Validate token (throws exception if token fails to validate) - new JwtSecurityTokenHandler().ValidateToken(ssa.RawData, validationParameters, out _); - } - } - } - - private static async Task Test_GetSSA( - string certificateFilename, - string certificatePassword, - HttpStatusCode expectedStatusCode, - AccessTokenType accessTokenType = AccessTokenType.ValidAccessToken, - BeforeSSARequest? beforeRequest = null, - AfterSSARequest? afterRequest = null, - string? x_v = "3", - string? x_min_v = null, - string? expectedContent = null, - string? getAccessTokenCertificateFilename = null, - string? getAccessTokenCertificatePassword = null, - string? expectedXV = null, - string? industry = "all", - string brandId = BrandId, - string softwareProductId = SoftwareProductId) - { - // Arrange - string url = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{brandId}/software-products/{softwareProductId}/ssa"; - - var accessToken = await GetAccessToken( - accessTokenType, - getAccessTokenCertificateFilename, - getAccessTokenCertificatePassword, - certificateFilename, - certificatePassword); - - var api = new Infrastructure.Api - { - CertificateFilename = certificateFilename, - CertificatePassword = certificatePassword, - HttpMethod = HttpMethod.Get, - URL = url, - AccessToken = accessToken, - XV = x_v, - XMinV = x_min_v, - }; - - beforeRequest?.Invoke(); - try - { - // Act - var response = await api.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedStatusCode); - - if (response.StatusCode == HttpStatusCode.OK) - { - // Assert - Check XV - Assert_HasHeader(expectedXV ?? x_v, response.Headers, "x-v"); - } - - // Assert - Check expected content - if (expectedContent != null) - { - await Assert_HasContent_Json(expectedContent, response.Content); - } - } - } - finally - { - afterRequest?.Invoke(); - } - } - - private static async Task GetAccessToken( - AccessTokenType accessTokenType, - string? getAccessTokenCertificateFilename, - string? getAccessTokenCertificatePassword, - string certificateFilename, - string certificatePassword) - { - // Access token - switch (accessTokenType) - { - case AccessTokenType.ValidAccessToken: - // Get the access token with the valid certificate. - return await new Infrastructure.AccessToken - { - CertificateFilename = getAccessTokenCertificateFilename ?? certificateFilename, - CertificatePassword = getAccessTokenCertificatePassword ?? certificatePassword, - }.GetAsync(); - - case AccessTokenType.InvalidAccessToken: - return "foo"; - - case AccessTokenType.ExpiredAccessToken: - // Represents an expired access token. - // "exp": 1621344825 - // Expired at "Tuesday, May 18, 2021 11:33:45 PM GMT+10:00" - return "eyJhbGciOiJQUzI1NiIsImtpZCI6IkFBMjRGMTg1RUUzRjY3NTA0ODA4RkM0RTI2QjEzNUI5OUU2M0JEQTkiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJxaVR4aGU0X1oxQklDUHhPSnJFMXVaNWp2YWsifQ.eyJuYmYiOjE2MjEzNDQ1MjUsImV4cCI6MTYyMTM0NDgyNSwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NzAwMC9pZHAiLCJhdWQiOiJjZHItcmVnaXN0ZXIiLCJjbGllbnRfaWQiOiI2ZjdhMWI4ZS04Nzk5LTQ4YTgtOTAxMS1lMzkyMDM5MWY3MTMiLCJqdGkiOiJDODRBNTM5MTA2QjI4NUJBODI2RjZGMDQ3MjU4RjBBNCIsImlhdCI6MTYyMTM0NDUyNSwic2NvcGUiOlsiY2RyLXJlZ2lzdGVyOmJhbms6cmVhZCJdLCJjbmYiOnsieDV0I1MyNTYiOiI1OEQ3NkY3QTYxQ0Q3MjZEQTFDNTRGNjg5OEU4RTY5RUE0Qzg4MDYwIn19.RTU-zrqkb-WXcJzCz62SJ4h19lj8MDyGcvLOmg0qx05WFbAsY4mEP3gsoqM1LJfq4ncw7RqSvbkCNQQ-NOnyoBHF8MGe7mzdUh3YrD0_lTg20Dkx1-l044svtP_CKTI3rXT3bZaYWce0Tb1s3mrJzfN3ja23o93FGR-wbIwHp2347b0DxjznpKBw5meLhAjS7OCx6_uMm1la6IziSQgqMd2WaA-od7w8J5br-Nn-QZZi7X1KGiPEKFDFNk8KrUdPc4NCH6t7f-Sbc34KNNEWfAOJkWdDrmsBaifSlWvSlS4nUnurGHYkmimA2JUuv3ZTqzCcLRamEER1ZoTcIs_PDw"; - - case AccessTokenType.NoAccessToken: - return null; - - default: - throw new NotSupportedException(); - } - } - - private static async Task GetSsaJwks() - { - var clientHandler = new HttpClientHandler(); - clientHandler.ServerCertificateCustomValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; - - var jwksClient = new HttpClient(clientHandler); - var jwksResponse = await jwksClient.GetAsync($"{TLS_BaseURL}/cdr-register/v1/jwks"); - return new JsonWebKeySet(await jwksResponse.Content.ReadAsStringAsync()); - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/SSA/US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/SSA/US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests.cs index 41c3bfb..6801377 100644 --- a/Source/CDR.Register.IntegrationTests/API/SSA/US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests.cs +++ b/Source/CDR.Register.IntegrationTests/API/SSA/US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests.cs @@ -23,10 +23,10 @@ namespace CDR.Register.IntegrationTests.API.SSA /// public partial class US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests : BaseTest { - private const string BrandId = "20C0864B-CEEF-4DE0-8944-EB0962F825EB"; - private const string SoftwareProductId = "86ECB655-9EBA-409C-9BE3-59E7ADF7080D"; + private const string BRANDID = "20C0864B-CEEF-4DE0-8944-EB0962F825EB"; + private const string SOFTWAREPRODUCTID = "86ECB655-9EBA-409C-9BE3-59E7ADF7080D"; - private const string ExpectedContentAdrStatusNotActive = @" + private const string EXPECTEDCONTENT_ADRSTATUSNOTACTIVE = @" { ""errors"": [ { @@ -47,7 +47,7 @@ public US27564_GetSoftwareStatementAssertion_MultiIndustry_Tests(ITestOutputHelp private delegate void AfterSSARequest(); // Participation/Brand/SoftwareProduct Ids - private static string ParticipationId => GetParticipationId(BrandId); // lookup. + private static string PARTICIPATIONID => GetParticipationId(BRANDID); // lookup. [Theory] [InlineData(3)] @@ -57,7 +57,7 @@ public async Task AC01_GetSSA_WithXV1_ShouldRespondWith_200OK_V3ofSSA(int xv) using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); var softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) + .Where(sp => sp.SoftwareProductId == new Guid(SOFTWAREPRODUCTID)) .SingleAsync(); // Arrange - Get access token @@ -73,7 +73,7 @@ public async Task AC01_GetSSA_WithXV1_ShouldRespondWith_200OK_V3ofSSA(int xv) CertificateFilename = CERTIFICATE_FILENAME, CertificatePassword = CERTIFICATE_PASSWORD, HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/all/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa", + URL = $"{MTLS_BaseURL}/cdr-register/v1/all/data-recipients/brands/{BRANDID}/software-products/{SOFTWAREPRODUCTID}/ssa", XV = xv.ToString(), AccessToken = accessToken, }.SendAsync(); @@ -92,7 +92,7 @@ public async Task ACX99_GetSSA_WithDifferentIndustry_ShouldRespondWith_Different using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); var softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) + .Where(sp => sp.SoftwareProductId == new Guid(SOFTWAREPRODUCTID)) .SingleAsync(); // Arrange - Get access token @@ -108,7 +108,7 @@ public async Task ACX99_GetSSA_WithDifferentIndustry_ShouldRespondWith_Different CertificateFilename = CERTIFICATE_FILENAME, CertificatePassword = CERTIFICATE_PASSWORD, HttpMethod = HttpMethod.Get, - URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa", + URL = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{BRANDID}/software-products/{SOFTWAREPRODUCTID}/ssa", XV = "3", AccessToken = accessToken, }.SendAsync(); @@ -127,15 +127,15 @@ public async Task AC03_GetSSA_WithParticipationStatusNotActive_ShouldRespondWith int participationStatusId, HttpStatusCode expectedStatusCode) { - int saveParticipationStatusId = GetParticipationStatusId(ParticipationId); + int saveParticipationStatusId = GetParticipationStatusId(PARTICIPATIONID); await Test_GetSSA( CERTIFICATE_FILENAME, CERTIFICATE_PASSWORD, expectedStatusCode, - beforeRequest: () => SetParticipationStatusId(ParticipationId, participationStatusId), - afterRequest: () => SetParticipationStatusId(ParticipationId, saveParticipationStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); + beforeRequest: () => SetParticipationStatusId(PARTICIPATIONID, participationStatusId), + afterRequest: () => SetParticipationStatusId(PARTICIPATIONID, saveParticipationStatusId), + expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : EXPECTEDCONTENT_ADRSTATUSNOTACTIVE); } [Theory] @@ -146,15 +146,15 @@ public async Task AC04_GetSSA_WithBrandNotActive_ShouldRespondWith_403Forbidden( int brandStatusId, HttpStatusCode expectedStatusCode) { - int saveBrandStatusId = GetBrandStatusId(BrandId); + int saveBrandStatusId = GetBrandStatusId(BRANDID); await Test_GetSSA( CERTIFICATE_FILENAME, CERTIFICATE_PASSWORD, expectedStatusCode, - beforeRequest: () => SetBrandStatusId(BrandId, brandStatusId), - afterRequest: () => SetBrandStatusId(BrandId, saveBrandStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); + beforeRequest: () => SetBrandStatusId(BRANDID, brandStatusId), + afterRequest: () => SetBrandStatusId(BRANDID, saveBrandStatusId), + expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : EXPECTEDCONTENT_ADRSTATUSNOTACTIVE); } [Theory] @@ -165,15 +165,15 @@ public async Task AC05_GetSSA_WithSoftwareProductNotActive_ShouldRespondWith_403 int softwareProductStatusId, HttpStatusCode expectedStatusCode) { - int saveSoftwareProductStatusId = GetSoftwareProductStatusId(SoftwareProductId); + int saveSoftwareProductStatusId = GetSoftwareProductStatusId(SOFTWAREPRODUCTID); await Test_GetSSA( CERTIFICATE_FILENAME, CERTIFICATE_PASSWORD, expectedStatusCode, - beforeRequest: () => SetSoftwareProductStatusId(SoftwareProductId, softwareProductStatusId), - afterRequest: () => SetSoftwareProductStatusId(SoftwareProductId, saveSoftwareProductStatusId), - expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : ExpectedContentAdrStatusNotActive); + beforeRequest: () => SetSoftwareProductStatusId(SOFTWAREPRODUCTID, softwareProductStatusId), + afterRequest: () => SetSoftwareProductStatusId(SOFTWAREPRODUCTID, saveSoftwareProductStatusId), + expectedContent: expectedStatusCode == HttpStatusCode.OK ? null : EXPECTEDCONTENT_ADRSTATUSNOTACTIVE); } [Theory] @@ -270,27 +270,28 @@ await Test_GetSSA( } [Theory] - [InlineData("3", "5", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v + [InlineData("3", "4", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v [InlineData("3", "2", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported and higher than x-min-v [InlineData("3", "3", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported equal to x-min-v + [InlineData("4", "3", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is NOT supported and x-min-v is supported [InlineData("3", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData("5", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData("5", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData("5", "5", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 3 + [InlineData("4", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) + [InlineData("4", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid + [InlineData("4", "4", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 3 [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("2", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("foo", "3", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData("5", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 + [InlineData("4", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 3 [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing public async Task ACX01_VersionHeaderValidation(string? xv, string? xminv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError) { // Arrange - string url = $"{MTLS_BaseURL}/cdr-register/v1/all/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa"; + string url = $"{MTLS_BaseURL}/cdr-register/v1/all/data-recipients/brands/{BRANDID}/software-products/{SOFTWAREPRODUCTID}/ssa"; var accessToken = await new Infrastructure.AccessToken { @@ -338,13 +339,13 @@ public async Task AC01_CTS_URL_GetSSA_WithXV1_ShouldRespondWith_200OK_V3ofSSA(in { string conformanceId = Guid.NewGuid().ToString(); string tokenEndpoint = $"{GenerateDynamicCtsUrl(IDENTITY_PROVIDER_DOWNSTREAM_BASE_URL, conformanceId)}/idp/connect/token"; - string ssasEndpoint = $"{GenerateDynamicCtsUrl(SSA_DOWNSTREAM_BASE_URL, conformanceId)}/cdr-register/v1/all/data-recipients/brands/{BrandId}/software-products/{SoftwareProductId}/ssa"; + string ssasEndpoint = $"{GenerateDynamicCtsUrl(SSA_DOWNSTREAM_BASE_URL, conformanceId)}/cdr-register/v1/all/data-recipients/brands/{BRANDID}/software-products/{SOFTWAREPRODUCTID}/ssa"; // Arrange - Get SoftwareProduct using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); Repository.Entities.SoftwareProduct softwareProduct = await dbContext.SoftwareProducts.AsNoTracking() .Include(sp => sp.Brand) - .Where(sp => sp.SoftwareProductId == new Guid(SoftwareProductId)) + .Where(sp => sp.SoftwareProductId == new Guid(SOFTWAREPRODUCTID)) .SingleAsync(); // Arrange - Get access token @@ -463,8 +464,8 @@ private static async Task Test_GetSSA( string? getAccessTokenCertificatePassword = null, string? expectedXV = null, string? industry = "all", - string brandId = BrandId, - string softwareProductId = SoftwareProductId) + string brandId = BRANDID, + string softwareProductId = SOFTWAREPRODUCTID) { // Arrange string url = $"{MTLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/{brandId}/software-products/{softwareProductId}/ssa"; diff --git a/Source/CDR.Register.IntegrationTests/API/Status/GetDataHolderStatusXV2_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Status/GetDataHolderStatusXV2_MultiIndustry_Tests.cs deleted file mode 100644 index b14160a..0000000 --- a/Source/CDR.Register.IntegrationTests/API/Status/GetDataHolderStatusXV2_MultiIndustry_Tests.cs +++ /dev/null @@ -1,347 +0,0 @@ -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using CDR.Register.IntegrationTests.API.Update; -using CDR.Register.Repository.Enums; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.Status -{ - /// - /// Integration tests for Get Data Holder Status V2 endpoints. - /// - public class GetDataHolderStatusXV2_MultiIndustry_Tests : BaseTest - { - /// - /// The supported industry in V3. - /// - private const string SupportedIndustry = "all"; - - /// - /// The supported version - 3. - /// - private const string SupportedVersion = "2"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "1"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "5"; - - public GetDataHolderStatusXV2_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : base(outputHelper, testFixture) - { - } - - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_ShouldRespondWith_200OK_DataHolderStatuses(string? xv, string expectedXV) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-holders/status"; - var expected = GetExpectedDataHolderStatuses(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expected, response.Content); - } - } - - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_WithDynamicPaths_ShouldRespondWith_200OK_DataHolderStatuses(string? xv, string expectedXV) - { - // Arrange - var url = $"{GenerateDynamicCtsUrl(STATUS_DOWNSTREAM_BASE_URL)}/cdr-register/v1/{SupportedIndustry}/data-holders/status"; - - var expectedUrl = ReplacePublicHostName(url, STATUS_DOWNSTREAM_BASE_URL); - - var expected = GetExpectedDataHolderStatuses(expectedUrl); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expected, response.Content); - } - } - - [Theory] - [InlineData(null)] - [InlineData("foo")] - public async Task Get_WithIfNoneMatch_ShouldRespondWith_200OK_ETag(string? ifNoneMatch) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-holders/status"; - var expected = GetExpectedDataHolderStatuses(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = SupportedVersion, - IfNoneMatch = ifNoneMatch, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(SupportedVersion, response.Headers, "x-v"); - - // Assert - Check has any ETag - Assert_HasHeader(null, response.Headers, "ETag"); - - // Assert - Check json - await Assert_HasContent_Json(expected, response.Content); - } - } - - [Fact] - public async Task Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModified_ETag() - { - // Arrange - Get SoftwareProductsStatus and save the ETag - var expectedETag = (await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-holders/status", - XV = SupportedVersion, - IfNoneMatch = null, // ie If-None-Match is not set - }.SendAsync()).Headers.GetValues("ETag").First().Trim('"'); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-holders/status", - XV = SupportedVersion, - IfNoneMatch = expectedETag, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.NotModified); - - // Assert - No content - (await response.Content.ReadAsStringAsync()).Should().BeNullOrEmpty(); - } - } - - [Theory] - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return supported version - x-min-v is ignored when > x-v - [InlineData(LegacyEndpointVersion, UnsupportedEndpointVersion, LegacyEndpointVersion, HttpStatusCode.BadRequest, true, "", "non-bank-lending")] // Invalid industry. x-v is supported but industry is not supported for this version - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return supported version - x-v is supported and higher than x-min-v - [InlineData(SupportedVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return supported version - x-v is supported equal to x-min-v - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "", "banking")] // Valid. Should return supported version as it supports 'Banking' industry. - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "", "energy")] // Valid. Should return supported version as it supports 'Energy' industry. - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "", "telco")] // Valid. Should return supported version as it supports 'Telco' industry. - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "", "non-bank-lending")] // Valid. Should return supported version as it supports 'Non-Bank Lending' industry. - [InlineData(SupportedVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData(SupportedVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed maximum supported version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than a supported version - [InlineData(SupportedVersion, LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALIDFIELD_INDUSTRY, "mining")] // Valid. Should return error code 400 - Bad Request - Invalid Path Parameter - [InlineData("", "", LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Should return supported version. - [InlineData("", UnsupportedEndpointVersion, LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Valid. empty header behaves like no header - [InlineData(null, UnsupportedEndpointVersion, LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Valid. No x-v header, defaults to v1. - [InlineData(LegacyEndpointVersion, UnsupportedEndpointVersion, LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Valid. Explicit v1 header to confirm API still supports v1 - - // Ensure the x-v is optional until v1 is no longer supported - [InlineData("", null, LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Invalid. x-v header is an empty string - [InlineData(null, null, LegacyEndpointVersion, HttpStatusCode.OK, true, "")] // Invalid. x-v header is missing - public async Task VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expectedError, string industry = "all") - { - // Arrange - var request = new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-holders/status", - XV = xv, - XMinV = minXv, - }; - - // Act - var response = await request.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expectedError, response.Content); - } - } - } - - [Theory] - [InlineData(LegacyEndpointVersion, "all")] // Explicit v1 - [InlineData(LegacyEndpointVersion, "banking")] // v1 - [InlineData(SupportedVersion, "all")] // v2 - [InlineData(SupportedVersion, "non-bank-lending")] // NBL v2 - [InlineData(SupportedVersion, "banking")] - - public async Task ValidateDataHolderStatusByIndustry(string? xv, string industry) - { - // Arrange - var request = new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-holders/status", - XV = xv, - }; - - // Act - var response = await request.SendAsync(); - - // Assert status code first - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - string expectedContent = string.Empty; - - if (string.IsNullOrEmpty(xv) || xv == LegacyEndpointVersion) - { - expectedContent = GetExpectedDataHolderStatusesLegacy(request.URL, industry); - } - else if (xv == SupportedVersion) - { - expectedContent = GetExpectedDataHolderStatuses(request.URL, industry); - } - - await Assert_HasContent_Json(expectedContent, response.Content); - } - - private static string GetExpectedDataHolderStatuses(string url, string industry = SupportedIndustry) - { - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var expectedDataHolderStatuses = new - { - data = dbContext.Participations.AsNoTracking() - .Include(p => p.Status) - .Where(p => p.ParticipationTypeId == ParticipationTypes.Dh) - .Where(p => p.Industry.IndustryTypeCode == industry || industry == "all") - - .Select(p => new - { - legalEntityId = p.LegalEntityId, - status = p.Status.ParticipationStatusCode, - }) - .OrderBy(p => p.legalEntityId) - .ToList(), - links = new - { - self = url, - }, - meta = new object(), - }; - - return JsonConvert.SerializeObject(expectedDataHolderStatuses); - } - - private static string GetExpectedDataHolderStatusesLegacy(string url, string industry = SupportedIndustry) - { - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var expectedDataHolderStatuses = new - { - data = dbContext.Participations.AsNoTracking() - .Include(p => p.Status) - .Where(p => p.ParticipationTypeId == ParticipationTypes.Dh) - .Where(p => p.Industry.IndustryTypeCode == industry || industry == "all") - .Where(p => p.Industry.IndustryTypeCode != "non-bank-lending") - .Select(p => new - { - legalEntityId = p.LegalEntityId, - status = p.Status.ParticipationStatusCode, - }) - .OrderBy(p => p.legalEntityId) - .ToList(), - links = new - { - self = url, - }, - meta = new object(), - }; - - return JsonConvert.SerializeObject(expectedDataHolderStatuses); - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/Status/GetDataRecipientStatusXV3_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Status/GetDataRecipientStatusXV3_MultiIndustry_Tests.cs deleted file mode 100644 index 2fbd3f6..0000000 --- a/Source/CDR.Register.IntegrationTests/API/Status/GetDataRecipientStatusXV3_MultiIndustry_Tests.cs +++ /dev/null @@ -1,272 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using CDR.Register.Repository.Enums; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.Status -{ - /// - /// Integration tests for GetDataRecipientStatus V3 endpoints. - /// - public class GetDataRecipientStatusXV3_MultiIndustry_Tests : BaseTest - { - /// - /// The supported industry in V3. - /// - private const string SupportedIndustry = "all"; - - /// - /// The supported version - 3. - /// - private const string SupportedVersion = "3"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "2"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "4"; - - public GetDataRecipientStatusXV3_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : base(outputHelper, testFixture) - { - } - - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_ShouldRespondWith_200OK_DataRecipientsStatus(string? xv, string expectedXV) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/status"; - var expectedDataRecipientStatus = GetExpectedDataRecipientsStatus(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipientStatus, response.Content); - } - } - - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_WithDynamicPaths_ShouldRespondWith_200OK_DataRecipientsStatus(string? xv, string expectedXV) - { - // Arrange - var url = $"{GenerateDynamicCtsUrl(STATUS_DOWNSTREAM_BASE_URL)}/cdr-register/v1/{SupportedIndustry}/data-recipients/status"; - - var expectedUrl = ReplacePublicHostName(url, STATUS_DOWNSTREAM_BASE_URL); - - var expectedDataRecipientStatus = GetExpectedDataRecipientsStatus(expectedUrl); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipientStatus, response.Content); - } - } - - [Theory] - [InlineData(null)] - [InlineData("foo")] - public async Task Get_WithIfNoneMatch_ShouldRespondWith_200OK_ETag(string? ifNoneMatch) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/status"; - var expectedDataRecipientsStatus = GetExpectedDataRecipientsStatus(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = SupportedVersion, - IfNoneMatch = ifNoneMatch, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(SupportedVersion, response.Headers, "x-v"); - - // Assert - Check has any ETag - Assert_HasHeader(null, response.Headers, "ETag"); - - // Assert - Check json - await Assert_HasContent_Json(expectedDataRecipientsStatus, response.Content); - } - } - - [Fact] - public async Task Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModified_ETag() - { - // Arrange - Get SoftwareProductsStatus and save the ETag - var expectedETag = (await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/status", - XV = SupportedVersion, - IfNoneMatch = null, // ie If-None-Match is not set - }.SendAsync()).Headers.GetValues("ETag").First().Trim('"'); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/status", - XV = SupportedVersion, - IfNoneMatch = expectedETag, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.NotModified); - - // Assert - No content - (await response.Content.ReadAsStringAsync()).Should().BeNullOrEmpty(); - } - } - - [Theory] - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "banking")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "Energy")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "TELCO")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, "1", SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported and higher than x-min-v - [InlineData(SupportedVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData(UnsupportedEndpointVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "banking")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData(UnsupportedEndpointVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "", "all")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData(SupportedVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData(SupportedVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed maximum supported version - [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed maximum supported version - [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - - public async Task VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError, string industry = "all") - { - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/status", - XV = xv, - XMinV = minXv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expecetdError, response.Content); - } - } - } - - private static string GetExpectedDataRecipientsStatus(string url) - { - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var expectedDataRecipientsStatus = new - { - data = dbContext.Participations.AsNoTracking() - .Include(p => p.Status) - .Where(p => p.ParticipationTypeId == ParticipationTypes.Dr) - .Select(p => new - { - legalEntityId = p.LegalEntityId, - status = p.Status.ParticipationStatusCode, - }) - .OrderBy(p => p.legalEntityId.ToString()) - .ToList(), - links = new - { - self = url, - }, - meta = new object(), - }; - - return JsonConvert.SerializeObject(expectedDataRecipientsStatus); - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/Status/GetSoftwareProductStatusXV3_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Status/GetSoftwareProductStatusXV3_MultiIndustry_Tests.cs deleted file mode 100644 index 8d80022..0000000 --- a/Source/CDR.Register.IntegrationTests/API/Status/GetSoftwareProductStatusXV3_MultiIndustry_Tests.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using CDR.Register.Repository.Infrastructure; -using FluentAssertions; -using FluentAssertions.Execution; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using Xunit; -using Xunit.Abstractions; - -#nullable enable - -namespace CDR.Register.IntegrationTests.API.Status -{ - /// - /// Integration tests for GetSoftwareProductStatus v3 endpoints. - /// - public class GetSoftwareProductStatusXV3_MultiIndustry_Tests : BaseTest - { - /// - /// The supported industry in V3. - /// - private const string SupportedIndustry = "all"; - - /// - /// The supported version - 3. - /// - private const string SupportedVersion = "3"; - - /// - /// The previous endpoint version which is still supported. - /// - private const string LegacyEndpointVersion = "2"; - - /// - /// The future (not implemented) endpoint version, which isn't supported. - /// - private const string UnsupportedEndpointVersion = "4"; - - public GetSoftwareProductStatusXV3_MultiIndustry_Tests(ITestOutputHelper outputHelper, TestFixture testFixture) - : base(outputHelper, testFixture) - { - } - - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_ShouldRespondWith_200OK_SoftwareProductStatus(string? xv, string expectedXV) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/brands/software-products/status"; - var expectedSoftwareProductsStatus = GetExpectedSoftwareProductStatus(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedSoftwareProductsStatus, response.Content); - } - } - - [Trait("Category", "CTSONLY")] - [Theory] - [InlineData(SupportedVersion, SupportedVersion)] - public async Task Get_WithDynamicPaths_ShouldRespondWith_200OK_SoftwareProductStatus(string? xv, string expectedXV) - { - // Arrange - var url = $"{GenerateDynamicCtsUrl(STATUS_DOWNSTREAM_BASE_URL)}/cdr-register/v1/{SupportedIndustry}/data-recipients/brands/software-products/status"; - var expectedUrl = ReplacePublicHostName(url, STATUS_DOWNSTREAM_BASE_URL); - - var expectedSoftwareProductsStatus = GetExpectedSoftwareProductStatus(expectedUrl); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = xv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(expectedXV, response.Headers, "x-v"); - - // Assert - Check json - await Assert_HasContent_Json(expectedSoftwareProductsStatus, response.Content); - } - } - - [Theory] - [InlineData(null)] - [InlineData("foo")] - public async Task Get_WithIfNoneMatch_ShouldRespondWith_200OK_ETag(string? ifNoneMatch) - { - // Arrange - var url = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/brands/software-products/status"; - var expectedSoftwareProductsStatus = GetExpectedSoftwareProductStatus(url); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = url, - XV = SupportedVersion, - IfNoneMatch = ifNoneMatch, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - // Assert - Check XV - Assert_HasHeader(SupportedVersion, response.Headers, "x-v"); - - // Assert - Check has any ETag - Assert_HasHeader(null, response.Headers, "ETag"); - - // Assert - Check json - await Assert_HasContent_Json(expectedSoftwareProductsStatus, response.Content); - } - } - - [Fact] - public async Task Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModified_ETag() - { - // Arrange - Get SoftwareProductsStatus and save the ETag - var expectedETag = (await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/brands/software-products/status", - XV = SupportedVersion, - IfNoneMatch = null, // ie If-None-Match is not set - }.SendAsync()).Headers.GetValues("ETag").First().Trim('"'); - - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{SupportedIndustry}/data-recipients/brands/software-products/status", - XV = SupportedVersion, - IfNoneMatch = expectedETag, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.NotModified); - - // Assert - No content - (await response.Content.ReadAsStringAsync()).Should().BeNullOrEmpty(); - } - } - - [Theory] - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "banking")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "Energy")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, UnsupportedEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "TELCO")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData(SupportedVersion, "1", SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-v is supported and higher than x-min-v - [InlineData(SupportedVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData(UnsupportedEndpointVersion, LegacyEndpointVersion, SupportedVersion, HttpStatusCode.BadRequest, true, "", "banking")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData(UnsupportedEndpointVersion, SupportedVersion, SupportedVersion, HttpStatusCode.OK, true, "", "all")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData(SupportedVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) - [InlineData(UnsupportedEndpointVersion, "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) - [InlineData(SupportedVersion, "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData(UnsupportedEndpointVersion, UnsupportedEndpointVersion, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed maximum supported version - [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version - [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v - [InlineData("foo", LegacyEndpointVersion, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v - [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData(UnsupportedEndpointVersion, null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed maximum supported version - [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string - [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - public async Task VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expectedError, string industry = SupportedIndustry) - { - // Act - var response = await new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/software-products/status", - XV = xv, - XMinV = minXv, - }.SendAsync(); - - // Assert - using (new AssertionScope()) - { - // Assert - Check status code - response.StatusCode.Should().Be(expectedHttpStatusCode); - - // Assert - Check content type - Assert_HasContentType_ApplicationJson(response.Content); - - if (isExpectedToBeSupported) - { - // Assert - Check x-v returned header - Assert_HasHeader(expectedXv, response.Headers, "x-v"); - } - else - { - // Assert - Check error response - await Assert_HasContent_Json(expectedError, response.Content); - } - } - } - - private static string GetExpectedSoftwareProductStatus(string url) - { - using var dbContext = new RegisterDatabaseContext(new DbContextOptionsBuilder().UseSqlServer(Configuration.GetConnectionString("DefaultConnection")).Options); - - var expectedSoftwareProductsStatus = new - { - data = dbContext.SoftwareProducts.AsNoTracking() - .Include(sp => sp.Status) - .Select(sp => new - { - softwareProductId = sp.SoftwareProductId, - status = sp.Status.SoftwareProductStatusCode, - }) - .OrderBy(sp => sp.softwareProductId.ToString()) - .ToList(), - links = new - { - self = url, - }, - meta = new object(), - }; - - return JsonConvert.SerializeObject(expectedSoftwareProductsStatus); - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/API/Status/US27556_GetDataRecipientStatus_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Status/US27556_GetDataRecipientStatus_MultiIndustry_Tests.cs index 356ae35..6d0fb10 100644 --- a/Source/CDR.Register.IntegrationTests/API/Status/US27556_GetDataRecipientStatus_MultiIndustry_Tests.cs +++ b/Source/CDR.Register.IntegrationTests/API/Status/US27556_GetDataRecipientStatus_MultiIndustry_Tests.cs @@ -68,7 +68,17 @@ public async Task AC01_AC02_CTS_URL_Get_ShouldRespondWith_200OK_DataRecipientsSt // Arrange var url = $"{GenerateDynamicCtsUrl(STATUS_DOWNSTREAM_BASE_URL)}/cdr-register/v1/all/data-recipients/status"; - var expectedUrl = ReplacePublicHostName(url, STATUS_DOWNSTREAM_BASE_URL); + string publicHostName = Configuration["PublicHostName"] ?? string.Empty; + string expectedUrl; + + if (string.IsNullOrEmpty(publicHostName)) + { + expectedUrl = url; + } + else + { + expectedUrl = url.Replace(STATUS_DOWNSTREAM_BASE_URL, publicHostName); + } var expectedDataRecipientStatus = GetExpectedDataRecipientsStatus(expectedUrl); @@ -168,36 +178,30 @@ public async Task AC05_Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModi } [Theory] - [InlineData("2", "", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported and higher than x-min-v + [InlineData("2", "3", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-min-v is ignored when > x-v + [InlineData("2", "1", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported and higher than x-min-v [InlineData("2", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData("2", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "banking")] // Invalid. x-min-v is non-positive integer - [InlineData("2", "1", "2", HttpStatusCode.OK, true, "", "Energy")] // Valid. Should return v2 - x-v is supported and higher than x-min-v - [InlineData("2", "4", "2", HttpStatusCode.OK, true, "", "banKing")] // Valid. Should return v2 - x-v is supported and x-min-v is non supported so ignored - [InlineData("2", "2", "2", HttpStatusCode.OK, true, "", "TELCO")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData("2", "2", "2", HttpStatusCode.BadRequest, true, "", "non-bank-lending")] // Invalid industry. Non-bank lending isn't supported for V2. - [InlineData("3", "4", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData("3", "4", "3", HttpStatusCode.BadRequest, true, "", "Telco")] // Invalid industry. x-v is supported but industry is not supported for v3 - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData("1", "2", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported Z [InlineData("3", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) [InlineData("4", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData("4", "4", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 + [InlineData("3", "3", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("foo", "2", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData("4", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 + [InlineData("3", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError, string industry = "All") + + public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError) { // Act var response = await new Infrastructure.Api { HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/status", + URL = $"{TLS_BaseURL}/cdr-register/v1/banking/data-recipients/status", XV = xv, XMinV = minXv, }.SendAsync(); diff --git a/Source/CDR.Register.IntegrationTests/API/Status/US27558_GetSoftwareProductStatus_MultiIndustry_Tests.cs b/Source/CDR.Register.IntegrationTests/API/Status/US27558_GetSoftwareProductStatus_MultiIndustry_Tests.cs index 06365f9..d4325fa 100644 --- a/Source/CDR.Register.IntegrationTests/API/Status/US27558_GetSoftwareProductStatus_MultiIndustry_Tests.cs +++ b/Source/CDR.Register.IntegrationTests/API/Status/US27558_GetSoftwareProductStatus_MultiIndustry_Tests.cs @@ -164,36 +164,29 @@ public async Task AC05_Get_WithIfNoneMatchKnownETAG_ShouldRespondWith_304NotModi [Theory] [InlineData("2", "3", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-min-v is ignored when > x-v - [InlineData("2", "", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported and higher than x-min-v + [InlineData("2", "1", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported and higher than x-min-v [InlineData("2", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData("2", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR, "banking")] // Invalid. x-min-v is non-positive integer - [InlineData("2", "1", "2", HttpStatusCode.OK, true, "", "Energy")] // Valid. Should return v2 - x-v is supported and higher than x-min-v - [InlineData("2", "4", "2", HttpStatusCode.OK, true, "", "banKing")] // Valid. Should return v2 - x-v is supported and x-min-v is non supported so ignored - [InlineData("2", "2", "2", HttpStatusCode.OK, true, "", "TELCO")] // Valid. Should return v2 - x-v is supported equal to x-min-v - [InlineData("2", "2", "2", HttpStatusCode.BadRequest, true, "", "non-bank-lending")] // Invalid industry. Non-bank lending isn't supported for V2. - [InlineData("3", "4", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v3 - x-min-v is ignored when > x-v - [InlineData("4", "2", "3", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported. BadRequest as v3 doesn't support 'Banking' industry - [InlineData("1", "2", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version + [InlineData("3", "2", "2", HttpStatusCode.OK, true, "")] // Valid. Should return v2 - x-v is NOT supported and x-min-v is supported Z [InlineData("3", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is supported but x-min-v is invalid (not a positive integer) [InlineData("4", "foo", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v is invalid (not a positive integer) [InlineData("3", "0", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is not supported and x-min-v invalid - [InlineData("4", "4", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 + [InlineData("3", "3", "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. Both x-v and x-min-v exceed supported version of 2 [InlineData("1", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is an obsolete version [InlineData("foo", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("0", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (not a positive integer) is invalid with missing x-min-v [InlineData("foo", "2", "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v is invalid with valid x-min-v [InlineData("-1", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_INVALID_VERSION_ERROR)] // Invalid. x-v (negative integer) is invalid with missing x-min-v - [InlineData("4", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 + [InlineData("3", null, "N/A", HttpStatusCode.NotAcceptable, false, EXPECTED_UNSUPPORTED_ERROR)] // Unsupported. x-v is higher than supported version of 2 [InlineData("", null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is an empty string [InlineData(null, null, "N/A", HttpStatusCode.BadRequest, false, EXPECTED_MISSING_X_V_ERROR)] // Invalid. x-v header is missing - public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expectedError, string industry = "all") + public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string expectedXv, HttpStatusCode expectedHttpStatusCode, bool isExpectedToBeSupported, string expecetdError) { // Act var response = await new Infrastructure.Api { HttpMethod = HttpMethod.Get, - URL = $"{TLS_BaseURL}/cdr-register/v1/{industry}/data-recipients/brands/software-products/status", + URL = $"{TLS_BaseURL}/cdr-register/v1/banking/data-recipients/brands/software-products/status", XV = xv, XMinV = minXv, }.SendAsync(); @@ -215,7 +208,7 @@ public async Task ACXX_VersionHeaderValidation(string? xv, string? minXv, string else { // Assert - Check error response - await Assert_HasContent_Json(expectedError, response.Content); + await Assert_HasContent_Json(expecetdError, response.Content); } } } diff --git a/Source/CDR.Register.IntegrationTests/API/Update/US50480_UpdateDataHolders.cs b/Source/CDR.Register.IntegrationTests/API/Update/US50480_UpdateDataHolders.cs index c61370d..6d267b1 100644 --- a/Source/CDR.Register.IntegrationTests/API/Update/US50480_UpdateDataHolders.cs +++ b/Source/CDR.Register.IntegrationTests/API/Update/US50480_UpdateDataHolders.cs @@ -27,8 +27,6 @@ public class US50480_UpdateDataHolders : BaseTest private const string TEST_DATA_BASE_URI = "https://TestAumationLogoUri.gov.au"; - private static readonly Dictionary IndustryMapping = new() { { Industry.Banking, "Banking" }, { Industry.Energy, "Energy" }, { Industry.NonBankLending, "Non-Bank-Lending" } }; - public US50480_UpdateDataHolders(ITestOutputHelper outputHelper, TestFixture testFixture) : base(outputHelper, testFixture) { @@ -38,17 +36,15 @@ public enum Industry { Banking, Energy, - NonBankLending, } [Theory] [InlineData(Industry.Banking)] [InlineData(Industry.Energy)] - [InlineData(Industry.NonBankLending)] public async Task AC02_Add_New_DataHolder_With_Only_Mandatory_Fields_Http_200(Industry industry) { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(industry, false); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(industry, false); // Send to Register HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); @@ -57,33 +53,31 @@ public async Task AC02_Add_New_DataHolder_With_Only_Mandatory_Fields_Http_200(In VerifySuccessfulDataHolderUpdate(dataHolderMetadata, response, industry); // Assert participation created correctly - VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", IndustryMapping[industry].ToLowerInvariant(), dataHolderMetadata.Status); + VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", industry.ToString(), dataHolderMetadata.Status); } [Theory] [InlineData(Industry.Banking)] [InlineData(Industry.Energy)] - [InlineData(Industry.NonBankLending)] public async Task AC02_Add_New_DataHolder_With_All_Fields_Fields_Http_200(Industry industry) { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(industry, true); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(industry, true); // Send to Register - var payload = GetJsonFromModel(dataHolderMetadata); - HttpResponseMessage response = await PostUpdateDataHolderRequest(payload); + HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); // Assert http response and database updates. VerifySuccessfulDataHolderUpdate(dataHolderMetadata, response, industry); - VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", IndustryMapping[industry].ToLowerInvariant(), dataHolderMetadata.Status); + VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", industry.ToString(), dataHolderMetadata.Status); } [Fact] public async Task AC03_Modify_Existing_DataHolder_200() { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send Original request to Register HttpResponseMessage originalResponse = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); @@ -103,14 +97,14 @@ public async Task AC03_Modify_Existing_DataHolder_200() // Assert http response and database updates. VerifySuccessfulDataHolderUpdate(dataHolderMetadata, modifiedResponse, Industry.Banking); - VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString().ToLowerInvariant(), dataHolderMetadata.Status); + VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString(), dataHolderMetadata.Status); } [Fact] public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_200() { // Generate valid payload. - DataHolderMetadata originalDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata originalDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send to Register await PostUpdateDataHolderRequest(GetJsonFromModel(originalDataHolderMetadata)); @@ -122,7 +116,7 @@ public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_200() VerifySuccessfulDataHolderUpdate(originalDataHolderMetadata, originalResponse, Industry.Banking); // Generate valid payload. - DataHolderMetadata newDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata newDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Set Legal Entity Id to Original Legal Entity Id. Register should attach new brand to Legal Entity newDataHolderMetadata.LegalEntity.LegalEntityId = originalDataHolderMetadata.LegalEntity.LegalEntityId; @@ -141,14 +135,14 @@ public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_200() // Also Check Original is not affected VerifySuccessfulDataHolderUpdate(originalDataHolderMetadata, originalResponse, Industry.Banking); - VerifyParticipationRecord(newDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString().ToLowerInvariant(), newDataHolderMetadata.Status); + VerifyParticipationRecord(newDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString(), newDataHolderMetadata.Status); } [Fact] public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_With_Different_Industry_200() { // Generate valid Banking payload. - DataHolderMetadata originalDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata originalDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send to Register _ = await PostUpdateDataHolderRequest(GetJsonFromModel(originalDataHolderMetadata)); @@ -160,7 +154,7 @@ public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_With_Different_Ind VerifySuccessfulDataHolderUpdate(originalDataHolderMetadata, originalResponse, Industry.Banking); // Generate valid Energy payload. - DataHolderMetadata newDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Energy, true); + DataHolderMetadata newDataHolderMetadata = CreateValidDataholderMetadata(Industry.Energy, true); // Set Legal Entity Id to Original Legal Entity Id. Register should attach new brand to Legal Entity, and create a new participation record. newDataHolderMetadata.LegalEntity.LegalEntityId = originalDataHolderMetadata.LegalEntity.LegalEntityId; @@ -177,10 +171,10 @@ public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_With_Different_Ind VerifySuccessfulDataHolderUpdate(newDataHolderMetadata, modifiedResponse, Industry.Energy); // Verify Banking Participant - VerifyParticipationRecord(originalDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString().ToLowerInvariant(), originalDataHolderMetadata.Status); + VerifyParticipationRecord(originalDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Banking.ToString(), originalDataHolderMetadata.Status); // Verify Energy(subsequent) Participant - VerifyParticipationRecord(newDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Energy.ToString().ToLowerInvariant(), newDataHolderMetadata.Status); + VerifyParticipationRecord(newDataHolderMetadata.LegalEntity.LegalEntityId, "DH", Industry.Energy.ToString(), newDataHolderMetadata.Status); } [Theory] @@ -188,8 +182,8 @@ public async Task AC03_Add_New_Brand_To_Existing_Legal_Entity_With_Different_Ind [InlineData(null)] public async Task AC04_Missing_Version_In_Header_Http_400(string xv) { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata originalDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata originalDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send to Register with blank x-v header var response = await PostUpdateDataHolderRequest(GetJsonFromModel(originalDataHolderMetadata), xv: xv); @@ -206,7 +200,7 @@ public async Task AC04_Missing_Version_In_Header_Http_400(string xv) [InlineData("1.1")] public async Task AC05_Invalid_Version_Http_400(string xv) { - DataHolderMetadata originalDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata originalDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send to Register with blank x-v header var response = await PostUpdateDataHolderRequest(GetJsonFromModel(originalDataHolderMetadata), xv: xv); @@ -222,7 +216,7 @@ public async Task AC05_Invalid_Version_Http_400(string xv) [InlineData("20")] public async Task AC10_Unsupported_Version_Http_400(string xv) { - DataHolderMetadata originalDataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata originalDataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send to Register with blank x-v header var response = await PostUpdateDataHolderRequest(GetJsonFromModel(originalDataHolderMetadata), xv: xv); @@ -258,8 +252,8 @@ public async Task AC06_Missing_Mandatory_Fields_Http_400(string testId, string e { Log.Information("Executing test for: {TestId}", testId); - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information("original:\n{JsonModel}", GetJsonFromModel(dataHolderMetadata)); dataHolderMetadata = RemoveModelElementBasedOnJsonPath(dataHolderMetadata, elementToRemove); @@ -292,7 +286,7 @@ public async Task AC06_Missing_Mandatory_Fields_Http_400(string testId, string e [InlineData("Max Length EndPoint - WebsiteUri", "endpointDetail.websiteUri", 1000)] [InlineData("Max Length Legal Entity - Name", "legalEntity.legalEntityName", 200)] - // we don't check accreditation number for DHs as they don't have it. + // we don't check accredatation number for DHs as they don't have it. [InlineData("Max Length Legal Entity - logoUri", "legalEntity.logoUri", 1000)] [InlineData("Max Length Legal Entity - Registration Number", "legalEntity.registrationNumber", 100)] [InlineData("Max Length Legal Entity - Registered Country", "legalEntity.registeredCountry", 100)] @@ -303,19 +297,19 @@ public async Task AC06_Missing_Mandatory_Fields_Http_400(string testId, string e [InlineData("Max Length Auth Details - JwksEndpoint", "authDetails.jwksEndpoint", 1000)] public async Task ACXX_Maximum_Field_Length_Exceeded(string testId, string elementUnderTest, int maxLength) { - Log.Information("Executing test for: {TestId} : Max Length: {MaxLength}", testId, maxLength); + Log.Information("Executing test for: {TestId} : Max Lenght: {MaxLength}", testId, maxLength); // Create dataHolder using maximum field length - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); string maxLengthValue = maxLength.GenerateRandomString(); dataHolderMetadata = ReplaceModelValueBasedOnJsonPath(dataHolderMetadata, elementUnderTest, maxLengthValue); - Log.Information($"+ve Scenario using maximum field length of '{maxLength}':\n{GetJsonFromModel(dataHolderMetadata)}"); + Log.Information($"+ve Scenario using maximum field lenght of '{maxLength}':\n{GetJsonFromModel(dataHolderMetadata)}"); // Send and verify positive scenario HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); await VerifyInvalidAndValidFieldResponse(response, dataHolderMetadata, ConvertJsonPathToPascalCase(elementUnderTest), maxLengthValue, true); - // Create dataHolder using maximum field length plus one + // Create dataHolder using maximum field lenght plus one string maxLengthPlusOneValue = (maxLength + 1).GenerateRandomString(); dataHolderMetadata = ReplaceModelValueBasedOnJsonPath(dataHolderMetadata, elementUnderTest, maxLengthPlusOneValue); Log.Information($"-ve:\n{GetJsonFromModel(dataHolderMetadata)}"); @@ -329,29 +323,32 @@ public async Task ACXX_Maximum_Field_Length_Exceeded(string testId, string eleme [InlineData("BANKING")] [InlineData("ENERGY")] [InlineData("Energy")] - [InlineData("Non-Bank-Lending")] [InlineData("foo", false)] public async Task AC07_Valid_And_Invalid_Industry(string industry, bool isValid = true) { - Industry? industryEnum = industry.ToUpperInvariant() switch - { - "ENERGY" => Industry.Energy, - "NON-BANK-LENDING" => Industry.NonBankLending, - "BANKING" => Industry.Banking, - _ => null, - }; - - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(industryEnum ?? Industry.Banking, false); + Industry industryEnum; + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information($"original:\n{GetJsonFromModel(dataHolderMetadata)}"); - if (!industryEnum.HasValue) - { - dataHolderMetadata.Industries = [industry]; - Log.Information($"modified:\n{GetJsonFromModel(dataHolderMetadata)}"); - } + + dataHolderMetadata.Industries.Clear(); + dataHolderMetadata.Industries.Add(industry); + + Log.Information($"modified:\n{GetJsonFromModel(dataHolderMetadata)}"); HttpResponseMessage httpResponseMessage = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); + switch (industry.ToUpper()) + { + case "ENERGY": + industryEnum = Industry.Energy; + break; + + default: + industryEnum = Industry.Banking; + break; + } + dataHolderMetadata.Industries = dataHolderMetadata.Industries.ConvertAll(x => x.ToUpper()); await VerifyInvalidAndValidFieldResponse(httpResponseMessage, dataHolderMetadata, "Industries[0]", industry, isValid, industryEnum); @@ -365,7 +362,7 @@ public async Task AC07_Valid_And_Invalid_Industry(string industry, bool isValid [InlineData("foo", false)] public async Task AC07_Valid_And_Invalid_Data_Holder_Status(string status, bool isValid = true) { - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information($"original:\n{GetJsonFromModel(dataHolderMetadata)}"); dataHolderMetadata.Status = status; @@ -390,7 +387,7 @@ public async Task AC07_Valid_And_Invalid_Data_Holder_Status(string status, bool [InlineData("foo", false)] public async Task AC07_Valid_And_Invalid_Data_Holder_Legal_Entity_Organisation_Type(string orgType, bool isValid = true) { - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information($"original:\n{GetJsonFromModel(dataHolderMetadata)}"); dataHolderMetadata.LegalEntity.OrganisationType = orgType; @@ -412,7 +409,7 @@ public async Task AC07_Valid_And_Invalid_Data_Holder_Legal_Entity_Organisation_T [InlineData("foo", false)] public async Task AC07_Valid_And_Invalid_Data_Holder_Legal_Entity_Status(string status, bool isValid = true) { - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information($"original:\n{GetJsonFromModel(dataHolderMetadata)}"); dataHolderMetadata.LegalEntity.Status = status; @@ -432,7 +429,7 @@ public async Task AC07_Valid_And_Invalid_Data_Holder_Legal_Entity_Status(string [InlineData("foo", false)] public async Task AC07_Valid_And_Invalid_Data_Holder_Auth_Details_RegisterUType(string registerUType, bool isValid = true) { - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); Log.Information($"original:\n{GetJsonFromModel(dataHolderMetadata)}"); dataHolderMetadata.AuthDetails.RegisterUType = registerUType; @@ -449,8 +446,8 @@ public async Task AC07_Valid_And_Invalid_Data_Holder_Auth_Details_RegisterUType( [Fact] public async Task AC08_Brand_Already_Associated_With_Different_Legal_Entity_400() { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send Original request to Register HttpResponseMessage originalResponse = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); @@ -469,8 +466,8 @@ public async Task AC08_Brand_Already_Associated_With_Different_Legal_Entity_400( [Fact] public async Task AC09_Brand_Already_Associated_With_Same_Legal_Entity_And_Different_Industry_400() { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, true); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, true); // Send Original request to Register HttpResponseMessage originalResponse = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata)); @@ -487,140 +484,6 @@ public async Task AC09_Brand_Already_Associated_With_Same_Legal_Entity_And_Diffe await VerifyInvalidPayloadResponse(modifiedResponse, $"Brand {dataHolderMetadata.DataHolderBrandId} is already associated with the same legal entity in a different industry."); } - // Test Case:1 - [Fact] - public void MockDataHolderBankingShouldHaveSeeded() - { - // Arrange - var legalEntityId = "0d332caa-8cd8-4ac9-8898-20641c54bc8c"; // Bank Legal Entity - var brandId = "804fc2fb-18a7-4235-9a49-2af393d18bc7"; // Mock Data Holder (Banking) - - // Act - var result = GetActualDataHolderFromDatabase(legalEntityId, brandId, Industry.Banking); - - // Assert - Assert.NotNull(result); - var resultDh = JsonConvert.DeserializeObject(result); - resultDh.Should().NotBeNull(); - } - - [Fact] // Test Case:2 - public void NewBankShouldHaveSeededWithoutProductBaseUri() - { - // Arrange - var legalEntityId = "93ef5f28-7f30-43f2-8e5c-b1e3cb39ce90"; // New Bank - var brandId = "6e9cfaf7-ecae-4de3-bbc5-ea9f366bdf55"; // New Bank -- dummy data holder -- do not use - - // Act - var result = GetActualDataHolderFromDatabase(legalEntityId, brandId, Industry.Banking); - - // Assert - Assert.NotNull(result); - var resultDh = JsonConvert.DeserializeObject(result); - resultDh.EndpointDetail.ProductBaseUri.Should().BeNull(); - } - - [Fact] // Test Case:3 - public void SunBankShouldHaveSeededWithProductBaseUri() - { - // Arrange - var legalEntityId = "aeca53ab-2a90-4737-938d-987ce195ca14"; // Sun bank - var brandId = "f6dfbe5b-c57a-4ec2-bc97-66c1f7fe6c1d"; // "Sun -- dummy data holder -- do not use" - - // Act - var result = GetActualDataHolderFromDatabase(legalEntityId, brandId, Industry.Banking); - - // Assert - Assert.NotNull(result); - var resultDh = JsonConvert.DeserializeObject(result); - resultDh.EndpointDetail.ProductBaseUri.Should().NotBeNull(); - } - - [Fact] // Test case:4 - public async Task GetMetaDataShouldMatchSeedData() - { - // Arrange - var api = new Infrastructure.Api - { - HttpMethod = HttpMethod.Get, - URL = $"{ADMIN_BaseURL}/admin/metadata", - }; - - // Expected payload should match seed file - await TestFixture.Seeddata(); - var expectedPayload = await System.IO.File.ReadAllTextAsync(SEEDDATA_FILENAME); - var expectedData = JsonConvert.DeserializeObject(expectedPayload); - - // Act - API - var response = await api.SendAsync(); - var result = await response.Content.ReadAsStringAsync(); - - var apiData = JsonConvert.DeserializeObject(result); - - // Assert - using var scope = new AssertionScope(); - - // Assert - Check status code - response.StatusCode.Should().Be(HttpStatusCode.OK); - - apiData.Should().NotBeNull(); - expectedPayload.Should().NotBeNull(); - - apiData.LegalEntities.Should().BeEquivalentTo( - expectedData.LegalEntities.OrderBy(x => x.LegalEntityName), - opt => opt - .ComparingRecordsByValue() - .Excluding(su => su.Path.EndsWith(nameof(LegalEntity.Participation.ParticipationId)))); - - // Because seed data doesn't include ParticipationIds we ignore them above, - // but still want to ensure they are set in the API response - apiData.LegalEntities - .SelectMany(le => le.Participations) - .All(p => p.ParticipationId.HasValue && p.ParticipationId != Guid.Empty) - .Should().BeTrue(); - } - - [Fact] - public async Task UpdateDataHolderMetadataWithNBLShouldUpdateAndPersistSuccessfully() - { - // Arrange - var industry = Industry.NonBankLending; - var metadata = CreateValidDataHolderMetadata(industry, true); - - // AC: Additional attributes for NBL - metadata.BrandGroup = "TestBrandGroup"; - metadata.EndpointDetail.ProductBaseUri = "https://test.com/products"; - - // Act - update - var updateResponse = await PostUpdateDataHolderRequest(GetJsonFromModel(metadata)); - using var scope = new AssertionScope(); - - // Assert - updateResponse.StatusCode.Should().Be(HttpStatusCode.OK); - - VerifySuccessfulDataHolderUpdate(metadata, updateResponse, industry); - var expectedIndustry = "non-bank-lending"; - VerifyParticipationRecord(metadata.LegalEntity.LegalEntityId, "DH", expectedIndustry, "ACTIVE"); - } - - [Fact] - public async Task UpdateDataHolderMEtaDataWithInvalidIndustryShouldReturnBadRequest() - { - // Arrange - var metadata = CreateValidDataHolderMetadata(Industry.Banking, true); - - // Force invalid industry - metadata.Industries = new List { "invalid industry" }; - - // Act - var response = await PostUpdateDataHolderRequest(GetJsonFromModel(metadata)); - - // Assert - response.StatusCode.Should().Be(HttpStatusCode.BadRequest); - var content = await response.Content.ReadAsStringAsync(); - content.ToLower().Should().Contain("invalid"); - } - [Trait("Category", "CTSONLY")] [Theory] [InlineData(Industry.Banking)] @@ -630,8 +493,8 @@ public async Task AC02_Add_New_DataHolder_WithValidToken_200(Industry industry) // Get the token var accessToken = await GetAzureAdAccessToken(); - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(industry, false); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(industry, false); // Send to Register HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata), accessToken: accessToken); @@ -640,7 +503,7 @@ public async Task AC02_Add_New_DataHolder_WithValidToken_200(Industry industry) VerifySuccessfulDataHolderUpdate(dataHolderMetadata, response, industry); // Assert participation created correctly - VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", IndustryMapping[industry].ToLowerInvariant(), dataHolderMetadata.Status); + VerifyParticipationRecord(dataHolderMetadata.LegalEntity.LegalEntityId, "DH", industry.ToString(), dataHolderMetadata.Status); } [Trait("Category", "CTSONLY")] @@ -649,8 +512,8 @@ public async Task AC02_Add_New_DataHolder_WithValidToken_200(Industry industry) [InlineData(EXPIRED_ACCESS_TOKEN)] public async Task AC02_Add_New_DataHolder_InvalidToken_401(string accessToken) { - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); // Send to Register HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata), accessToken: accessToken); @@ -666,8 +529,8 @@ public async Task AC02_Add_New_DataHolder_InvalidRole_401() // Get the token var accessToken = await GetInvalidAzureAdAccessToken(); - // Generate valid payload with only mandatory/minimum fields. - DataHolderMetadata dataHolderMetadata = CreateValidDataHolderMetadata(Industry.Banking, false); + // Generate valid payload with only mandatory/minimun fields. + DataHolderMetadata dataHolderMetadata = CreateValidDataholderMetadata(Industry.Banking, false); // Send to Register HttpResponseMessage response = await PostUpdateDataHolderRequest(GetJsonFromModel(dataHolderMetadata), accessToken: accessToken); @@ -704,11 +567,11 @@ private static async Task PostUpdateDataHolderRequest(strin return httpResponse; } - private static async Task VerifyInvalidAndValidFieldResponse(HttpResponseMessage response, DataHolderMetadata dataHolderMetadata, string field, string value, bool isValid, Industry? industry = Industry.Banking) + private static async Task VerifyInvalidAndValidFieldResponse(HttpResponseMessage response, DataHolderMetadata dataHolderMetadata, string field, string value, bool isValid, Industry industry = Industry.Banking) { if (isValid) { - string actualDataHolder = GetActualDataHolderFromDatabase(dataHolderMetadata.LegalEntity.LegalEntityId, dataHolderMetadata.DataHolderBrandId, industry.Value); + string actualDataHolder = GetActualDataHolderFromDatabase(dataHolderMetadata.LegalEntity.LegalEntityId, dataHolderMetadata.DataHolderBrandId, industry); Assert_Json(GetJsonFromModel(dataHolderMetadata), actualDataHolder); } @@ -744,40 +607,36 @@ private static void VerifySuccessfulDataHolderUpdate(DataHolderMetadata expected } } - private static DataHolderMetadata CreateValidDataHolderMetadata(Industry industry, bool includeOptionalFields = false) + private static DataHolderMetadata CreateValidDataholderMetadata(Industry industry, bool includeOptionalFields = false) { - var dataHolderMetadata = new DataHolderMetadata + DataHolderMetadata dataHolderMetadata = new DataHolderMetadata(); + dataHolderMetadata.DataHolderBrandId = Guid.NewGuid().ToString(); + dataHolderMetadata.BrandName = "Test Automation Brand Name"; + dataHolderMetadata.Industries = new List { industry.ToString().ToUpper() }; + dataHolderMetadata.Status = "ACTIVE"; + dataHolderMetadata.LogoUri = $"{TEST_DATA_BASE_URI}/logo.png"; + + dataHolderMetadata.LegalEntity = new DataHolderMetadata.LegalEntityChild() { - DataHolderBrandId = Guid.NewGuid().ToString(), - BrandName = "Test Automation Brand Name", - BrandGroup = "Test Automation Brand Group", - Industries = [IndustryMapping[industry].ToUpperInvariant()], - Status = "ACTIVE", + LegalEntityId = Guid.NewGuid().ToString(), + LegalEntityName = "Test Automation Generated Legal Entity Name", LogoUri = $"{TEST_DATA_BASE_URI}/logo.png", + Status = "ACTIVE", + }; - LegalEntity = new DataHolderMetadata.LegalEntityChild - { - LegalEntityId = Guid.NewGuid().ToString(), - LegalEntityName = "Test Automation Generated Legal Entity Name", - LogoUri = $"{TEST_DATA_BASE_URI}/logo.png", - Status = "ACTIVE", - }, - - EndpointDetail = new DataHolderMetadata.EndpointDetailChild - { - Version = "1", - PublicBaseUri = $"{TEST_DATA_BASE_URI}/publicBaseUri", - ProductBaseUri = $"{TEST_DATA_BASE_URI}/productBaseUri", - ResourceBaseUri = $"{TEST_DATA_BASE_URI}/resourceBaseUri", - InfosecBaseUri = $"{TEST_DATA_BASE_URI}/infosecBaseUri", - WebsiteUri = $"{TEST_DATA_BASE_URI}/websiteUri", - }, - - AuthDetails = new DataHolderMetadata.AuthDetailsChild - { - RegisterUType = "SIGNED-JWT", - JwksEndpoint = $"{TEST_DATA_BASE_URI}/jwks.json", - }, + dataHolderMetadata.EndpointDetail = new DataHolderMetadata.EndpointDetailChild() + { + Version = "1", + PublicBaseUri = $"{TEST_DATA_BASE_URI}/publicBaseUri", + ResourceBaseUri = $"{TEST_DATA_BASE_URI}/resourceBaseUri", + InfosecBaseUri = $"{TEST_DATA_BASE_URI}/infosecBaseUri", + WebsiteUri = $"{TEST_DATA_BASE_URI}/websiteUri", + }; + + dataHolderMetadata.AuthDetails = new DataHolderMetadata.AuthDetailsChild() + { + RegisterUType = "SIGNED-JWT", + JwksEndpoint = $"{TEST_DATA_BASE_URI}/jwks.json", }; if (includeOptionalFields) @@ -812,14 +671,13 @@ private static string GetActualDataHolderFromDatabase(string legalEntityId, stri .Include(participation => participation.Brands) .ThenInclude(brandStatus => brandStatus.BrandStatus) .Include(participation => participation.Brands) - .Where(participation => participation.LegalEntityId == legalEntityIdGuid) - .Where(participation => participation.Industry.IndustryTypeCode == IndustryMapping[industry].ToUpperInvariant()) + .Where(participation => participation.LegalEntityId == legalEntityIdGuid + && participation.Industry.IndustryTypeCode == industry.ToString()) .OrderBy(participation => participation.LegalEntityId) .Select(participation => participation.Brands.Where(brand => brand.BrandId == Guid.Parse(brandId)).Select(brand => new { dataHolderBrandId = brand.BrandId, brandName = brand.BrandName, - brandGroup = brand.BrandGroup, // White-labelling industries = new List { participation.Industry.IndustryTypeCode.ToUpper() }, logoUri = brand.LogoUri, status = brand.BrandStatus.BrandStatusCode, @@ -844,7 +702,6 @@ private static string GetActualDataHolderFromDatabase(string legalEntityId, stri { version = brand.Endpoint.Version, publicBaseUri = brand.Endpoint.PublicBaseUri, - productBaseUri = brand.Endpoint.ProductBaseUri, // White-labelling resourceBaseUri = brand.Endpoint.ResourceBaseUri, infosecBaseUri = brand.Endpoint.InfosecBaseUri, extensionBaseUri = brand.Endpoint.ExtensionBaseUri, @@ -883,8 +740,8 @@ private static async Task GetAzureAdAccessToken() throw new Exception($"Unable to retrieve access token from Azure AD.\n Http Status Code: {response.StatusCode}\nResponse Body:{responseBody}"); } - var tokenResponse = JsonConvert.DeserializeObject(responseBody); - return tokenResponse.Access_token; + var tokenResnse = JsonConvert.DeserializeObject(responseBody); + return tokenResnse.Access_token; } private static async Task GetInvalidAzureAdAccessToken() @@ -905,8 +762,8 @@ private static async Task GetInvalidAzureAdAccessToken() throw new Exception($"Unable to retrieve access token from Azure AD.\n Http Status Code: {response.StatusCode}\nResponse Body:{responseBody}"); } - var tokenResponse = JsonConvert.DeserializeObject(responseBody); - return tokenResponse.Access_token; + var tokenResnse = JsonConvert.DeserializeObject(responseBody); + return tokenResnse.Access_token; } } } diff --git a/Source/CDR.Register.IntegrationTests/BaseTest.cs b/Source/CDR.Register.IntegrationTests/BaseTest.cs index 7cc952c..293ee38 100644 --- a/Source/CDR.Register.IntegrationTests/BaseTest.cs +++ b/Source/CDR.Register.IntegrationTests/BaseTest.cs @@ -51,53 +51,38 @@ public abstract class BaseTest : BaseTest0, IClassFixture protected const string DEFAULT_CERTIFICATE_THUMBPRINT = "f0e5146a51f16e236844cf0353d791f11865e405"; protected const string DEFAULT_CERTIFICATE_COMMON_NAME = "MockDataRecipient"; - protected const string EXPECTED_UNSUPPORTED_ERROR = """ + protected const string EXPECTED_UNSUPPORTED_ERROR = @" { - "errors": [ + ""errors"": [ { - "code": "urn:au-cds:error:cds-all:Header/UnsupportedVersion", - "title": "Unsupported Version", - "detail": "Requested version is lower than the minimum version or greater than maximum version.", + ""code"": ""urn:au-cds:error:cds-all:Header/UnsupportedVersion"", + ""title"": ""Unsupported Version"", + ""detail"": ""Requested version is lower than the minimum version or greater than maximum version."", } ] - } - """; + }"; - protected const string EXPECTED_INVALID_VERSION_ERROR = """ + protected const string EXPECTED_INVALID_VERSION_ERROR = @" { - "errors": [ + ""errors"": [ { - "code": "urn:au-cds:error:cds-all:Header/InvalidVersion", - "title": "Invalid Version", - "detail": "Version is not a positive Integer." + ""code"": ""urn:au-cds:error:cds-all:Header/InvalidVersion"", + ""title"": ""Invalid Version"", + ""detail"": ""Version is not a positive Integer."" } ] - } - """; + }"; - protected const string EXPECTED_MISSING_X_V_ERROR = """ + protected const string EXPECTED_MISSING_X_V_ERROR = @" { - "errors": [ + ""errors"": [ { - "code": "urn:au-cds:error:cds-all:Header/Missing", - "title": "Missing Required Header", - "detail": "An API version x-v header is required, but was not specified.", + ""code"": ""urn:au-cds:error:cds-all:Header/Missing"", + ""title"": ""Missing Required Header"", + ""detail"": ""An API version x-v header is required, but was not specified."", } ] - } - """; - - protected const string EXPECTED_INVALIDFIELD_INDUSTRY = """ - { - "errors": [ - { - "code": "urn:au-cds:error:cds-all:Field/Invalid", - "title": "Invalid Field", - "detail": "industry" - } - ] - } - """; + }"; private const string REGISTER_RW = "DefaultConnection"; private static IConfigurationRoot? configuration; @@ -408,7 +393,7 @@ public static string GenerateDynamicCtsUrl(string baseUrl, string? conformanceId } } - protected static void VerifyParticipationRecord(string legalEntityId, string expectedParticipationType, string expectedIndustryType, string expectedStatus) + protected static void VerifyParticipationRecord(string legalEntiryId, string expectedParticipationType, string expectedIndustryType, string expectedStatus) { using SqlConnection registerConnection = new SqlConnection(BaseTest.CONNECTIONSTRING_REGISTER_RW); @@ -429,7 +414,7 @@ Participation p FULL JOIN IndustryType i ON p.IndustryId = i.IndustryTypeId FULL JOIN ParticipationStatus ps ON p.StatusId = ps.ParticipationStatusId WHERE - p.LegalEntityId = '{legalEntityId}' + p.LegalEntityId = '{legalEntiryId}' AND pt.ParticipationTypeCode = '{expectedParticipationType}' "; if (expectedIndustryType == null) @@ -473,7 +458,7 @@ Participation p } catch (Exception e) { - throw new Exception($"Error Getting Participation Record for Legal Entity: {legalEntityId}", e); + throw new Exception($"Error Getting Participation Record for Legal Entity: {legalEntiryId}", e); } } diff --git a/Source/CDR.Register.IntegrationTests/Models/DataHolderMetadata.cs b/Source/CDR.Register.IntegrationTests/Models/DataHolderMetadata.cs index ccaf9fe..d5b2d37 100644 --- a/Source/CDR.Register.IntegrationTests/Models/DataHolderMetadata.cs +++ b/Source/CDR.Register.IntegrationTests/Models/DataHolderMetadata.cs @@ -20,9 +20,6 @@ public class DataHolderMetadata [JsonProperty("status")] public string Status { get; set; } - [JsonProperty("brandGroup")] - public string BrandGroup { get; set; } - [JsonProperty("endpointDetail")] public EndpointDetailChild EndpointDetail { get; set; } @@ -49,9 +46,6 @@ public class EndpointDetailChild [JsonProperty("publicBaseUri")] public string PublicBaseUri { get; set; } - [JsonProperty("productBaseUri")] - public string ProductBaseUri { get; set; } - [JsonProperty("resourceBaseUri")] public string ResourceBaseUri { get; set; } diff --git a/Source/CDR.Register.IntegrationTests/Models/LegalEntity.cs b/Source/CDR.Register.IntegrationTests/Models/LegalEntity.cs deleted file mode 100644 index 24a58c2..0000000 --- a/Source/CDR.Register.IntegrationTests/Models/LegalEntity.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace CDR.Register.IntegrationTests.Models; - -public class LegalEntity -{ - [JsonProperty("legalEntityId")] - public Guid LegalEntityId { get; set; } - - [JsonProperty("legalEntityName")] - public string LegalEntityName { get; set; } - - [JsonProperty("logoUri")] - public Uri LogoUri { get; set; } - - [JsonProperty("registrationNumber")] - public string RegistrationNumber { get; set; } - - [JsonProperty("registrationDate")] - public DateTimeOffset? RegistrationDate { get; set; } - - [JsonProperty("registeredCountry")] - public string RegisteredCountry { get; set; } - - [JsonProperty("abn")] - public string Abn { get; set; } - - [JsonProperty("acn")] - public string Acn { get; set; } - - [JsonProperty("anzsicDivision")] - public string AnzsicDivision { get; set; } - - [JsonProperty("organisationTypeId")] - public int? OrganisationTypeId { get; set; } - - [JsonProperty("participations")] - public Participation[] Participations { get; set; } - - [JsonProperty("arbn")] - public string Arbn { get; set; } - - [JsonProperty("accreditationNumber", NullValueHandling = NullValueHandling.Ignore)] - public string AccreditationNumber { get; set; } - - [JsonProperty("accreditationLevelId", NullValueHandling = NullValueHandling.Ignore)] - public int? AccreditationLevelId { get; set; } - - public class Participation - { - [JsonProperty("participationId", NullValueHandling = NullValueHandling.Ignore)] - public Guid? ParticipationId { get; set; } - - [JsonProperty("participationTypeId")] - public int ParticipationTypeId { get; set; } - - [JsonProperty("industryId")] - public int? IndustryId { get; set; } - - [JsonProperty("statusId")] - public int StatusId { get; set; } - - [JsonProperty("brands")] - public Brand[] Brands { get; set; } - - public class Brand - { - [JsonProperty("brandId")] - public Guid BrandId { get; set; } - - [JsonProperty("brandName")] - public string BrandName { get; set; } - - [JsonProperty("brandGroup")] - public string BrandGroup { get; set; } - - [JsonProperty("logoUri")] - public Uri LogoUri { get; set; } - - [JsonProperty("brandStatusId")] - public int BrandStatusId { get; set; } - - [JsonProperty("lastUpdated")] - public DateTimeOffset LastUpdated { get; set; } - - [JsonProperty("softwareProducts")] - public SoftwareProduct[] SoftwareProducts { get; set; } = []; - - [JsonProperty("authDetails", NullValueHandling = NullValueHandling.Ignore)] - public AuthDetail[] AuthDetails { get; set; } = []; - - [JsonProperty("endpoint", NullValueHandling = NullValueHandling.Ignore)] - public Endpoint Endpoints { get; set; } - - public class AuthDetail - { - [JsonProperty("registerUTypeId")] - public int RegisterUTypeId { get; set; } - - [JsonProperty("jwksEndpoint")] - public Uri JwksEndpoint { get; set; } - } - - public class Endpoint - { - [JsonProperty("version")] - public string Version { get; set; } - - [JsonProperty("publicBaseUri")] - public Uri PublicBaseUri { get; set; } - - [JsonProperty("productBaseUri")] - public Uri ProductBaseUri { get; set; } - - [JsonProperty("resourceBaseUri")] - public Uri ResourceBaseUri { get; set; } - - [JsonProperty("infosecBaseUri")] - public Uri InfosecBaseUri { get; set; } - - [JsonProperty("extensionBaseUri")] - public string ExtensionBaseUri { get; set; } - - [JsonProperty("websiteUri")] - public Uri WebsiteUri { get; set; } - } - - public class SoftwareProduct - { - [JsonProperty("softwareProductId")] - public Guid SoftwareProductId { get; set; } - - [JsonProperty("softwareProductName")] - public string SoftwareProductName { get; set; } - - [JsonProperty("softwareProductDescription")] - public string SoftwareProductDescription { get; set; } - - [JsonProperty("logoUri")] - public Uri LogoUri { get; set; } - - [JsonProperty("sectorIdentifierUri")] - public Uri SectorIdentifierUri { get; set; } - - [JsonProperty("clientUri")] - public Uri ClientUri { get; set; } - - [JsonProperty("tosUri")] - public Uri TosUri { get; set; } - - [JsonProperty("policyUri")] - public Uri PolicyUri { get; set; } - - [JsonProperty("recipientBaseUri")] - public Uri RecipientBaseUri { get; set; } - - [JsonProperty("revocationUri")] - public Uri RevocationUri { get; set; } - - [JsonProperty("redirectUris")] - public Uri RedirectUris { get; set; } - - [JsonProperty("jwksUri")] - public Uri JwksUri { get; set; } - - [JsonProperty("scope")] - public string Scope { get; set; } - - [JsonProperty("statusId")] - public int StatusId { get; set; } - - [JsonProperty("certificates")] - public Certificate[] Certificates { get; set; } - - public class Certificate - { - [JsonProperty("commonName")] - public string CommonName { get; set; } - - [JsonProperty("thumbprint")] - public string Thumbprint { get; set; } - } - } - } - } -} diff --git a/Source/CDR.Register.IntegrationTests/Models/MetaData.cs b/Source/CDR.Register.IntegrationTests/Models/MetaData.cs deleted file mode 100644 index 6b2ffcd..0000000 --- a/Source/CDR.Register.IntegrationTests/Models/MetaData.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace CDR.Register.IntegrationTests.Models; - -public class MetaData -{ - [JsonProperty("legalEntities")] - public LegalEntity[] LegalEntities { get; set; } -} diff --git a/Source/CDR.Register.IntegrationTests/Start-Register.bat b/Source/CDR.Register.IntegrationTests/Start-Register.bat index 7ba702d..778b8a2 100644 --- a/Source/CDR.Register.IntegrationTests/Start-Register.bat +++ b/Source/CDR.Register.IntegrationTests/Start-Register.bat @@ -11,7 +11,6 @@ REM --title SSA_API -d ../CDR.Register.SSA.API dotnet run; ^ REM --title Status_API -d ../CDR.Register.Status.API dotnet run; ^ REM --title Admin_API -d ../CDR.Register.Admin.API dotnet run -docker compose -f ../docker-compose.IntegrationTests.yml up -d --build --force-recreate mssql mock-register +docker compose -f ../docker-compose.IntegrationTests.yml up -d --build mssql mock-register echo Supporting infrastructure for tests will now stop. -pause -docker compose -f ../docker-compose.IntegrationTests.yml down \ No newline at end of file +pause \ No newline at end of file diff --git a/Source/CDR.Register.IntegrationTests/integration.Release.runsettings b/Source/CDR.Register.IntegrationTests/integration.Release.runsettings index 12da201..d6714e4 100644 --- a/Source/CDR.Register.IntegrationTests/integration.Release.runsettings +++ b/Source/CDR.Register.IntegrationTests/integration.Release.runsettings @@ -2,9 +2,6 @@ - true - - (Category!=CTSONLY) Release diff --git a/Source/CDR.Register.Repository.UnitTests/BrandSpecificationTests.cs b/Source/CDR.Register.Repository.UnitTests/BrandSpecificationTests.cs deleted file mode 100644 index fb8ee22..0000000 --- a/Source/CDR.Register.Repository.UnitTests/BrandSpecificationTests.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Linq; -using CDR.Register.Repository.Infrastructure; -using CDR.Register.Repository.Specifications; - -namespace CDR.Register.Repository.UnitTests -{ - /// - /// Test Brand Specifications. - /// - public class BrandSpecificationTests - { - private readonly Entities.Brand _banking = - new() { BrandName = nameof(Industry.BANKING), Participation = new() { IndustryId = Industry.BANKING } }; - - private readonly Entities.Brand _energy = - new() { BrandName = nameof(Industry.ENERGY), Participation = new() { IndustryId = Industry.ENERGY } }; - - private readonly Entities.Brand _telco = - new() { BrandName = nameof(Industry.TELCO), Participation = new() { IndustryId = Industry.TELCO } }; - - private readonly Entities.Brand _nonBankLending = - new() { BrandName = nameof(Industry.NONBANKLENDING), Participation = new() { IndustryId = Industry.NONBANKLENDING } }; - - private readonly IQueryable _brands; - - public BrandSpecificationTests() - { - this._brands = new Entities.Brand[] - { - this._banking, - this._energy, - this._telco, - this._nonBankLending, - }.AsQueryable(); - } - - [Fact] - public void ExcludeNblIndustrySpecification_AppliesSuccessfully() - { - var underTest = new BrandSpecifications.ExcludeNblIndustry(); - - var result = underTest.Apply(this._brands); - - Assert.NotEqual(this._brands.Count(), result.Count()); - Assert.DoesNotContain(this._nonBankLending, result); - } - - [Fact] - public void AllIndustriesSpecification_AppliesSuccessfully() - { - var underTest = new BrandSpecifications.AllIndustries(); - - var result = underTest.Apply(this._brands); - - Assert.Equal(this._brands.Count(), result.Count()); - } - } -} diff --git a/Source/CDR.Register.Repository.UnitTests/CDR.Register.Repository.UnitTests.csproj b/Source/CDR.Register.Repository.UnitTests/CDR.Register.Repository.UnitTests.csproj deleted file mode 100644 index 916216b..0000000 --- a/Source/CDR.Register.Repository.UnitTests/CDR.Register.Repository.UnitTests.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - false - false - $(TargetFrameworkVersion) - $(Version) - $(Version) - $(Version) - True - true - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/Source/CDR.Register.Repository.UnitTests/ParticipantSpecificationTests.cs b/Source/CDR.Register.Repository.UnitTests/ParticipantSpecificationTests.cs deleted file mode 100644 index c794594..0000000 --- a/Source/CDR.Register.Repository.UnitTests/ParticipantSpecificationTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Linq; -using CDR.Register.Repository.Infrastructure; -using CDR.Register.Repository.Specifications; - -namespace CDR.Register.Repository.UnitTests -{ - /// - /// Test Participation Specifications. - /// - public class ParticipantSpecificationTests - { - private readonly Entities.Participation _banking = new() { IndustryId = Industry.BANKING }; - - private readonly Entities.Participation _energy = new() { IndustryId = Industry.ENERGY }; - - private readonly Entities.Participation _telco = new() { IndustryId = Industry.TELCO }; - - private readonly Entities.Participation _nonBankLending = new() { IndustryId = Industry.NONBANKLENDING }; - - private readonly IQueryable _participations; - - public ParticipantSpecificationTests() - { - this._participations = new Entities.Participation[] - { - this._banking, - this._energy, - this._telco, - this._nonBankLending, - }.AsQueryable(); - } - - [Fact] - public void ExcludeNblIndustrySpecification_AppliesSuccessfully() - { - var underTest = new ParticipationsSpecifications.ExcludeNblIndustry(); - - var result = underTest.Apply(this._participations); - - Assert.NotEqual(this._participations.Count(), result.Count()); - Assert.DoesNotContain(this._nonBankLending, result); - } - - [Fact] - public void AllIndustriesSpecification_AppliesSuccessfully() - { - var underTest = new ParticipationsSpecifications.AllIndustries(); - - var result = underTest.Apply(this._participations); - - Assert.Equal(this._participations.Count(), result.Count()); - } - } -} diff --git a/Source/CDR.Register.Repository/CDR.Register.Repository.csproj b/Source/CDR.Register.Repository/CDR.Register.Repository.csproj index f40f275..e219e81 100644 --- a/Source/CDR.Register.Repository/CDR.Register.Repository.csproj +++ b/Source/CDR.Register.Repository/CDR.Register.Repository.csproj @@ -7,9 +7,8 @@ true false - - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -26,11 +25,6 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - diff --git a/Source/CDR.Register.Repository/Entities/Brand.cs b/Source/CDR.Register.Repository/Entities/Brand.cs index 5936375..38ee51f 100644 --- a/Source/CDR.Register.Repository/Entities/Brand.cs +++ b/Source/CDR.Register.Repository/Entities/Brand.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; using CDR.Register.Repository.Enums; @@ -20,10 +19,6 @@ public Brand() [Required] public string BrandName { get; set; } - [MaxLength(100)] - [Description("The brand group for white-labelling")] - public string BrandGroup { get; set; } - [MaxLength(1000)] [Required] diff --git a/Source/CDR.Register.Repository/Entities/Endpoint.cs b/Source/CDR.Register.Repository/Entities/Endpoint.cs index 6fdf228..8cb0838 100644 --- a/Source/CDR.Register.Repository/Entities/Endpoint.cs +++ b/Source/CDR.Register.Repository/Entities/Endpoint.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -19,10 +18,6 @@ public class Endpoint [Required] public string PublicBaseUri { get; set; } - [MaxLength(1000)] - [Description("The PRD base URI")] - public string ProductBaseUri { get; set; } - [MaxLength(1000)] [Required] public string ResourceBaseUri { get; set; } diff --git a/Source/CDR.Register.Repository/Entities/Enumerations.cs b/Source/CDR.Register.Repository/Entities/Enumerations.cs new file mode 100644 index 0000000..f26c4e8 --- /dev/null +++ b/Source/CDR.Register.Repository/Entities/Enumerations.cs @@ -0,0 +1,74 @@ +namespace CDR.Register.Repository.Entities.Enumerations +{ + public enum Industry + { + ALL = 0, + BANKING, + ENERGY, + TELCO, + } + + public enum OrganisationType + { + Unknown = 0, + SoleTrader = 1, + Company = 2, + Partnership = 3, + Trust = 4, + GovernmentEntity = 5, + Other = 6, + } + + public enum AccreditationLevel + { + // Sponsored by Default + Sponsored = 0, + Unrestricted = 1, + } + + public enum ParticipationStatus + { + Unknown = 0, + Active = 1, + Removed = 2, + Suspended = 3, + Revoked = 4, + Surrendered = 5, + Inactive = 6, + } + + public enum LegalEntityStatus + { + Active = 1, + Removed = 2, + } + + public enum BrandStatus + { + Unknown = 0, + Active = 1, + Inactive = 2, + Removed = 3, + } + + public enum ParticipationType + { + Unknown = 0, + Dh = 1, + Dr = 2, + } + + public enum RegisterUType + { + Unknown = 0, + SignedJwt = 1, + } + + public enum SoftwareProductStatus + { + Unknown = 0, + Active = 1, + Inactive = 2, + Removed = 3, + } +} diff --git a/Source/CDR.Register.Repository/IRegisterDiscoveryRepository.cs b/Source/CDR.Register.Repository/IRegisterDiscoveryRepository.cs index 6e6c671..2ea0ddf 100644 --- a/Source/CDR.Register.Repository/IRegisterDiscoveryRepository.cs +++ b/Source/CDR.Register.Repository/IRegisterDiscoveryRepository.cs @@ -2,16 +2,15 @@ using System.Threading.Tasks; using CDR.Register.Domain.Entities; using CDR.Register.Domain.ValueObjects; -using CDR.Register.Repository.Specifications; namespace CDR.Register.Repository.Interfaces { public interface IRegisterDiscoveryRepository { - Task> GetDataHolderBrands(Infrastructure.Industry industry, IBrandSpecification specification, DateTime? updatedSince, int page, int pageSize); + Task> GetDataHolderBrandsAsync(Infrastructure.Industry industry, DateTime? updatedSince, int page, int pageSize); - Task GetDataRecipientsAsync(); + Task GetDataRecipientsAsync(Infrastructure.Industry industry); - Task GetSoftwareProductId(Guid softwareProductId); + Task GetSoftwareProductIdAsync(Guid softwareProductId); } } diff --git a/Source/CDR.Register.Repository/IRegisterStatusRepository.cs b/Source/CDR.Register.Repository/IRegisterStatusRepository.cs index 1d27c18..96dfa7f 100644 --- a/Source/CDR.Register.Repository/IRegisterStatusRepository.cs +++ b/Source/CDR.Register.Repository/IRegisterStatusRepository.cs @@ -1,15 +1,14 @@ using System.Threading.Tasks; using CDR.Register.Domain.Entities; -using CDR.Register.Repository.Specifications; namespace CDR.Register.Repository.Interfaces { public interface IRegisterStatusRepository { - Task GetDataRecipientStatuses(Infrastructure.Industry industry, IParticipationSpecification specification); + Task GetDataRecipientStatusesAsync(Infrastructure.Industry industry); - Task GetSoftwareProductStatuses(Infrastructure.Industry industry, IParticipationSpecification specification); + Task GetSoftwareProductStatusesAsync(Infrastructure.Industry industry); - Task GetDataHolderStatuses(Infrastructure.Industry industry, IParticipationSpecification specification); + Task GetDataHolderStatusesAsync(Infrastructure.Industry industry); } } diff --git a/Source/CDR.Register.Repository/Infrastructure/Extensions.cs b/Source/CDR.Register.Repository/Infrastructure/Extensions.cs index b5d4ccc..258a4eb 100644 --- a/Source/CDR.Register.Repository/Infrastructure/Extensions.cs +++ b/Source/CDR.Register.Repository/Infrastructure/Extensions.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq; using System.Threading.Tasks; -using CDR.Register.Domain.Extensions; using CDR.Register.Domain.ValueObjects; using CDR.Register.Repository.Entities; using CDR.Register.Repository.Enums; @@ -21,9 +20,8 @@ public static void SeedDatabase(this ModelBuilder modelBuilder) { // Add Seed Data for the reference types modelBuilder.Entity().HasData( - new IndustryType { IndustryTypeId = Industry.BANKING, IndustryTypeCode = EnumExtensions.GetDescription(Industry.BANKING) }, - new IndustryType { IndustryTypeId = Industry.ENERGY, IndustryTypeCode = EnumExtensions.GetDescription(Industry.ENERGY) }, - new IndustryType { IndustryTypeId = Industry.NONBANKLENDING, IndustryTypeCode = EnumExtensions.GetDescription(Industry.NONBANKLENDING) }); + new IndustryType { IndustryTypeId = Industry.BANKING, IndustryTypeCode = Industry.BANKING.ToString().ToLower() }, + new IndustryType { IndustryTypeId = Industry.ENERGY, IndustryTypeCode = Industry.ENERGY.ToString().ToLower() }); modelBuilder.Entity().HasData( new OrganisationType { OrganisationTypeId = OrganisationTypes.SoleTrader, OrganisationTypeCode = "SOLE_TRADER" }, diff --git a/Source/CDR.Register.Repository/Infrastructure/Industry.cs b/Source/CDR.Register.Repository/Infrastructure/Industry.cs index 88104a1..ccb8e76 100644 --- a/Source/CDR.Register.Repository/Infrastructure/Industry.cs +++ b/Source/CDR.Register.Repository/Infrastructure/Industry.cs @@ -1,46 +1,10 @@ -using System.ComponentModel; -using System.Runtime.Serialization; - -namespace CDR.Register.Repository.Infrastructure +namespace CDR.Register.Repository.Infrastructure { - /// - /// The industry. - /// public enum Industry { - /// - /// All industries. - /// - [Description("all")] - [EnumMember(Value = "all")] ALL = 0, - - /// - /// Banking. - /// - [Description("banking")] - [EnumMember(Value = "banking")] - BANKING = 1, - - /// - /// Energy. - /// - [Description("energy")] - [EnumMember(Value = "energy")] - ENERGY = 2, - - /// - /// Non-Bank Lending. - /// - [Description("non-bank-lending")] - [EnumMember(Value = "non-bank-lending")] - NONBANKLENDING = 3, - - /// - /// Telecoms Company. - /// - [Description("telco")] - [EnumMember(Value = "telco")] - TELCO = 4, + BANKING, + ENERGY, + TELCO, } } diff --git a/Source/CDR.Register.Repository/Infrastructure/MappingProfile.cs b/Source/CDR.Register.Repository/Infrastructure/MappingProfile.cs index 13e7e85..3e72c35 100644 --- a/Source/CDR.Register.Repository/Infrastructure/MappingProfile.cs +++ b/Source/CDR.Register.Repository/Infrastructure/MappingProfile.cs @@ -1,8 +1,6 @@ using System; using System.Linq; using AutoMapper; -using CDR.Register.Domain; -using CDR.Register.Domain.Extensions; using CDR.Register.Repository.Entities; using CDR.Register.Repository.Enums; using DomainEntities = CDR.Register.Domain.Entities; @@ -15,24 +13,19 @@ public MappingProfile() { this.CreateMap() .ForMember(dest => dest.OrganisationType, source => source.MapFrom(source => source.OrganisationType.OrganisationTypeCode)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Participations.FirstOrDefault().Status.ParticipationStatusCode.ToUpper())) - .MaxDepth(Constants.MappingConstants.MaxDepth); - + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Participations.FirstOrDefault().Status.ParticipationStatusCode.ToUpper())); this.CreateMap() .ForMember(dest => dest.OrganisationTypeId, source => source.MapFrom(source => source.OrganisationType == null ? null : Enum.Parse(typeof(OrganisationTypes), source.OrganisationType.Replace("_", string.Empty), true))) - .ForMember(dest => dest.OrganisationType, opt => opt.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.OrganisationType, opt => opt.Ignore()); this.CreateMap() .ForMember(dest => dest.OrganisationType, source => source.MapFrom(source => source.OrganisationType.OrganisationTypeCode)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Participations.FirstOrDefault().Status.ParticipationStatusCode.ToUpper())) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Participations.FirstOrDefault().Status.ParticipationStatusCode.ToUpper())); this.CreateMap() .ForMember(dest => dest.OrganisationTypeId, source => source.MapFrom(source => source.OrganisationType == null ? null : Enum.Parse(typeof(OrganisationTypes), source.OrganisationType.Replace("_", string.Empty), true))) - .ForMember(dest => dest.OrganisationType, opt => opt.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.OrganisationType, opt => opt.Ignore()); this.CreateMap() .ForMember(dest => dest.DataHolderId, source => source.MapFrom(source => source.ParticipationId)) @@ -40,16 +33,14 @@ public MappingProfile() .ForMember(dest => dest.IsActive, source => source.MapFrom(source => source.Status.ParticipationStatusId == ParticipationStatusType.Active)) .ForMember(dest => dest.Industry, source => source.MapFrom(source => source.Industry.IndustryTypeCode)) .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source.LegalEntity)) - .ForMember(dest => dest.Brands, source => source.MapFrom(source => source.Brands)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Brands, source => source.MapFrom(source => source.Brands)); this.CreateMap() .ForMember(dest => dest.StatusId, source => source.MapFrom(source => Enum.Parse(typeof(ParticipationStatusType), source.Status, true))) - .ForMember(dest => dest.IndustryId, source => source.MapFrom(source => EnumExtensions.ParseFromDescription(source.Industry))) + .ForMember(dest => dest.IndustryId, source => source.MapFrom(source => Enum.Parse(typeof(Industry), source.Industry, true))) .ForMember(dest => dest.ParticipationTypeId, source => source.MapFrom(source => ParticipationTypes.Dh)) // This is a Dh Participation .ForMember(dest => dest.Industry, opt => opt.Ignore()) .ForMember(dest => dest.Status, opt => opt.Ignore()) - .ForMember(dest => dest.ParticipationType, opt => opt.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.ParticipationType, opt => opt.Ignore()); this.CreateMap() .ForMember(dest => dest.DataRecipientId, source => source.MapFrom(source => source.ParticipationId)) @@ -57,12 +48,10 @@ public MappingProfile() .ForMember(dest => dest.LegalEntity, source => source.MapFrom(source => source.LegalEntity)) .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.ParticipationStatusCode)) .ForMember(dest => dest.DataRecipientBrands, source => source.MapFrom(source => source.Brands)) - .MaxDepth(Constants.MappingConstants.MaxDepth) .ReverseMap(); this.CreateMap() .ForMember(dest => dest.Status, source => source.MapFrom(source => source.StatusId.ToString().ToUpper())) - .MaxDepth(Constants.MappingConstants.MaxDepth) .ReverseMap(); this.CreateMap() @@ -70,67 +59,57 @@ public MappingProfile() .ForMember(dest => dest.IsActive, source => source.MapFrom(source => source.BrandStatus.BrandStatusId == BrandStatusType.Active)) .ForMember(dest => dest.DataHolderAuthentications, source => source.MapFrom(source => source.AuthDetails)) .ForMember(dest => dest.DataHolderBrandServiceEndpoint, source => source.MapFrom(source => source.Endpoint)) - .ForMember(dest => dest.DataHolder, source => source.MapFrom(source => source.Participation)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.DataHolder, source => source.MapFrom(source => source.Participation)); this.CreateMap() .ForMember(dest => dest.BrandName, source => source.MapFrom(source => source.BrandName)) .ForMember(dest => dest.LogoUri, source => source.MapFrom(source => source.LogoUri)) .ForMember(dest => dest.BrandStatusId, source => source.MapFrom(source => Enum.Parse(typeof(BrandStatusType), source.BrandStatus, true))) - .ForMember(dest => dest.BrandStatus, opt => opt.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.BrandStatus, opt => opt.Ignore()); this.CreateMap() .ForMember(dest => dest.BrandStatus, source => source.MapFrom(source => source.BrandStatus.BrandStatusCode)) .ForMember(dest => dest.IsActive, source => source.MapFrom(source => source.BrandStatus.BrandStatusId == BrandStatusType.Active)) .ForMember(dest => dest.SoftwareProducts, source => source.MapFrom(source => source.SoftwareProducts)) - .ForMember(dest => dest.DataRecipient, source => source.MapFrom(source => source.Participation)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.DataRecipient, source => source.MapFrom(source => source.Participation)); this.CreateMap() .ForMember(dest => dest.BrandStatusId, source => source.MapFrom(source => Enum.Parse(typeof(BrandStatusType), source.BrandStatus, true))) .ForMember(dest => dest.BrandStatus, opts => opts.Ignore()) - .ForMember(dest => dest.SoftwareProducts, opts => opts.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.SoftwareProducts, opts => opts.Ignore()); this.CreateMap() .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status.SoftwareProductStatusCode)) .ForMember(dest => dest.IsActive, source => source.MapFrom(source => source.Status.SoftwareProductStatusId == SoftwareProductStatusType.Active)) .ForMember(dest => dest.RedirectUri, source => source.MapFrom(src => src.RedirectUris)) .ForMember(dest => dest.RedirectUris, opts => opts.Ignore()) // Ignore this as it is a computed property with no setter - .ForMember(dest => dest.DataRecipientBrand, source => source.MapFrom(s => s.Brand)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.DataRecipientBrand, source => source.MapFrom(s => s.Brand)); this.CreateMap() .ForMember(dest => dest.StatusId, source => source.MapFrom(source => Enum.Parse(typeof(SoftwareProductStatusType), source.Status, true))) .ForMember(dest => dest.RedirectUris, source => source.MapFrom(src => src.RedirectUris != null ? string.Join(" ", src.RedirectUris) : string.Empty)) .ForMember(dest => dest.Status, opts => opts.Ignore()) - .ForMember(dest => dest.Certificates, opts => opts.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Certificates, opts => opts.Ignore()); this.CreateMap() .ForMember(dest => dest.Id, source => source.MapFrom(s => s.SoftwareProductId)) .ForMember(dest => dest.Name, source => source.MapFrom(s => s.SoftwareProductName)) .ForMember(dest => dest.JwksUri, source => source.MapFrom(s => s.JwksUri)) - .ForMember(dest => dest.X509Certificates, source => source.MapFrom(s => s.Certificates)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.X509Certificates, source => source.MapFrom(s => s.Certificates)); - this.CreateMap().ReverseMap().MaxDepth(Constants.MappingConstants.MaxDepth); + this.CreateMap().ReverseMap(); this.CreateMap() - .ForMember(dest => dest.RegisterUType, source => source.MapFrom(source => source.RegisterUType.RegisterUTypeCode)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.RegisterUType, source => source.MapFrom(source => source.RegisterUType.RegisterUTypeCode)); this.CreateMap() .ForMember(dest => dest.RegisterUTypeId, source => source.MapFrom(source => Enum.Parse(typeof(RegisterUTypes), source.RegisterUType.Replace("-", string.Empty), true))) .ForMember(dest => dest.JwksEndpoint, source => source.MapFrom(source => source.JwksEndpoint)) .ForMember(dest => dest.RegisterUType, opt => opt.Ignore()) .ForMember(dest => dest.Brand, opt => opt.Ignore()) - .ForMember(dest => dest.BrandId, opt => opt.Ignore()) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.BrandId, opt => opt.Ignore()); this.CreateMap() - .ReverseMap() - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ReverseMap(); } } } diff --git a/Source/CDR.Register.Repository/Infrastructure/RegisterDatabaseContext.cs b/Source/CDR.Register.Repository/Infrastructure/RegisterDatabaseContext.cs index 4fc8ec7..e5dbddf 100644 --- a/Source/CDR.Register.Repository/Infrastructure/RegisterDatabaseContext.cs +++ b/Source/CDR.Register.Repository/Infrastructure/RegisterDatabaseContext.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; -using System.Linq; -using System.Reflection; +using System.Linq; using CDR.Register.Repository.Entities; using Microsoft.EntityFrameworkCore; @@ -71,52 +69,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity().ToTable("Participation", t => t.IsTemporal()); modelBuilder.Entity().ToTable("SoftwareProduct", t => t.IsTemporal()); modelBuilder.Entity().ToTable("SoftwareProductCertificate", t => t.IsTemporal()); - AddColumnDescriptions(modelBuilder); // Seed the database with reference data and initial data modelBuilder.SeedDatabase(); } - - /// - /// Process entities in the model for any Description attributes on their properties, and translate them to a comment so that the underlying store has that additional metadata. - /// - /// For MSSQL, this will populate the MS_DESCRIPTION property on the columns. - /// The EF model. - private static void AddColumnDescriptions(ModelBuilder modelBuilder) - { - foreach (var entityType in modelBuilder.Model.GetEntityTypes()) - { - var clrType = entityType.ClrType; - if (clrType == null) - { - continue; - } - - // Apply table-level comment from [Description] - var tableDesc = clrType.GetCustomAttribute(); - if (tableDesc != null) - { - modelBuilder.Entity(clrType) - .ToTable(t => t.HasComment(tableDesc.Description)); - } - - // Apply property-level comments from [Description] - foreach (var propInfo in entityType.GetProperties().Select(x => x.PropertyInfo)) - { - if (propInfo == null) - { - continue; - } - - var propDesc = propInfo.GetCustomAttribute(); - if (propDesc != null) - { - modelBuilder.Entity(clrType) - .Property(propInfo.Name) - .HasComment(propDesc.Description); - } - } - } - } } } diff --git a/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.Designer.cs b/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.Designer.cs deleted file mode 100644 index afafabd..0000000 --- a/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.Designer.cs +++ /dev/null @@ -1,877 +0,0 @@ -// -using System; -using CDR.Register.Repository.Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace CDR.Register.Repository.Migrations -{ - [DbContext(typeof(RegisterDatabaseContext))] - [Migration("20260206034555_AddNonBankLendingIndustry")] - partial class AddNonBankLendingIndustry - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.21") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AccreditationLevel", b => - { - b.Property("AccreditationLevelId") - .HasColumnType("int"); - - b.Property("AccreditationLevelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("AccreditationLevelId"); - - b.ToTable("AccreditationLevel", (string)null); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AuthDetail", b => - { - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("RegisterUTypeId") - .HasColumnType("int"); - - b.Property("JwksEndpoint") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.HasKey("BrandId", "RegisterUTypeId"); - - b.HasIndex("RegisterUTypeId"); - - b.ToTable("AuthDetail", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("AuthDetailHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.Property("BrandId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BrandName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("BrandStatusId") - .HasColumnType("int"); - - b.Property("LastUpdated") - .HasColumnType("datetime2"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ParticipationId") - .HasColumnType("uniqueidentifier"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.HasKey("BrandId"); - - b.HasIndex("BrandStatusId"); - - b.HasIndex("ParticipationId"); - - b.ToTable("Brand", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("BrandHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.BrandStatus", b => - { - b.Property("BrandStatusId") - .HasColumnType("int"); - - b.Property("BrandStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("BrandStatusId"); - - b.ToTable("BrandStatus", (string)null); - - b.HasData( - new - { - BrandStatusId = 1, - BrandStatusCode = "ACTIVE" - }, - new - { - BrandStatusId = 2, - BrandStatusCode = "INACTIVE" - }, - new - { - BrandStatusId = 3, - BrandStatusCode = "REMOVED" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Endpoint", b => - { - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("ExtensionBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("InfosecBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("PublicBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ResourceBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Version") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("WebsiteUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.HasKey("BrandId"); - - b.ToTable("Endpoint", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("EndpointHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.IndustryType", b => - { - b.Property("IndustryTypeId") - .HasColumnType("int"); - - b.Property("IndustryTypeCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("IndustryTypeId"); - - b.ToTable("IndustryType", (string)null); - - b.HasData( - new - { - IndustryTypeId = 1, - IndustryTypeCode = "banking" - }, - new - { - IndustryTypeId = 2, - IndustryTypeCode = "energy" - }, - new - { - IndustryTypeId = 3, - IndustryTypeCode = "non-bank-lending" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.Property("LegalEntityId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Abn") - .HasMaxLength(11) - .HasColumnType("nvarchar(11)"); - - b.Property("AccreditationLevelId") - .HasColumnType("int"); - - b.Property("AccreditationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Acn") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("AnzsicDivision") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Arbn") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("LegalEntityName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("OrganisationTypeId") - .HasColumnType("int"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("RegisteredCountry") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegistrationDate") - .HasColumnType("datetime2"); - - b.Property("RegistrationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("LegalEntityId"); - - b.HasIndex("AccreditationLevelId"); - - b.HasIndex("OrganisationTypeId"); - - b.ToTable("LegalEntity", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("LegalEntityHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.OrganisationType", b => - { - b.Property("OrganisationTypeId") - .HasColumnType("int"); - - b.Property("OrganisationTypeCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("OrganisationTypeId"); - - b.ToTable("OrganisationType", (string)null); - - b.HasData( - new - { - OrganisationTypeId = 1, - OrganisationTypeCode = "SOLE_TRADER" - }, - new - { - OrganisationTypeId = 2, - OrganisationTypeCode = "COMPANY" - }, - new - { - OrganisationTypeId = 3, - OrganisationTypeCode = "PARTNERSHIP" - }, - new - { - OrganisationTypeId = 4, - OrganisationTypeCode = "TRUST" - }, - new - { - OrganisationTypeId = 5, - OrganisationTypeCode = "GOVERNMENT_ENTITY" - }, - new - { - OrganisationTypeId = 6, - OrganisationTypeCode = "OTHER" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.Property("ParticipationId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("LegalEntityId") - .HasColumnType("uniqueidentifier"); - - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.HasKey("ParticipationId"); - - b.HasIndex("IndustryId"); - - b.HasIndex("LegalEntityId"); - - b.HasIndex("ParticipationTypeId"); - - b.HasIndex("StatusId"); - - b.ToTable("Participation", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("ParticipationHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.ParticipationStatus", b => - { - b.Property("ParticipationStatusId") - .HasColumnType("int"); - - b.Property("ParticipationStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.HasKey("ParticipationStatusId"); - - b.ToTable("ParticipationStatus", (string)null); - - b.HasData( - new - { - ParticipationStatusId = 1, - ParticipationStatusCode = "ACTIVE" - }, - new - { - ParticipationStatusId = 2, - ParticipationStatusCode = "REMOVED", - ParticipationTypeId = 1 - }, - new - { - ParticipationStatusId = 3, - ParticipationStatusCode = "SUSPENDED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 4, - ParticipationStatusCode = "REVOKED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 5, - ParticipationStatusCode = "SURRENDERED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 6, - ParticipationStatusCode = "INACTIVE" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.ParticipationType", b => - { - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.Property("ParticipationTypeCode") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.HasKey("ParticipationTypeId"); - - b.ToTable("ParticipationType", (string)null); - - b.HasData( - new - { - ParticipationTypeId = 1, - ParticipationTypeCode = "DH" - }, - new - { - ParticipationTypeId = 2, - ParticipationTypeCode = "DR" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.RegisterUType", b => - { - b.Property("RegisterUTypeId") - .HasColumnType("int"); - - b.Property("RegisterUTypeCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("RegisterUTypeId"); - - b.ToTable("RegisterUType", (string)null); - - b.HasData( - new - { - RegisterUTypeId = 1, - RegisterUTypeCode = "SIGNED-JWT" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.Property("SoftwareProductId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClientUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("JwksUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("PolicyUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("RecipientBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("RedirectUris") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("RevocationUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Scope") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("SectorIdentifierUri") - .HasMaxLength(2048) - .HasColumnType("nvarchar(2048)"); - - b.Property("SoftwareProductDescription") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("SoftwareProductName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("TosUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.HasKey("SoftwareProductId"); - - b.HasIndex("BrandId"); - - b.HasIndex("StatusId"); - - b.ToTable("SoftwareProduct", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductCertificate", b => - { - b.Property("SoftwareProductCertificateId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CommonName") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("SoftwareProductId") - .HasColumnType("uniqueidentifier"); - - b.Property("Thumbprint") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.HasKey("SoftwareProductCertificateId"); - - b.HasIndex("SoftwareProductId"); - - b.ToTable("SoftwareProductCertificate", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductCertificateHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductStatus", b => - { - b.Property("SoftwareProductStatusId") - .HasColumnType("int"); - - b.Property("SoftwareProductStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("SoftwareProductStatusId"); - - b.ToTable("SoftwareProductStatus", (string)null); - - b.HasData( - new - { - SoftwareProductStatusId = 1, - SoftwareProductStatusCode = "ACTIVE" - }, - new - { - SoftwareProductStatusId = 2, - SoftwareProductStatusCode = "INACTIVE" - }, - new - { - SoftwareProductStatusId = 3, - SoftwareProductStatusCode = "REMOVED" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AuthDetail", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithMany("AuthDetails") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.RegisterUType", "RegisterUType") - .WithMany() - .HasForeignKey("RegisterUTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("RegisterUType"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.HasOne("CDR.Register.Repository.Entities.BrandStatus", "BrandStatus") - .WithMany() - .HasForeignKey("BrandStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.Participation", "Participation") - .WithMany("Brands") - .HasForeignKey("ParticipationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BrandStatus"); - - b.Navigation("Participation"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Endpoint", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithOne("Endpoint") - .HasForeignKey("CDR.Register.Repository.Entities.Endpoint", "BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.HasOne("CDR.Register.Repository.Entities.AccreditationLevel", "AccreditationLevel") - .WithMany() - .HasForeignKey("AccreditationLevelId"); - - b.HasOne("CDR.Register.Repository.Entities.OrganisationType", "OrganisationType") - .WithMany() - .HasForeignKey("OrganisationTypeId"); - - b.Navigation("AccreditationLevel"); - - b.Navigation("OrganisationType"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.HasOne("CDR.Register.Repository.Entities.IndustryType", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.HasOne("CDR.Register.Repository.Entities.LegalEntity", "LegalEntity") - .WithMany("Participations") - .HasForeignKey("LegalEntityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.ParticipationType", "ParticipationType") - .WithMany() - .HasForeignKey("ParticipationTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.ParticipationStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Industry"); - - b.Navigation("LegalEntity"); - - b.Navigation("ParticipationType"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithMany("SoftwareProducts") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.SoftwareProductStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductCertificate", b => - { - b.HasOne("CDR.Register.Repository.Entities.SoftwareProduct", "SoftwareProduct") - .WithMany("Certificates") - .HasForeignKey("SoftwareProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoftwareProduct"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.Navigation("AuthDetails"); - - b.Navigation("Endpoint"); - - b.Navigation("SoftwareProducts"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.Navigation("Participations"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.Navigation("Brands"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.Navigation("Certificates"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.cs b/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.cs deleted file mode 100644 index 876eea1..0000000 --- a/Source/CDR.Register.Repository/Migrations/20260206034555_AddNonBankLendingIndustry.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace CDR.Register.Repository.Migrations -{ - /// - public partial class AddNonBankLendingIndustry : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.InsertData( - table: "IndustryType", - columns: new[] { "IndustryTypeId", "IndustryTypeCode" }, - values: new object[] { 3, "non-bank-lending" }); - - // Update existing industries to use lowercase values to match current code - migrationBuilder.UpdateData("IndustryType", "IndustryTypeId", 1, "IndustryTypeCode", "banking"); - migrationBuilder.UpdateData("IndustryType", "IndustryTypeId", 2, "IndustryTypeCode", "energy"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DeleteData( - table: "IndustryType", - keyColumn: "IndustryTypeId", - keyValue: 3); - - // Revert changes to existing industries - migrationBuilder.UpdateData("IndustryType", "IndustryTypeId", 1, "IndustryTypeCode", "Banking"); - migrationBuilder.UpdateData("IndustryType", "IndustryTypeId", 2, "IndustryTypeCode", "Energy"); - } - } -} diff --git a/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.Designer.cs b/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.Designer.cs deleted file mode 100644 index 5c0b5f2..0000000 --- a/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.Designer.cs +++ /dev/null @@ -1,887 +0,0 @@ -// -using System; -using CDR.Register.Repository.Infrastructure; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace CDR.Register.Repository.Migrations -{ - [DbContext(typeof(RegisterDatabaseContext))] - [Migration("20260206040556_AddWhiteLabellingFields")] - partial class AddWhiteLabellingFields - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.21") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AccreditationLevel", b => - { - b.Property("AccreditationLevelId") - .HasColumnType("int"); - - b.Property("AccreditationLevelCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("AccreditationLevelId"); - - b.ToTable("AccreditationLevel", (string)null); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AuthDetail", b => - { - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("RegisterUTypeId") - .HasColumnType("int"); - - b.Property("JwksEndpoint") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.HasKey("BrandId", "RegisterUTypeId"); - - b.HasIndex("RegisterUTypeId"); - - b.ToTable("AuthDetail", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("AuthDetailHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.Property("BrandId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BrandGroup") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("The brand group for white-labelling"); - - b.Property("BrandName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("BrandStatusId") - .HasColumnType("int"); - - b.Property("LastUpdated") - .HasColumnType("datetime2"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ParticipationId") - .HasColumnType("uniqueidentifier"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.HasKey("BrandId"); - - b.HasIndex("BrandStatusId"); - - b.HasIndex("ParticipationId"); - - b.ToTable("Brand", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("BrandHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.BrandStatus", b => - { - b.Property("BrandStatusId") - .HasColumnType("int"); - - b.Property("BrandStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("BrandStatusId"); - - b.ToTable("BrandStatus", (string)null); - - b.HasData( - new - { - BrandStatusId = 1, - BrandStatusCode = "ACTIVE" - }, - new - { - BrandStatusId = 2, - BrandStatusCode = "INACTIVE" - }, - new - { - BrandStatusId = 3, - BrandStatusCode = "REMOVED" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Endpoint", b => - { - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("ExtensionBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("InfosecBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("ProductBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)") - .HasComment("The PRD base URI"); - - b.Property("PublicBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("ResourceBaseUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Version") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("WebsiteUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.HasKey("BrandId"); - - b.ToTable("Endpoint", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("EndpointHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.IndustryType", b => - { - b.Property("IndustryTypeId") - .HasColumnType("int"); - - b.Property("IndustryTypeCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("IndustryTypeId"); - - b.ToTable("IndustryType", (string)null); - - b.HasData( - new - { - IndustryTypeId = 1, - IndustryTypeCode = "banking" - }, - new - { - IndustryTypeId = 2, - IndustryTypeCode = "energy" - }, - new - { - IndustryTypeId = 3, - IndustryTypeCode = "non-bank-lending" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.Property("LegalEntityId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Abn") - .HasMaxLength(11) - .HasColumnType("nvarchar(11)"); - - b.Property("AccreditationLevelId") - .HasColumnType("int"); - - b.Property("AccreditationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Acn") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("AnzsicDivision") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Arbn") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("LegalEntityName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("OrganisationTypeId") - .HasColumnType("int"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("RegisteredCountry") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("RegistrationDate") - .HasColumnType("datetime2"); - - b.Property("RegistrationNumber") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("LegalEntityId"); - - b.HasIndex("AccreditationLevelId"); - - b.HasIndex("OrganisationTypeId"); - - b.ToTable("LegalEntity", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("LegalEntityHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.OrganisationType", b => - { - b.Property("OrganisationTypeId") - .HasColumnType("int"); - - b.Property("OrganisationTypeCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("OrganisationTypeId"); - - b.ToTable("OrganisationType", (string)null); - - b.HasData( - new - { - OrganisationTypeId = 1, - OrganisationTypeCode = "SOLE_TRADER" - }, - new - { - OrganisationTypeId = 2, - OrganisationTypeCode = "COMPANY" - }, - new - { - OrganisationTypeId = 3, - OrganisationTypeCode = "PARTNERSHIP" - }, - new - { - OrganisationTypeId = 4, - OrganisationTypeCode = "TRUST" - }, - new - { - OrganisationTypeId = 5, - OrganisationTypeCode = "GOVERNMENT_ENTITY" - }, - new - { - OrganisationTypeId = 6, - OrganisationTypeCode = "OTHER" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.Property("ParticipationId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("IndustryId") - .HasColumnType("int"); - - b.Property("LegalEntityId") - .HasColumnType("uniqueidentifier"); - - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.HasKey("ParticipationId"); - - b.HasIndex("IndustryId"); - - b.HasIndex("LegalEntityId"); - - b.HasIndex("ParticipationTypeId"); - - b.HasIndex("StatusId"); - - b.ToTable("Participation", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("ParticipationHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.ParticipationStatus", b => - { - b.Property("ParticipationStatusId") - .HasColumnType("int"); - - b.Property("ParticipationStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.HasKey("ParticipationStatusId"); - - b.ToTable("ParticipationStatus", (string)null); - - b.HasData( - new - { - ParticipationStatusId = 1, - ParticipationStatusCode = "ACTIVE" - }, - new - { - ParticipationStatusId = 2, - ParticipationStatusCode = "REMOVED", - ParticipationTypeId = 1 - }, - new - { - ParticipationStatusId = 3, - ParticipationStatusCode = "SUSPENDED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 4, - ParticipationStatusCode = "REVOKED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 5, - ParticipationStatusCode = "SURRENDERED", - ParticipationTypeId = 2 - }, - new - { - ParticipationStatusId = 6, - ParticipationStatusCode = "INACTIVE" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.ParticipationType", b => - { - b.Property("ParticipationTypeId") - .HasColumnType("int"); - - b.Property("ParticipationTypeCode") - .IsRequired() - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.HasKey("ParticipationTypeId"); - - b.ToTable("ParticipationType", (string)null); - - b.HasData( - new - { - ParticipationTypeId = 1, - ParticipationTypeCode = "DH" - }, - new - { - ParticipationTypeId = 2, - ParticipationTypeCode = "DR" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.RegisterUType", b => - { - b.Property("RegisterUTypeId") - .HasColumnType("int"); - - b.Property("RegisterUTypeCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("RegisterUTypeId"); - - b.ToTable("RegisterUType", (string)null); - - b.HasData( - new - { - RegisterUTypeId = 1, - RegisterUTypeCode = "SIGNED-JWT" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.Property("SoftwareProductId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BrandId") - .HasColumnType("uniqueidentifier"); - - b.Property("ClientUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("JwksUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("LogoUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("PolicyUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("RecipientBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("RedirectUris") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("RevocationUri") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Scope") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("SectorIdentifierUri") - .HasMaxLength(2048) - .HasColumnType("nvarchar(2048)"); - - b.Property("SoftwareProductDescription") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("SoftwareProductName") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("StatusId") - .HasColumnType("int"); - - b.Property("TosUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.HasKey("SoftwareProductId"); - - b.HasIndex("BrandId"); - - b.HasIndex("StatusId"); - - b.ToTable("SoftwareProduct", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductCertificate", b => - { - b.Property("SoftwareProductCertificateId") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CommonName") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.Property("PeriodEnd") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodEnd"); - - b.Property("PeriodStart") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("datetime2") - .HasColumnName("PeriodStart"); - - b.Property("SoftwareProductId") - .HasColumnType("uniqueidentifier"); - - b.Property("Thumbprint") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("nvarchar(2000)"); - - b.HasKey("SoftwareProductCertificateId"); - - b.HasIndex("SoftwareProductId"); - - b.ToTable("SoftwareProductCertificate", (string)null); - - b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductCertificateHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductStatus", b => - { - b.Property("SoftwareProductStatusId") - .HasColumnType("int"); - - b.Property("SoftwareProductStatusCode") - .IsRequired() - .HasMaxLength(25) - .HasColumnType("nvarchar(25)"); - - b.HasKey("SoftwareProductStatusId"); - - b.ToTable("SoftwareProductStatus", (string)null); - - b.HasData( - new - { - SoftwareProductStatusId = 1, - SoftwareProductStatusCode = "ACTIVE" - }, - new - { - SoftwareProductStatusId = 2, - SoftwareProductStatusCode = "INACTIVE" - }, - new - { - SoftwareProductStatusId = 3, - SoftwareProductStatusCode = "REMOVED" - }); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.AuthDetail", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithMany("AuthDetails") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.RegisterUType", "RegisterUType") - .WithMany() - .HasForeignKey("RegisterUTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("RegisterUType"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.HasOne("CDR.Register.Repository.Entities.BrandStatus", "BrandStatus") - .WithMany() - .HasForeignKey("BrandStatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.Participation", "Participation") - .WithMany("Brands") - .HasForeignKey("ParticipationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("BrandStatus"); - - b.Navigation("Participation"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Endpoint", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithOne("Endpoint") - .HasForeignKey("CDR.Register.Repository.Entities.Endpoint", "BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.HasOne("CDR.Register.Repository.Entities.AccreditationLevel", "AccreditationLevel") - .WithMany() - .HasForeignKey("AccreditationLevelId"); - - b.HasOne("CDR.Register.Repository.Entities.OrganisationType", "OrganisationType") - .WithMany() - .HasForeignKey("OrganisationTypeId"); - - b.Navigation("AccreditationLevel"); - - b.Navigation("OrganisationType"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.HasOne("CDR.Register.Repository.Entities.IndustryType", "Industry") - .WithMany() - .HasForeignKey("IndustryId"); - - b.HasOne("CDR.Register.Repository.Entities.LegalEntity", "LegalEntity") - .WithMany("Participations") - .HasForeignKey("LegalEntityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.ParticipationType", "ParticipationType") - .WithMany() - .HasForeignKey("ParticipationTypeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.ParticipationStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Industry"); - - b.Navigation("LegalEntity"); - - b.Navigation("ParticipationType"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.HasOne("CDR.Register.Repository.Entities.Brand", "Brand") - .WithMany("SoftwareProducts") - .HasForeignKey("BrandId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("CDR.Register.Repository.Entities.SoftwareProductStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Brand"); - - b.Navigation("Status"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductCertificate", b => - { - b.HasOne("CDR.Register.Repository.Entities.SoftwareProduct", "SoftwareProduct") - .WithMany("Certificates") - .HasForeignKey("SoftwareProductId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SoftwareProduct"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => - { - b.Navigation("AuthDetails"); - - b.Navigation("Endpoint"); - - b.Navigation("SoftwareProducts"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.LegalEntity", b => - { - b.Navigation("Participations"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.Participation", b => - { - b.Navigation("Brands"); - }); - - modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProduct", b => - { - b.Navigation("Certificates"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.cs b/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.cs deleted file mode 100644 index 79dc659..0000000 --- a/Source/CDR.Register.Repository/Migrations/20260206040556_AddWhiteLabellingFields.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace CDR.Register.Repository.Migrations -{ - /// - public partial class AddWhiteLabellingFields : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "ProductBaseUri", - table: "Endpoint", - type: "nvarchar(1000)", - maxLength: 1000, - nullable: true, - comment: "The PRD base URI") - .Annotation("SqlServer:IsTemporal", true) - .Annotation("SqlServer:TemporalHistoryTableName", "EndpointHistory") - .Annotation("SqlServer:TemporalHistoryTableSchema", null) - .Annotation("SqlServer:TemporalPeriodEndColumnName", "PeriodEnd") - .Annotation("SqlServer:TemporalPeriodStartColumnName", "PeriodStart"); - - migrationBuilder.AddColumn( - name: "BrandGroup", - table: "Brand", - type: "nvarchar(100)", - maxLength: 100, - nullable: true, - comment: "The brand group for white-labelling") - .Annotation("SqlServer:IsTemporal", true) - .Annotation("SqlServer:TemporalHistoryTableName", "BrandHistory") - .Annotation("SqlServer:TemporalHistoryTableSchema", null) - .Annotation("SqlServer:TemporalPeriodEndColumnName", "PeriodEnd") - .Annotation("SqlServer:TemporalPeriodStartColumnName", "PeriodStart"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ProductBaseUri", - table: "Endpoint") - .Annotation("SqlServer:IsTemporal", true) - .Annotation("SqlServer:TemporalHistoryTableName", "EndpointHistory") - .Annotation("SqlServer:TemporalHistoryTableSchema", null) - .Annotation("SqlServer:TemporalPeriodEndColumnName", "PeriodEnd") - .Annotation("SqlServer:TemporalPeriodStartColumnName", "PeriodStart"); - - migrationBuilder.DropColumn( - name: "BrandGroup", - table: "Brand") - .Annotation("SqlServer:IsTemporal", true) - .Annotation("SqlServer:TemporalHistoryTableName", "BrandHistory") - .Annotation("SqlServer:TemporalHistoryTableSchema", null) - .Annotation("SqlServer:TemporalPeriodEndColumnName", "PeriodEnd") - .Annotation("SqlServer:TemporalPeriodStartColumnName", "PeriodStart"); - } - } -} diff --git a/Source/CDR.Register.Repository/Migrations/RegisterDatabaseContextModelSnapshot.cs b/Source/CDR.Register.Repository/Migrations/RegisterDatabaseContextModelSnapshot.cs index 92af714..212c9e0 100644 --- a/Source/CDR.Register.Repository/Migrations/RegisterDatabaseContextModelSnapshot.cs +++ b/Source/CDR.Register.Repository/Migrations/RegisterDatabaseContextModelSnapshot.cs @@ -17,10 +17,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.25") + .HasAnnotation("ProductVersion", "6.0.9") .HasAnnotation("Relational:MaxIdentifierLength", 128); - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); modelBuilder.Entity("CDR.Register.Repository.Entities.AccreditationLevel", b => { @@ -67,15 +67,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("AuthDetail", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("AuthDetailHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.Brand", b => @@ -84,11 +84,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("BrandGroup") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)") - .HasComment("The brand group for white-labelling"); - b.Property("BrandName") .IsRequired() .HasMaxLength(200) @@ -127,15 +122,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Brand", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("BrandHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.BrandStatus", b => @@ -194,11 +189,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2") .HasColumnName("PeriodStart"); - b.Property("ProductBaseUri") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)") - .HasComment("The PRD base URI"); - b.Property("PublicBaseUri") .IsRequired() .HasMaxLength(1000) @@ -224,15 +214,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Endpoint", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("EndpointHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.IndustryType", b => @@ -259,11 +249,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) { IndustryTypeId = 2, IndustryTypeCode = "energy" - }, - new - { - IndustryTypeId = 3, - IndustryTypeCode = "non-bank-lending" }); }); @@ -339,15 +324,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("LegalEntity", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("LegalEntityHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.OrganisationType", b => @@ -438,15 +423,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Participation", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("ParticipationHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.ParticipationStatus", b => @@ -638,15 +623,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("SoftwareProduct", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductCertificate", b => @@ -685,15 +670,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("SoftwareProductCertificate", (string)null); b.ToTable(tb => tb.IsTemporal(ttb => - { - ttb.UseHistoryTable("SoftwareProductCertificateHistory"); - ttb - .HasPeriodStart("PeriodStart") - .HasColumnName("PeriodStart"); - ttb - .HasPeriodEnd("PeriodEnd") - .HasColumnName("PeriodEnd"); - })); + { + ttb + .HasPeriodStart("PeriodStart") + .HasColumnName("PeriodStart"); + ttb + .HasPeriodEnd("PeriodEnd") + .HasColumnName("PeriodEnd"); + } + )); }); modelBuilder.Entity("CDR.Register.Repository.Entities.SoftwareProductStatus", b => diff --git a/Source/CDR.Register.Repository/RegisterDiscoveryRepository.cs b/Source/CDR.Register.Repository/RegisterDiscoveryRepository.cs index 8ccf59a..122d0e9 100644 --- a/Source/CDR.Register.Repository/RegisterDiscoveryRepository.cs +++ b/Source/CDR.Register.Repository/RegisterDiscoveryRepository.cs @@ -9,7 +9,6 @@ using CDR.Register.Repository.Enums; using CDR.Register.Repository.Infrastructure; using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; using Microsoft.EntityFrameworkCore; namespace CDR.Register.Repository @@ -25,9 +24,9 @@ public RegisterDiscoveryRepository(RegisterDatabaseContext registerDatabaseConte this._mapper = mapper; } - public async Task> GetDataHolderBrands(Infrastructure.Industry industry, IBrandSpecification specification, DateTime? updatedSince, int page, int pageSize) + public async Task> GetDataHolderBrandsAsync(Infrastructure.Industry industry, DateTime? updatedSince, int page, int pageSize) { - (List allBrands, int totalRecords) = await this.ProcessGetDataHolderBrands(industry, specification, updatedSince, page, pageSize); + (List allBrands, int totalRecords) = await this.ProcessGetDataHolderBrands(industry, updatedSince, page, pageSize); return new Page() { @@ -38,9 +37,9 @@ public async Task> GetDataHolderBrands(Infrastructure.In }; } - public async Task GetDataRecipientsAsync() + public async Task GetDataRecipientsAsync(Infrastructure.Industry industry) { - List allParticipants = await this.ProcessGetDataRecipients(); + List allParticipants = await this.ProcessGetDataRecipients(industry); // Additionally sort participants.brands, participants.brands.softwareproducts by id allParticipants.ForEach(p => @@ -55,7 +54,7 @@ public async Task GetDataRecipientsAsync() return this._mapper.Map(allParticipants); } - public async Task GetSoftwareProductId(Guid softwareProductId) + public async Task GetSoftwareProductIdAsync(Guid softwareProductId) { var softwareProduct = await this._registerDatabaseContext.SoftwareProducts.AsNoTracking() .Include(softwareProduct => softwareProduct.Status) @@ -72,9 +71,9 @@ public async Task GetDataRecipientsAsync() return this._mapper.Map(softwareProduct); } - protected async Task<(List Brands, int Count)> ProcessGetDataHolderBrands(Infrastructure.Industry industry, IBrandSpecification specification, DateTime? updatedSince, int page, int pageSize) + protected async Task<(List Brands, int Count)> ProcessGetDataHolderBrands(Infrastructure.Industry industry, DateTime? updatedSince, int page, int pageSize) { - var allBrandsQuery = specification.Apply(this._registerDatabaseContext.Brands.AsNoTracking()) + var allBrandsQuery = this._registerDatabaseContext.Brands.AsNoTracking() .Include(brand => brand.Endpoint) .Include(brand => brand.BrandStatus) .Include(brand => brand.AuthDetails) @@ -107,7 +106,11 @@ public async Task GetDataRecipientsAsync() return (allBrands, totalRecords); } - protected async Task> ProcessGetDataRecipients() + /// + /// The industry parameter is passed but currently not used. + /// + /// representing the asynchronous operation. + protected async Task> ProcessGetDataRecipients(Infrastructure.Industry industry) { return await this._registerDatabaseContext.Participations.AsNoTracking() .Include(p => p.Status) diff --git a/Source/CDR.Register.Repository/RegisterStatusRepository.cs b/Source/CDR.Register.Repository/RegisterStatusRepository.cs index f3fef5b..91601e6 100644 --- a/Source/CDR.Register.Repository/RegisterStatusRepository.cs +++ b/Source/CDR.Register.Repository/RegisterStatusRepository.cs @@ -4,7 +4,6 @@ using CDR.Register.Repository.Enums; using CDR.Register.Repository.Infrastructure; using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; using Microsoft.EntityFrameworkCore; namespace CDR.Register.Repository @@ -19,19 +18,19 @@ public RegisterStatusRepository( this._registerDatabaseContext = registerDatabaseContext; } - public async Task GetDataRecipientStatuses(Industry industry, IParticipationSpecification specification) + public async Task GetDataRecipientStatusesAsync(Infrastructure.Industry industry) { - return await specification.Apply(this._registerDatabaseContext.Participations.AsNoTracking()) - .Include(p => p.Status) - .Where(p => p.ParticipationTypeId == ParticipationTypes.Dr) - .Select(p => new DataRecipientStatus() { DataRecipientId = p.LegalEntityId, Status = p.Status.ParticipationStatusCode }) - .OrderBy(p => p.DataRecipientId.ToString()) - .ToArrayAsync(); + return await this._registerDatabaseContext.Participations.AsNoTracking() + .Include(p => p.Status) + .Where(p => p.ParticipationTypeId == ParticipationTypes.Dr) + .Select(p => new DataRecipientStatus() { DataRecipientId = p.LegalEntityId, Status = p.Status.ParticipationStatusCode }) + .OrderBy(p => p.DataRecipientId.ToString()) + .ToArrayAsync(); } - public async Task GetSoftwareProductStatuses(Industry industry, IParticipationSpecification specification) + public async Task GetSoftwareProductStatusesAsync(Infrastructure.Industry industry) { - var allParticipants = await specification.Apply(this._registerDatabaseContext.Participations.AsNoTracking()) + var allParticipants = await this._registerDatabaseContext.Participations.AsNoTracking() .Include(p => p.Industry) .Include(p => p.Brands) .ThenInclude(brand => brand.SoftwareProducts) @@ -53,7 +52,7 @@ public async Task GetSoftwareProductStatuses(Industry i .SelectMany(p => p.Brands) .SelectMany(b => b.SoftwareProducts) .Select(sp => - new SoftwareProductStatus + new Domain.Entities.SoftwareProductStatus { SoftwareProductId = sp.SoftwareProductId, Status = sp.Status.SoftwareProductStatusCode, @@ -62,9 +61,9 @@ public async Task GetSoftwareProductStatuses(Industry i .ToArray(); } - public async Task GetDataHolderStatuses(Industry industry, IParticipationSpecification specification) + public async Task GetDataHolderStatusesAsync(Infrastructure.Industry industry) { - return await specification.Apply(this._registerDatabaseContext.Participations.AsNoTracking()) + return await this._registerDatabaseContext.Participations.AsNoTracking() .Include(p => p.Status) .Include(p => p.Industry) .Include(p => p.LegalEntity) diff --git a/Source/CDR.Register.Repository/Specifications/BrandSpecifications.cs b/Source/CDR.Register.Repository/Specifications/BrandSpecifications.cs deleted file mode 100644 index 5935e5d..0000000 --- a/Source/CDR.Register.Repository/Specifications/BrandSpecifications.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Linq; -using CDR.Register.Repository.Entities; -using CDR.Register.Repository.Infrastructure; - -namespace CDR.Register.Repository.Specifications -{ - /// - /// Specifications for filtering records. - /// - public class BrandSpecifications - { - /// - /// Allow records with a for any industry. - /// - public class AllIndustries : IBrandSpecification - { - /// - public IQueryable Apply(IQueryable items) - { - return items; - } - } - - /// - /// Only allow records with a that is not . - /// - public class ExcludeNblIndustry : IBrandSpecification - { - /// - public IQueryable Apply(IQueryable items) - { - return items.Where(i => i.Participation.IndustryId != Industry.NONBANKLENDING); - } - } - } -} diff --git a/Source/CDR.Register.Repository/Specifications/IBrandSpecification.cs b/Source/CDR.Register.Repository/Specifications/IBrandSpecification.cs deleted file mode 100644 index 2efc7fa..0000000 --- a/Source/CDR.Register.Repository/Specifications/IBrandSpecification.cs +++ /dev/null @@ -1,11 +0,0 @@ -using CDR.Register.Repository.Entities; - -namespace CDR.Register.Repository.Specifications -{ - /// - /// Specification for filtering records. - /// - public interface IBrandSpecification : ISpecification - { - } -} diff --git a/Source/CDR.Register.Repository/Specifications/IParticipationSpecification.cs b/Source/CDR.Register.Repository/Specifications/IParticipationSpecification.cs deleted file mode 100644 index f95bc8b..0000000 --- a/Source/CDR.Register.Repository/Specifications/IParticipationSpecification.cs +++ /dev/null @@ -1,11 +0,0 @@ -using CDR.Register.Repository.Entities; - -namespace CDR.Register.Repository.Specifications -{ - /// - /// Specifications for filtering records. - /// - public interface IParticipationSpecification : ISpecification - { - } -} diff --git a/Source/CDR.Register.Repository/Specifications/ISpecification.cs b/Source/CDR.Register.Repository/Specifications/ISpecification.cs deleted file mode 100644 index 391593b..0000000 --- a/Source/CDR.Register.Repository/Specifications/ISpecification.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Linq; - -namespace CDR.Register.Repository.Specifications -{ - /// - /// Represents a business rule or filtering criterion that can be applied to query. - /// - /// The type of item being queried. - public interface ISpecification - { - /// - /// Applies the specification's filtering or transformation logic to the items. - /// - /// The unmodified query. - /// - /// The modified query with the rule/filtering applied. - /// - IQueryable Apply(IQueryable items); - } -} diff --git a/Source/CDR.Register.Repository/Specifications/ParticipationsSpecifications.cs b/Source/CDR.Register.Repository/Specifications/ParticipationsSpecifications.cs deleted file mode 100644 index 1d6af8a..0000000 --- a/Source/CDR.Register.Repository/Specifications/ParticipationsSpecifications.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Linq; -using CDR.Register.Repository.Entities; -using CDR.Register.Repository.Infrastructure; - -namespace CDR.Register.Repository.Specifications -{ - /// - /// Specifications for filtering records. - /// - public class ParticipationsSpecifications - { - /// - /// Allow records for any industry. - /// - public class AllIndustries : IParticipationSpecification - { - /// - public IQueryable Apply(IQueryable items) - { - return items; - } - } - - /// - /// Only allow records that are not . - /// - public class ExcludeNblIndustry : IParticipationSpecification - { - /// - public IQueryable Apply(IQueryable items) - { - return items.Where(i => i.IndustryId != Infrastructure.Industry.NONBANKLENDING); - } - } - } -} diff --git a/Source/CDR.Register.SSA.API.UnitTests/JwksTests.cs b/Source/CDR.Register.SSA.API.UnitTests/JwksTests.cs index af2b1ff..34a0569 100644 --- a/Source/CDR.Register.SSA.API.UnitTests/JwksTests.cs +++ b/Source/CDR.Register.SSA.API.UnitTests/JwksTests.cs @@ -21,8 +21,8 @@ public void GenerateJwks_ValidCertificate_ShouldGenerateJwks() IConfiguration configuration = new ConfigurationBuilder() .AddInMemoryCollection(inMemorySettings) .Build(); - Business.Mapper mapper = new Business.Mapper(configuration); - var certificateService = new CertificateService(configuration, mapper); + + var certificateService = new CertificateService(configuration); // Act. var jwks = certificateService.JsonWebKeySet; @@ -37,10 +37,7 @@ public void GenerateJwks_ValidCertificate_ShouldGenerateJwks() Assert.Equal("RSA", jwk.Kty); Assert.Equal("sCKajSK266KlSW0sSOa3Jbfrq1PCa2EHkuXoNwC0VMhrq-u_J1qMxvM50LCT5OF45GWPl4LUFhoJlej-XQtHztBpB6NWX5eJXW45M2OHmerRqN9IP5oQ1yscTzyiQyFoTbLpjFyRASrQZy1XMGrMMa7tqLpyHDxzJX-SBsr_hq8Olj0LFLeWi3giLirj_4CRqqmTtvLCaMwGajpEGQz3Xc96FNZXUOIR-wX_WjbCzVn2-X7PHjgIbT_oURtnovxQ6ZXZRtqxBhIKwJ-zCOOZAAqDJcy-7QxtsWpU_IyRRPziAyQ254iLcjV125DgQnd5TsUQQX6nfBozgbYdSLfLzQ", jwk.N); Assert.Equal("AQAB", jwk.E); - Assert.NotEmpty(jwk.Key_ops); - Assert.Contains("verify", jwk.Key_ops); - Assert.Null(jwk.Use); - Assert.Null(jwk.X5t); + Assert.Equal(2, jwk.Key_ops.Length); } } } diff --git a/Source/CDR.Register.SSA.API.UnitTests/TokenizerServiceTests.cs b/Source/CDR.Register.SSA.API.UnitTests/TokenizerServiceTests.cs index ae6c9c4..1b1cffe 100644 --- a/Source/CDR.Register.SSA.API.UnitTests/TokenizerServiceTests.cs +++ b/Source/CDR.Register.SSA.API.UnitTests/TokenizerServiceTests.cs @@ -4,9 +4,7 @@ using System.IO; using System.Linq; using System.Security.Cryptography.X509Certificates; -using System.Security.Cryptography.Xml; using System.Threading.Tasks; -using AutoMapper; using CDR.Register.SSA.API.Business; using CDR.Register.SSA.API.Business.Models; using Microsoft.Extensions.Configuration; @@ -20,7 +18,6 @@ public class TokenizerServiceTests { private readonly ServiceProvider _serviceProvider; private readonly IConfiguration _configuration; - private readonly Business.Mapper _mapper; public TokenizerServiceTests() { @@ -31,11 +28,9 @@ public TokenizerServiceTests() this._configuration = configuration; - this._mapper = new Business.Mapper(this._configuration); - var services = new ServiceCollection(); - services.AddSingleton(x => new CertificateService(this._configuration, this._mapper)); + services.AddSingleton(x => new CertificateService(this._configuration)); services.AddSingleton(); this._serviceProvider = services.BuildServiceProvider(); @@ -288,7 +283,7 @@ public async Task GenerateJwtTokenAsync_ValidateJwks_Success() .AddInMemoryCollection(inMemorySettings) .Build(); - var certificateService = new CertificateService(configuration, this._mapper); + var certificateService = new CertificateService(configuration); var jwks = certificateService.JsonWebKeySet; // Set token validation parameters diff --git a/Source/CDR.Register.SSA.API/Business/CertificateService.cs b/Source/CDR.Register.SSA.API/Business/CertificateService.cs index a708c42..fd0be72 100644 --- a/Source/CDR.Register.SSA.API/Business/CertificateService.cs +++ b/Source/CDR.Register.SSA.API/Business/CertificateService.cs @@ -1,5 +1,4 @@ using System.Security.Cryptography.X509Certificates; -using AutoMapper; using Microsoft.Extensions.Configuration; using Microsoft.IdentityModel.Tokens; @@ -10,9 +9,7 @@ namespace CDR.Register.SSA.API.Business /// public class CertificateService : ICertificateService { - private readonly IMapper _mapper; - - public CertificateService(IConfiguration config, IMapper mapper) + public CertificateService(IConfiguration config) { // Create the certificate var cert = new X509Certificate2(config["SigningCertificate:Path"], config["SigningCertificate:Password"], X509KeyStorageFlags.Exportable); @@ -29,8 +26,6 @@ public CertificateService(IConfiguration config, IMapper mapper) // Get signature provider this.SignatureProvider = this.SigningCredentials.CryptoProviderFactory.CreateForSigning(this.SecurityKey, "PS256"); - this._mapper = mapper; - this.JsonWebKeySet = this.GenerateJwks(); } @@ -44,20 +39,23 @@ public CertificateService(IConfiguration config, IMapper mapper) private X509SigningCredentials SigningCredentials { get; set; } - private Register.API.Infrastructure.Models.JsonWebKeySet GenerateJwks() + private CDR.Register.API.Infrastructure.Models.JsonWebKeySet GenerateJwks() { var rsaParams = this.SigningCredentials.Certificate.GetRSAPublicKey().ExportParameters(false); - var key = new RsaSecurityKey(rsaParams); - - var jwkc = JsonWebKeyConverter.ConvertFromRSASecurityKey(key); - jwkc.KeyOps.Add("verify"); - jwkc.Alg = this.SigningCredentials.Algorithm; - jwkc.Kty = "RSA"; - jwkc.Kid = this.SigningCredentials.Certificate.Thumbprint; + var e = Base64UrlEncoder.Encode(rsaParams.Exponent); + var n = Base64UrlEncoder.Encode(rsaParams.Modulus); - Register.API.Infrastructure.Models.JsonWebKey jwk = this._mapper.MapJwk(jwkc); + var jwk = new CDR.Register.API.Infrastructure.Models.JsonWebKey() + { + Alg = this.SigningCredentials.Algorithm, + Kid = this.SigningCredentials.Kid, + Kty = this.SecurityKey.PublicKey.KeyExchangeAlgorithm, + N = n, + E = e, + Key_ops = ["sign", "verify"], + }; - return new Register.API.Infrastructure.Models.JsonWebKeySet() + return new CDR.Register.API.Infrastructure.Models.JsonWebKeySet() { Keys = [jwk], }; diff --git a/Source/CDR.Register.SSA.API/Business/IMapper.cs b/Source/CDR.Register.SSA.API/Business/IMapper.cs index 417465d..c9daa2c 100644 --- a/Source/CDR.Register.SSA.API/Business/IMapper.cs +++ b/Source/CDR.Register.SSA.API/Business/IMapper.cs @@ -6,7 +6,5 @@ namespace CDR.Register.SSA.API.Business public interface IMapper { SoftwareStatementAssertionModel MapV3(SoftwareStatementAssertion softwareStatementAssertion); - - Register.API.Infrastructure.Models.JsonWebKey MapJwk(Microsoft.IdentityModel.Tokens.JsonWebKey jwk); } } diff --git a/Source/CDR.Register.SSA.API/Business/ISSAService.cs b/Source/CDR.Register.SSA.API/Business/ISSAService.cs index e45f985..3151abf 100644 --- a/Source/CDR.Register.SSA.API/Business/ISSAService.cs +++ b/Source/CDR.Register.SSA.API/Business/ISSAService.cs @@ -6,6 +6,8 @@ namespace CDR.Register.SSA.API.Business { public interface ISsaService { - Task GetSoftwareStatementAssertionJWTAsync(string dataRecipientBrandId, string softwareProductId); + Task GetSoftwareStatementAssertionAsync(Industry industry, string dataRecipientBrandId, string softwareProductId); + + Task GetSoftwareStatementAssertionJWTAsync(Industry industry, string dataRecipientBrandId, string softwareProductId); } } diff --git a/Source/CDR.Register.SSA.API/Business/Mapper.cs b/Source/CDR.Register.SSA.API/Business/Mapper.cs index 3ee123b..9c222e9 100644 --- a/Source/CDR.Register.SSA.API/Business/Mapper.cs +++ b/Source/CDR.Register.SSA.API/Business/Mapper.cs @@ -1,7 +1,5 @@ using System; using AutoMapper; -using CDR.Register.API.Infrastructure.Models; -using CDR.Register.Domain; using CDR.Register.Domain.Entities; using CDR.Register.SSA.API.Business.Models; using Microsoft.Extensions.Configuration; @@ -42,21 +40,9 @@ public Mapper(IConfiguration config) .ForMember(d => d.Exp, s => s.MapFrom(source => (long)(DateTime.UtcNow - DateTime.UnixEpoch).TotalSeconds + long.Parse(this._config["SSA:ExpiryInSeconds"]))) .ForMember(d => d.Legal_entity_id, s => s.MapFrom(source => source.LegalEntity.LegalEntityId)) .ForMember(d => d.Legal_entity_name, s => s.MapFrom(source => source.LegalEntity.LegalEntityName)) - .ForMember(d => d.Sector_identifier_uri, s => s.MapFrom(source => source.SoftwareProduct.SectorIdentifierUri)) - .MaxDepth(Constants.MappingConstants.MaxDepth); - - cfg.CreateMap() - .ForMember(d => d.Alg, src => src.MapFrom(s => s.Alg)) - .ForMember(d => d.E, src => src.MapFrom(s => s.E)) - .ForMember(d => d.Kid, src => src.MapFrom(s => s.Kid)) - .ForMember(d => d.Kty, src => src.MapFrom(s => s.Kty)) - .ForMember(d => d.N, src => src.MapFrom(s => s.N)) - .ForMember(d => d.Use, src => src.MapFrom(s => s.Use)) - .ForMember(d => d.X5t, src => src.MapFrom(s => s.X5t)) - .ForMember(d => d.X5c, src => src.MapFrom(s => s.X5c)) - .ForMember(d => d.Key_ops, src => src.MapFrom(s => s.KeyOps)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(d => d.Sector_identifier_uri, s => s.MapFrom(source => source.SoftwareProduct.SectorIdentifierUri)); }); + this._mapper = configuration.CreateMapper(); } @@ -69,15 +55,5 @@ public SoftwareStatementAssertionModel MapV3(SoftwareStatementAssertion software return this._mapper.Map(softwareStatementAssertion); } - - public JsonWebKey MapJwk(Microsoft.IdentityModel.Tokens.JsonWebKey jwk) - { - if (jwk == null) - { - return null; - } - - return this._mapper.Map(jwk); - } } } diff --git a/Source/CDR.Register.SSA.API/Business/SSAService.cs b/Source/CDR.Register.SSA.API/Business/SSAService.cs index b59cf97..f65616e 100644 --- a/Source/CDR.Register.SSA.API/Business/SSAService.cs +++ b/Source/CDR.Register.SSA.API/Business/SSAService.cs @@ -31,33 +31,16 @@ public SsaService( this._tokenizer = tokenizer; } - public async Task GetSoftwareStatementAssertionJWTAsync(string dataRecipientBrandId, string softwareProductId) + public async Task GetSoftwareStatementAssertionJWTAsync(Repository.Infrastructure.Industry industry, string dataRecipientBrandId, string softwareProductId) { // Get the SSA to be put in a JWT - var ssa = await this.GetSoftwareStatementAssertionAsync(dataRecipientBrandId, softwareProductId); + var ssa = await this.GetSoftwareStatementAssertionAsync(industry, dataRecipientBrandId, softwareProductId); return await this._tokenizer.GenerateJwtTokenAsync(ssa); } - private static void Validate(SoftwareStatementAssertionModel ssa) + public async Task GetSoftwareStatementAssertionAsync(Repository.Infrastructure.Industry industry, string dataRecipientBrandId, string softwareProductId) { - var validationContext = new ValidationContext(ssa); - var validationResults = new List(); - if (!Validator.TryValidateObject(ssa, validationContext, validationResults, true)) - { - var errorMessage = $"Validation errors in SSA for dataRecipientBrandId: {ssa.Org_id} / softwareProductId: {ssa.Software_id} \r\n{validationResults.ToJson()}"; - throw new SsaValidationException(errorMessage); - } - } - - private async Task GetSoftwareStatementAssertionAsync(string dataRecipientBrandId, string softwareProductId) - { - if (!Guid.TryParse(dataRecipientBrandId, out var dataRecipientBrandGuid) || !Guid.TryParse(softwareProductId, out var softwareProductGuid)) - { - return null; - } - - var softwareProductEntity = await this._repository.GetSoftwareStatementAssertionAsync(dataRecipientBrandGuid, softwareProductGuid); - + var softwareProductEntity = await this.GetSoftwareStatementAssertionAsync(dataRecipientBrandId, softwareProductId); var ssa = this._mapper.MapV3(softwareProductEntity); if (ssa == null) { @@ -74,5 +57,28 @@ private async Task GetSoftwareStatementAssertio return ssa; } + + private static void Validate(SoftwareStatementAssertionModel ssa) + { + var validationContext = new ValidationContext(ssa); + var validationResults = new List(); + if (!Validator.TryValidateObject(ssa, validationContext, validationResults, true)) + { + var errorMessage = $"Validation errors in SSA for dataRecipientBrandId: {ssa.Org_id} / softwareProductId: {ssa.Software_id} \r\n{validationResults.ToJson()}"; + throw new SsaValidationException(errorMessage); + } + } + + private async Task GetSoftwareStatementAssertionAsync(string dataRecipientBrandId, string softwareProductId) + { + if (string.IsNullOrWhiteSpace(dataRecipientBrandId) || string.IsNullOrWhiteSpace(softwareProductId)) + { + return null; + } + + var dataRecipientBrandGuid = Guid.Parse(dataRecipientBrandId); + var softwareProductGuid = Guid.Parse(softwareProductId); + return await this._repository.GetSoftwareStatementAssertionAsync(dataRecipientBrandGuid, softwareProductGuid); + } } } diff --git a/Source/CDR.Register.SSA.API/Controllers/SSAController.cs b/Source/CDR.Register.SSA.API/Controllers/SSAController.cs index 38e8deb..4482aae 100644 --- a/Source/CDR.Register.SSA.API/Controllers/SSAController.cs +++ b/Source/CDR.Register.SSA.API/Controllers/SSAController.cs @@ -1,7 +1,6 @@ using System; using System.Net; using System.Threading.Tasks; -using Asp.Versioning; using CDR.Register.API.Infrastructure; using CDR.Register.API.Infrastructure.Authorization; using CDR.Register.API.Infrastructure.Filters; @@ -40,35 +39,9 @@ public SsaController( [Route("v1/{industry}/data-recipients/brands/{dataRecipientBrandId}/software-products/{softwareProductId}/ssa")] [ReturnXV("3")] [ApiVersion("3")] - [CheckIndustry(Repository.Infrastructure.Industry.BANKING, Repository.Infrastructure.Industry.ENERGY, Repository.Infrastructure.Industry.TELCO, Repository.Infrastructure.Industry.ALL)] + [CheckIndustry] [ServiceFilter(typeof(LogActionEntryAttribute))] public async Task GetSoftwareStatementAssertionXV3(string industry, string dataRecipientBrandId, string softwareProductId) - { - return await this.GetSoftwareStatementAssertion(dataRecipientBrandId, softwareProductId); - } - - [PolicyAuthorize(RegisterAuthorisationPolicy.GetSSAMultiIndustry)] - [HttpGet] - [Route("v1/{industry}/data-recipients/brands/{dataRecipientBrandId}/software-products/{softwareProductId}/ssa")] - [ReturnXV("4")] - [ApiVersion("4")] - [CheckIndustry(Repository.Infrastructure.Industry.ALL)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public async Task GetSoftwareStatementAssertionXV4(string industry, string dataRecipientBrandId, string softwareProductId) - { - return await this.GetSoftwareStatementAssertion(dataRecipientBrandId, softwareProductId); - } - - [HttpGet] - [Route("v1/jwks")] - [ApiVersion("1")] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public IActionResult GetJwks() - { - return new OkObjectResult(this._certificateService.JsonWebKeySet); - } - - private async Task GetSoftwareStatementAssertion(string dataRecipientBrandId, string softwareProductId) { // CTS conformance ID validations var basePathExpression = this._configuration.GetValue(Constants.ConfigurationKeys.BasePathExpression); @@ -87,10 +60,19 @@ private async Task GetSoftwareStatementAssertion(string dataRecip return result; } - var ssa = await this._ssaService.GetSoftwareStatementAssertionJWTAsync(dataRecipientBrandId, softwareProductId); + var ssa = await this._ssaService.GetSoftwareStatementAssertionJWTAsync(industry.ToIndustry(), dataRecipientBrandId, softwareProductId); return string.IsNullOrEmpty(ssa) ? this.NotFound(new ResponseErrorList(ResponseErrorList.NotFound())) : this.Ok(ssa); } + [HttpGet] + [Route("v1/jwks")] + [ApiVersion("1")] + [ServiceFilter(typeof(LogActionEntryAttribute))] + public IActionResult GetJwks() + { + return new OkObjectResult(this._certificateService.JsonWebKeySet); + } + private Guid? GetSoftwareProductIdFromAccessToken() { string clientId = this.User.FindFirst("client_id")?.Value; diff --git a/Source/CDR.Register.SSA.API/Startup.cs b/Source/CDR.Register.SSA.API/Startup.cs index d5c7964..db8c65f 100644 --- a/Source/CDR.Register.SSA.API/Startup.cs +++ b/Source/CDR.Register.SSA.API/Startup.cs @@ -36,7 +36,11 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); - services.AddCdrApiVersioning(); + services.AddApiVersioning(options => + { + options.ApiVersionReader = new CdrVersionReader(new CdrApiOptions()); // uses default options atm + options.ErrorResponses = new ApiVersionErrorResponse(); + }); var enableSwagger = this.Configuration.GetValue(ConfigurationKeys.EnableSwagger); if (enableSwagger) diff --git a/Source/CDR.Register.Status.API.UnitTests/CDR.Register.Status.API.UnitTests.csproj b/Source/CDR.Register.Status.API.UnitTests/CDR.Register.Status.API.UnitTests.csproj deleted file mode 100644 index 48568c1..0000000 --- a/Source/CDR.Register.Status.API.UnitTests/CDR.Register.Status.API.UnitTests.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - false - false - $(TargetFrameworkVersion) - $(Version) - $(Version) - $(Version) - True - true - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/Source/CDR.Register.Status.API.UnitTests/StatusServiceTests.cs b/Source/CDR.Register.Status.API.UnitTests/StatusServiceTests.cs deleted file mode 100644 index 443d350..0000000 --- a/Source/CDR.Register.Status.API.UnitTests/StatusServiceTests.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Threading.Tasks; -using AutoMapper; -using CDR.Register.Repository.Infrastructure; -using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; -using CDR.Register.Status.API.Business; -using NSubstitute; - -namespace CDR.Register.Status.API.UnitTests -{ - public class StatusServiceTests - { - private readonly IRegisterStatusRepository _repository = Substitute.For(); - private readonly IMapper _mapper = Substitute.For(); - - [Theory] - [InlineData(1, typeof(ParticipationsSpecifications.ExcludeNblIndustry))] - [InlineData(2, typeof(ParticipationsSpecifications.AllIndustries))] - public async Task GetDataHolderStatuses_UsesCorrectSpecification(int version, Type expectedType) - { - // Arrange - Type specificationType = null; - _ = await this._repository.GetDataHolderStatuses(Industry.ALL, Arg.Do(x => specificationType = x.GetType())); - var service = new StatusService(this._repository, this._mapper); - - // Act - _ = await service.GetDataHolderStatuses(Industry.ALL, version); - - // Assert - Assert.Equal(expectedType, specificationType); - } - - [Fact] - public async Task GetDataHolderStatuses_ThrowsExceptionForUnsupportedVersion() - { - // Arrange - var service = new StatusService(this._repository, this._mapper); - - // Act - var action = async () => await service.GetDataHolderStatuses(Industry.ALL, 5); - - // Assert - await Assert.ThrowsAsync(action); - } - - [Theory] - [InlineData(2, typeof(ParticipationsSpecifications.ExcludeNblIndustry))] - [InlineData(3, typeof(ParticipationsSpecifications.AllIndustries))] - public async Task GetDataRecipientsStatuses_UsesCorrectSpecification(int version, Type expectedType) - { - // Arrange - Type specificationType = null; - _ = await this._repository.GetDataRecipientStatuses(Industry.ALL, Arg.Do(x => specificationType = x.GetType())); - var service = new StatusService(this._repository, this._mapper); - - // Act - _ = await service.GetDataRecipientStatuses(Industry.ALL, version); - - // Assert - Assert.Equal(expectedType, specificationType); - } - - [Fact] - public async Task GetDataRecipientsStatuses_ThrowsExceptionForUnsupportedVersion() - { - // Arrange - var service = new StatusService(this._repository, this._mapper); - - // Act - var action = async () => await service.GetDataRecipientStatuses(Industry.ALL, 1); - - // Assert - await Assert.ThrowsAsync(action); - } - - [Theory] - [InlineData(2, typeof(ParticipationsSpecifications.ExcludeNblIndustry))] - [InlineData(3, typeof(ParticipationsSpecifications.AllIndustries))] - public async Task GetAdrSoftwareProductStatuses_UsesCorrectSpecification(int version, Type expectedType) - { - // Arrange - Type specificationType = null; - _ = await this._repository.GetSoftwareProductStatuses(Industry.ALL, Arg.Do(x => specificationType = x.GetType())); - var service = new StatusService(this._repository, this._mapper); - - // Act - _ = await service.GetSoftwareProductStatuses(Industry.ALL, version); - - // Assert - Assert.Equal(expectedType, specificationType); - } - - [Fact] - public async Task GetAdrSoftwareProductStatuses_ThrowsExceptionForUnsupportedVersion() - { - // Arrange - var service = new StatusService(this._repository, this._mapper); - - // Act - var action = async () => await service.GetSoftwareProductStatuses(Industry.ALL, 1); - - // Assert - await Assert.ThrowsAsync(action); - } - } -} diff --git a/Source/CDR.Register.Status.API/Business/IStatusService.cs b/Source/CDR.Register.Status.API/Business/IStatusService.cs index 9aab40d..cd1d895 100644 --- a/Source/CDR.Register.Status.API/Business/IStatusService.cs +++ b/Source/CDR.Register.Status.API/Business/IStatusService.cs @@ -6,10 +6,10 @@ namespace CDR.Register.Status.API.Business { public interface IStatusService { - Task GetDataRecipientStatuses(Industry industry, int version); + Task GetDataRecipientStatusesAsync(Industry industry); - Task GetSoftwareProductStatuses(Industry industry, int version); + Task GetSoftwareProductStatusesAsync(Industry industry); - Task GetDataHolderStatuses(Industry industry, int version); + Task GetDataHolderStatusesAsyncXV1(Industry industry); } } diff --git a/Source/CDR.Register.Status.API/Business/MappingProfile.cs b/Source/CDR.Register.Status.API/Business/MappingProfile.cs index 606ebca..84791b1 100644 --- a/Source/CDR.Register.Status.API/Business/MappingProfile.cs +++ b/Source/CDR.Register.Status.API/Business/MappingProfile.cs @@ -1,5 +1,4 @@ using AutoMapper; -using CDR.Register.Domain; using CDR.Register.Domain.Entities; using CDR.Register.Status.API.Business.Models; using CDR.Register.Status.API.Business.Responses; @@ -13,32 +12,26 @@ public MappingProfile() // DataRecipientStatus this.CreateMap() .ForMember(dest => dest.LegalEntityId, source => source.MapFrom(source => source.DataRecipientId)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)); this.CreateMap() - .ForMember(dest => dest.Data, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Data, source => source.MapFrom(source => source)); // SoftwareProductStatus this.CreateMap() .ForMember(dest => dest.SoftwareProductId, source => source.MapFrom(source => source.SoftwareProductId)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)); this.CreateMap() - .ForMember(dest => dest.Data, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Data, source => source.MapFrom(source => source)); // DataHolderStatus this.CreateMap() .ForMember(dest => dest.LegalEntityId, source => source.MapFrom(source => source.LegalEntityId)) - .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Status, source => source.MapFrom(source => source.Status)); this.CreateMap() - .ForMember(dest => dest.Data, source => source.MapFrom(source => source)) - .MaxDepth(Constants.MappingConstants.MaxDepth); + .ForMember(dest => dest.Data, source => source.MapFrom(source => source)); } } } diff --git a/Source/CDR.Register.Status.API/Business/StatusService.cs b/Source/CDR.Register.Status.API/Business/StatusService.cs index 782ad88..368883c 100644 --- a/Source/CDR.Register.Status.API/Business/StatusService.cs +++ b/Source/CDR.Register.Status.API/Business/StatusService.cs @@ -1,9 +1,7 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using AutoMapper; using CDR.Register.Repository.Infrastructure; using CDR.Register.Repository.Interfaces; -using CDR.Register.Repository.Specifications; using CDR.Register.Status.API.Business.Responses; namespace CDR.Register.Status.API.Business @@ -21,42 +19,21 @@ public StatusService( this._mapper = mapper; } - public async Task GetDataRecipientStatuses(Industry industry, int version) + public async Task GetDataRecipientStatusesAsync(Industry industry) { - IParticipationSpecification specification = version switch - { - 2 => new ParticipationsSpecifications.ExcludeNblIndustry(), - 3 => new ParticipationsSpecifications.AllIndustries(), - _ => throw new NotImplementedException("Unknown version"), - }; - - var entity = await this._registerStatusRepository.GetDataRecipientStatuses(industry, specification); + var entity = await this._registerStatusRepository.GetDataRecipientStatusesAsync(industry); return this._mapper.Map(entity); } - public async Task GetSoftwareProductStatuses(Industry industry, int version) + public async Task GetSoftwareProductStatusesAsync(Industry industry) { - IParticipationSpecification specification = version switch - { - 2 => new ParticipationsSpecifications.ExcludeNblIndustry(), - 3 => new ParticipationsSpecifications.AllIndustries(), - _ => throw new NotImplementedException("Unknown version"), - }; - - var entity = await this._registerStatusRepository.GetSoftwareProductStatuses(industry, specification); + var entity = await this._registerStatusRepository.GetSoftwareProductStatusesAsync(industry); return this._mapper.Map(entity); } - public async Task GetDataHolderStatuses(Industry industry, int version) + public async Task GetDataHolderStatusesAsyncXV1(Industry industry) { - IParticipationSpecification specification = version switch - { - 1 => new ParticipationsSpecifications.ExcludeNblIndustry(), - 2 => new ParticipationsSpecifications.AllIndustries(), - _ => throw new NotImplementedException("Unknown version"), - }; - - var entity = await this._registerStatusRepository.GetDataHolderStatuses(industry, specification); + var entity = await this._registerStatusRepository.GetDataHolderStatusesAsync(industry); return this._mapper.Map(entity); } } diff --git a/Source/CDR.Register.Status.API/Controllers/StatusController.cs b/Source/CDR.Register.Status.API/Controllers/StatusController.cs index 29326a5..c2caece 100644 --- a/Source/CDR.Register.Status.API/Controllers/StatusController.cs +++ b/Source/CDR.Register.Status.API/Controllers/StatusController.cs @@ -1,8 +1,6 @@ using System.Threading.Tasks; -using Asp.Versioning; using CDR.Register.API.Infrastructure; using CDR.Register.API.Infrastructure.Filters; -using CDR.Register.Repository.Infrastructure; using CDR.Register.Status.API.Business; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; @@ -30,78 +28,39 @@ public StatusController( [ReturnXV("2")] [ApiVersion("2")] [ETag] - [CheckIndustry(Industry.BANKING, Industry.ENERGY, Industry.TELCO, Industry.ALL)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataRecipientsStatusXV2(string industry) - => this.GetDataRecipientsStatus(industry, 2); - - [HttpGet] - [Route("v1/{industry}/data-recipients/status")] - [ReturnXV("3")] - [ApiVersion("3")] - [ETag] - [CheckIndustry(Industry.ALL)] + [CheckIndustry] [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataRecipientsStatusXV3(string industry) - => this.GetDataRecipientsStatus(industry, 3); + public async Task GetDataRecipientsStatusXV2(string industry) + { + var response = await this._statusService.GetDataRecipientStatusesAsync(industry.ToIndustry()); + response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); + return this.Ok(response); + } [HttpGet] [Route("v1/{industry}/data-recipients/brands/software-products/status")] [ReturnXV("2")] [ApiVersion("2")] [ETag] - [CheckIndustry(Industry.ALL, Industry.BANKING, Industry.ENERGY, Industry.TELCO)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetSoftwareProductStatusXV2(string industry) - => this.GetSoftwareProductStatus(industry, 2); - - [HttpGet] - [Route("v1/{industry}/data-recipients/brands/software-products/status")] - [ReturnXV("3")] - [ApiVersion("3")] - [ETag] - [CheckIndustry(Industry.ALL)] + [CheckIndustry] [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetSoftwareProductStatusXV3(string industry) - => this.GetSoftwareProductStatus(industry, 3); + public async Task GetSoftwareProductStatusXV2(string industry) + { + var response = await this._statusService.GetSoftwareProductStatusesAsync(industry.ToIndustry()); + response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); + return this.Ok(response); + } [HttpGet] [Route("v1/{industry}/data-holders/status")] [ReturnXV("1")] [ApiVersion("1")] [ETag] - [CheckIndustry(Industry.ALL, Industry.BANKING, Industry.ENERGY, Industry.TELCO)] - [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataHolderStatusXV1(string industry) - => this.GetDataHolderStatus(industry, 1); - - [HttpGet] - [Route("v1/{industry}/data-holders/status")] - [ReturnXV("2")] - [ApiVersion("2")] - [ETag] [CheckIndustry] [ServiceFilter(typeof(LogActionEntryAttribute))] - public Task GetDataHolderStatusXV2(string industry) - => this.GetDataHolderStatus(industry, 2); - - private async Task GetDataHolderStatus(string industry, int version) - { - var response = await this._statusService.GetDataHolderStatuses(industry.ToIndustry(), version); - response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); - return this.Ok(response); - } - - private async Task GetDataRecipientsStatus(string industry, int version) - { - var response = await this._statusService.GetDataRecipientStatuses(industry.ToIndustry(), version); - response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); - return this.Ok(response); - } - - private async Task GetSoftwareProductStatus(string industry, int version) + public async Task GetDataHolderStatusXV1(string industry) { - var response = await this._statusService.GetSoftwareProductStatuses(industry.ToIndustry(), version); + var response = await this._statusService.GetDataHolderStatusesAsyncXV1(industry.ToIndustry()); response.Links = this.GetSelf(this._configuration, this.HttpContext, string.Empty); return this.Ok(response); } diff --git a/Source/CDR.Register.Status.API/Startup.cs b/Source/CDR.Register.Status.API/Startup.cs index d232d43..29f63d3 100644 --- a/Source/CDR.Register.Status.API/Startup.cs +++ b/Source/CDR.Register.Status.API/Startup.cs @@ -36,7 +36,11 @@ public void ConfigureServices(IServiceCollection services) services.AddControllers(); - services.AddCdrApiVersioning(); + services.AddApiVersioning(options => + { + options.ApiVersionReader = new CdrVersionReader(new CdrApiOptions()); // uses default options atm + options.ErrorResponses = new ApiVersionErrorResponse(); + }); var enableSwagger = this.Configuration.GetValue(ConfigurationKeys.EnableSwagger); if (enableSwagger) diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index ed1ac17..edbc3eb 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -1,7 +1,7 @@ net8.0 - 2.2.6 + 2.2.3 true true true diff --git a/Source/Directory.Packages.props b/Source/Directory.Packages.props index ba5b4d2..c349cb8 100644 --- a/Source/Directory.Packages.props +++ b/Source/Directory.Packages.props @@ -2,8 +2,6 @@ true false - - false $(NoWarn);NU1507 @@ -13,46 +11,48 @@ - + - - + + - - - + + + + - - + + + - + - + - - + + - + - - + + - + - - - - + + + + diff --git a/Source/Register.sln b/Source/Register.sln index a0b6ab0..b9d21bd 100644 --- a/Source/Register.sln +++ b/Source/Register.sln @@ -66,12 +66,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDR.Register.Infosec", "CDR EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CDR.Register.API.Logger", "CDR.Register.API.Logger\CDR.Register.API.Logger.csproj", "{CC5BA5A6-650A-4875-87FA-80F6C9284E1C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDR.Register.Discovery.API.UnitTests", "CDR.Register.Discovery.API.UnitTests\CDR.Register.Discovery.API.UnitTests.csproj", "{8A99DBA1-284D-431E-B074-1766FA8CCF65}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDR.Register.Repository.UnitTests", "CDR.Register.Repository.UnitTests\CDR.Register.Repository.UnitTests.csproj", "{91E0C0CF-9935-44C1-9276-E97D42FC07E2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CDR.Register.Status.API.UnitTests", "CDR.Register.Status.API.UnitTests\CDR.Register.Status.API.UnitTests.csproj", "{E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -138,18 +132,6 @@ Global {CC5BA5A6-650A-4875-87FA-80F6C9284E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC5BA5A6-650A-4875-87FA-80F6C9284E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC5BA5A6-650A-4875-87FA-80F6C9284E1C}.Release|Any CPU.Build.0 = Release|Any CPU - {8A99DBA1-284D-431E-B074-1766FA8CCF65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A99DBA1-284D-431E-B074-1766FA8CCF65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A99DBA1-284D-431E-B074-1766FA8CCF65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A99DBA1-284D-431E-B074-1766FA8CCF65}.Release|Any CPU.Build.0 = Release|Any CPU - {91E0C0CF-9935-44C1-9276-E97D42FC07E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91E0C0CF-9935-44C1-9276-E97D42FC07E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91E0C0CF-9935-44C1-9276-E97D42FC07E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91E0C0CF-9935-44C1-9276-E97D42FC07E2}.Release|Any CPU.Build.0 = Release|Any CPU - {E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -171,9 +153,6 @@ Global {DDB4AB2E-31BD-4063-8B1C-3E7ED1B5B0B1} = {CE22CF4A-72DA-4EDB-9378-E40EA633E9E1} {B704C8B2-3DB0-4465-9886-5863B1C28333} = {230F6496-D6D5-4679-B613-197F582A0891} {CC5BA5A6-650A-4875-87FA-80F6C9284E1C} = {19E7E869-2818-4B77-9CCF-DBA87DC7E8A9} - {8A99DBA1-284D-431E-B074-1766FA8CCF65} = {DDB4AB2E-31BD-4063-8B1C-3E7ED1B5B0B1} - {91E0C0CF-9935-44C1-9276-E97D42FC07E2} = {6130BA29-CE67-48FC-8380-98B2FE85786D} - {E2C8CE1D-6ED2-4CAD-ACBE-848D23D1334F} = {DDB4AB2E-31BD-4063-8B1C-3E7ED1B5B0B1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3C05D931-EB3F-496C-A1D6-42D22F3651D7}