Skip to content

Commit

Permalink
[PPANTT-129] feat: Authorizer API key configuration with segregation …
Browse files Browse the repository at this point in the history
…codes (#500)

Co-authored-by: Jacopo Carlini <[email protected]>
Co-authored-by: pagopa-github-bot <[email protected]>
Co-authored-by: Samuele Varianti <[email protected]>
Co-authored-by: Alessio Cialini <[email protected]>
Co-authored-by: svariant <[email protected]>
Co-authored-by: Alessio Cialini <[email protected]>
Co-authored-by: renovate-pagopa[bot] <164534245+renovate-pagopa[bot]@users.noreply.github.com>
Co-authored-by: giomella <[email protected]>
  • Loading branch information
9 people authored Sep 24, 2024
1 parent e5b5523 commit ea97f31
Show file tree
Hide file tree
Showing 31 changed files with 792 additions and 290 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ jobs:
with:
configuration-path: '.github/auto_assign.yml'

check_source_branch:
name: Check Source Branches
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 # required to make the script available for next step
- name: Check Source Branches
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/github_scripts/check_source_branch.js')
script({github, context, core})

check_labels:
name: Check Required Labels
runs-on: ubuntu-latest
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/github_scripts/check_source_branch.js

This file was deleted.

4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-selfcare-ms-backoffice
description: Microservice that manage api keys for pagopa product from selfcare
type: application
version: 0.399.0
appVersion: "2.24.5"
version: 0.400.0
appVersion: "2.24.5-1-next"
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
tag: "2.24.5"
tag: "2.24.5-1-next"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
tag: "2.24.5" #improve
tag: "2.24.5-1-next" #improve
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-selfcare-ms-backoffice-backend
tag: "2.24.5" #improve
tag: "2.24.5-1-next" #improve
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
115 changes: 58 additions & 57 deletions infra/env/dev/encrypted.env

Large diffs are not rendered by default.

73 changes: 71 additions & 2 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Microservice to manage PagoPA Backoffice",
"termsOfService": "https://www.pagopa.gov.it/",
"title": "SelfCare Backoffice",
"version": "2.24.5"
"version": "2.24.5-1-next"
},
"servers": [
{
Expand Down Expand Up @@ -8037,6 +8037,24 @@
"schema": {
"type": "string"
}
},
{
"description": "Broker's institution id",
"in": "query",
"name": "institutionId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Broker's tax code",
"in": "query",
"name": "brokerTaxCode",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
Expand Down Expand Up @@ -8358,6 +8376,24 @@
"type": "string"
}
},
{
"description": "Broker's institution id",
"in": "query",
"name": "institutionId",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Broker's tax code",
"in": "query",
"name": "brokerTaxCode",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "Station's code",
"in": "path",
Expand Down Expand Up @@ -11278,6 +11314,7 @@
},
"/stations/station-code": {
"get": {
"deprecated": true,
"description": "Internal | External | Synchronous | Authorization | Authentication | TPS | Idempotency | Stateless | Read/Write Intense | Cacheable\n-|-|-|-|-|-|-|-|-|-\nY | N | Y | JWT | JWT | 1.0/sec | Y | Y | | N\n",
"operationId": "getStationCode",
"parameters": [
Expand Down Expand Up @@ -15298,6 +15335,10 @@
"type": "boolean",
"description": "Describe the station connection's type, true synchronous, false asynchronous"
},
"isPaymentOptionsEnabled": {
"type": "boolean",
"description": "Flag that enables EC's payment options service"
},
"modifiedAt": {
"type": "string",
"description": "Station's last modified date",
Expand Down Expand Up @@ -15404,6 +15445,10 @@
"type": "string",
"description": "Station's redirect query string"
},
"restEndpoint": {
"type": "string",
"description": "Endpoint to all the API REST of the EC"
},
"rtInstantaneousDispatch": {
"type": "boolean",
"description": "Station's instantaneous rt dispatch"
Expand Down Expand Up @@ -15532,6 +15577,10 @@
"type": "string",
"description": "Station's ip v4"
},
"isPaymentOptionsEnabled": {
"type": "boolean",
"description": "Flag that enables EC's payment options service"
},
"newPassword": {
"type": "string",
"description": "Station's new password"
Expand Down Expand Up @@ -15627,6 +15676,10 @@
"type": "string",
"description": "Station's redirect query string"
},
"restEndpoint": {
"type": "string",
"description": "Endpoint to all the API REST of the EC"
},
"rtInstantaneousDispatch": {
"type": "boolean",
"description": "Station's instantaneous rt dispatch"
Expand Down Expand Up @@ -16617,6 +16670,10 @@
"type": "boolean",
"description": "Station's activation state"
},
"isPaymentOptionsEnabled": {
"type": "boolean",
"description": "Flag that enables EC's payment options service"
},
"note": {
"type": "string",
"description": "station note description by operation team"
Expand Down Expand Up @@ -16657,6 +16714,10 @@
"type": "string",
"description": "Station's redirect query string"
},
"restEndpoint": {
"type": "string",
"description": "Endpoint to all the API REST of the EC"
},
"service": {
"type": "string",
"description": "Station's service"
Expand Down Expand Up @@ -16750,6 +16811,10 @@
"type": "boolean",
"description": "Describe the station connection's type, true synchronous, false asynchronous"
},
"isPaymentOptionsEnabled": {
"type": "boolean",
"description": "Flag that enables EC's payment options service"
},
"modifiedAt": {
"type": "string",
"description": "Station's last modified date",
Expand All @@ -16759,6 +16824,10 @@
"type": "string",
"description": "Station's pof service"
},
"restEndpoint": {
"type": "string",
"description": "Endpoint to all the API REST of the EC"
},
"service": {
"type": "string",
"description": "Station's service"
Expand Down Expand Up @@ -16847,4 +16916,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<version>2.5.14</version>
</parent>
<artifactId>pagopa-selfcare-ms-backoffice</artifactId>
<version>2.24.5</version>
<version>2.24.5-1-next</version>
<name>SelfCare Backoffice</name>
<description>Microservice to manage PagoPA Backoffice</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import it.pagopa.selfcare.pagopa.backoffice.model.connector.creditorinstitution.BrokerCreditorInstitutionDetails;
import it.pagopa.selfcare.pagopa.backoffice.model.connector.station.StationDetailsList;
import it.pagopa.selfcare.pagopa.backoffice.model.creditorinstituions.client.CreditorInstitutionInfo;
import it.pagopa.selfcare.pagopa.backoffice.model.creditorinstituions.client.CreditorInstitutionStationSegregationCodesList;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.Ibans;
import it.pagopa.selfcare.pagopa.backoffice.model.iban.IbansList;
import org.springframework.cloud.openfeign.FeignClient;
Expand Down Expand Up @@ -91,4 +92,11 @@ List<CreditorInstitutionInfo> getStationCreditorInstitutions(
@Valid
Ibans getCreditorInstitutionIbans(@PathVariable("creditorinstitutioncode") String creditorInstitutionCode,
@RequestParam String label);

@GetMapping(value = "/brokers/{broker-tax-code}/creditor-institutions/segregation-codes", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@Valid
CreditorInstitutionStationSegregationCodesList getCreditorInstitutionsSegregationCodeAssociatedToBroker(
@PathVariable("broker-tax-code") String brokerCode
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ public AvailableCodes getCreditorInstitutionSegregationCodes(
@OpenApiTableMetadata
public CreditorInstitutionStationEditResource associateStationToCreditorInstitution(
@Parameter(description = "Creditor institution's tax code") @PathVariable("ci-tax-code") String ciTaxCode,
@Parameter(description = "Broker's institution id") @RequestParam("institutionId") String institutionId,
@Parameter(description = "Broker's tax code") @RequestParam("brokerTaxCode") String brokerTaxCode,
@RequestBody @NotNull CreditorInstitutionStationDto dto
) {
return ciService.associateStationToCreditorInstitution(ciTaxCode, dto);
return this.ciService.associateStationToCreditorInstitution(ciTaxCode, institutionId, brokerTaxCode, dto);
}

@PutMapping(value = "/{ci-tax-code}/station", produces = {MediaType.APPLICATION_JSON_VALUE})
Expand All @@ -159,7 +161,7 @@ public CreditorInstitutionStationEditResource updateStationAssociationToCreditor
@Parameter(description = "Creditor institution's tax code") @PathVariable("ci-tax-code") String ciTaxCode,
@RequestBody @NotNull CreditorInstitutionStationDto dto
) {
return ciService.updateStationAssociationToCreditorInstitution(ciTaxCode, dto);
return this.ciService.updateStationAssociationToCreditorInstitution(ciTaxCode, dto);
}


Expand All @@ -179,9 +181,11 @@ public CreditorInstitutionStationEditResource updateStationAssociationToCreditor
@OpenApiTableMetadata
public void deleteCreditorInstitutionStationRelationship(
@Parameter(description = "Creditor institution's code") @PathVariable("ci-tax-code") String ciTaxCode,
@Parameter(description = "Broker's institution id") @RequestParam("institutionId") String institutionId,
@Parameter(description = "Broker's tax code") @RequestParam("brokerTaxCode") String brokerTaxCode,
@Parameter(description = "Station's code") @PathVariable("station-code") String stationCode
) {
ciService.deleteCreditorInstitutionStationRelationship(ciTaxCode, stationCode);
this.ciService.deleteCreditorInstitutionStationRelationship(ciTaxCode, stationCode, institutionId, brokerTaxCode);
}

@PostMapping(value = "", consumes = MediaType.APPLICATION_JSON_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ public CreditorInstitutionResource toResorce(CreditorInstitution model) {
creditorInstitutionResource.setCbillCode(model.getCbillCode());
creditorInstitutionResource.setEnabled(model.getEnabled());
creditorInstitutionResource.setBroadcast(model.getBroadcast());
creditorInstitutionResource.setMod4(model.getMod4());
creditorInstitutionResource.setApplicationCode(model.getApplicationCode());
creditorInstitutionResource.setAuxDigit(model.getAuxDigit());
creditorInstitutionResource.setSegregationCode(model.getSegregationCode());
creditorInstitutionResource.setMod4(String.valueOf(model.getMod4()));
creditorInstitutionResource.setApplicationCode(String.valueOf(model.getApplicationCode()));
creditorInstitutionResource.setAuxDigit(String.valueOf(model.getAuxDigit()));
creditorInstitutionResource.setSegregationCode(String.valueOf(model.getSegregationCode()));
creditorInstitutionResource.setAca(model.getAca());
creditorInstitutionResource.setStandIn(model.getStandIn());

Expand Down
Loading

0 comments on commit ea97f31

Please sign in to comment.