Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,11 @@ aws.dynamodb_table_history=MandateHistory
pn.mandate.sqs.to.pn.delivery.name = toDeliveryQueueNameTest

# Queue inbound event configuration
spring.cloud.stream.function.routing.enabled=true
spring.cloud.stream.bindings.functionRouter-in-0.destination=local-mandate-inputs.fifo
spring.cloud.stream.sqs.bindings.functionRouter-in-0.consumer.snsFanout=false
pn.mandate.topics.mandate-inputs=local-mandate-inputs.fifo

cloud.aws.credentials.profile-name=${PN_AWS_PROFILE_NAME:default}
cloud.aws.region.static= us-east-1
cloud.aws.sqs.endpoint= http://localhost:4566
spring.cloud.aws.credentials.profile-name=${PN_AWS_PROFILE_NAME:default}
spring.cloud.aws.region.static=us-east-1
spring.cloud.aws.sqs.endpoint=${aws.endpoint-url}

#src/test/resources/IT_MasterListCSCA.zip - s3://dgs-temp-089813480515/IT_MasterListCSCA.zip
pn.mandate.ciechecker-csca-anchor-path-filename=${CSCA_MASTERLIST_S3_PATH:s3://pn-runtime-environment-variables-eu-south-1-830192246553/pn-mandate/csca-masterlist/new_IT_MasterListCSCA.zip}


pn.mandate.ciechecker-csca-anchor-path-filename=${CSCA_MASTERLIST_S3_PATH:s3://pn-runtime-environment-variables-eu-south-1-830192246553/pn-mandate/csca-masterlist/new_IT_MasterListCSCA.zip}
6 changes: 6 additions & 0 deletions docs/openapi/pn-mandate-b2b-pg-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -467,26 +467,31 @@ components:
displayName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
firstName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
lastName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
companyName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 250
pattern: '^([\x20-\xFF]{1,250})$'
fiscalCode:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 16
pattern: '^([A-Z]{6}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1})|([0-9]{11})$'
person:
Expand Down Expand Up @@ -537,6 +542,7 @@ components:
taxId:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
minLength: 11
maxLength: 16
pattern: "^[A-Z]{6}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1}$|^(IT)?[0-9]{11}$"
Expand Down
6 changes: 6 additions & 0 deletions docs/openapi/pn-mandate-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -704,26 +704,31 @@ components:
displayName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
firstName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
lastName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 80
pattern: '^([\x20-\xFF]{1,80})$'
companyName:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 250
pattern: '^([\x20-\xFF]{1,250})$'
fiscalCode:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
maxLength: 16
pattern: '^([A-Z]{6}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1})|([0-9]{11})$'
person:
Expand Down Expand Up @@ -774,6 +779,7 @@ components:
taxId:
type: string
x-field-extra-annotation: "@lombok.ToString.Exclude" # NO EXTERNAL
format: password # NO EXTERNAL
minLength: 11
maxLength: 16
pattern: "^[A-Z]{6}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{2}[A-Z]{1}[0-9LMNPQRSTUV]{3}[A-Z]{1}$|^(IT)?[0-9]{11}$"
Expand Down
75 changes: 33 additions & 42 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>it.pagopa.pn</groupId>
<artifactId>pn-parent</artifactId>
<version>2.1.1</version>
<version>2.1.3-SPRINGBOOT3</version>
<relativePath />
</parent>
<artifactId>pn-mandate</artifactId>
<version>2.10.0-SNAPSHOT</version>
<version>2.10.0-SPRINGBOOT3</version>
<name>pn-mandate</name>
<description>Mandate microservice</description>
<scm>
Expand Down Expand Up @@ -50,13 +50,13 @@
<dependency>
<groupId>it.pagopa.pn</groupId>
<artifactId>pn-commons</artifactId>
<version>2.17.0-RC.1</version>
<version>2.17.0-SPRINGBOOT3</version>
</dependency>

<dependency>
<groupId>it.pagopa.pn</groupId>
<artifactId>pn-model</artifactId>
<version>2.1.1</version>
<version>2.11.0-SPRINGBOOT3</version>
</dependency>

<!-- https://mvnrepository.com/artifact/io.swagger/swagger-annotations -->
Expand Down Expand Up @@ -89,6 +89,7 @@
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.12.406</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -132,6 +133,10 @@
<artifactId>spring-cloud-stream-binder-sqs</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-starter-sqs</artifactId>
</dependency>
<dependency>
<groupId>com.payneteasy</groupId>
<artifactId>ber-tlv</artifactId>
Expand Down Expand Up @@ -241,24 +246,6 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>unpack-dependencies</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>pn-commons</includeArtifactIds>
<outputDirectory>${project.build.directory}/dependency-resources</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
Expand Down Expand Up @@ -294,7 +281,7 @@
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.4.0</version>
<version>7.15.0</version>
<executions>
<execution>
<id>generate-mandate-server</id>
Expand All @@ -306,11 +293,11 @@
<inputSpec>${project.basedir}/docs/openapi/pn-mandate-internal.yaml</inputSpec>
<generatorName>spring</generatorName>
<library>spring-boot</library>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/server</templateDirectory>
<generateApiDocumentation>false</generateApiDocumentation>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<configOptions>
<useSpringBoot3>true</useSpringBoot3>
<dateLibrary>java11</dateLibrary>
<delegatePattern>true</delegatePattern>
<interfaceOnly>true</interfaceOnly>
Expand All @@ -337,11 +324,11 @@
<inputSpec>${project.basedir}/docs/openapi/pn-mandate-b2b-internal-appio.yaml</inputSpec>
<generatorName>spring</generatorName>
<library>spring-boot</library>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/server</templateDirectory>
<generateApiDocumentation>false</generateApiDocumentation>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<configOptions>
<useSpringBoot3>true</useSpringBoot3>
<dateLibrary>java11</dateLibrary>
<delegatePattern>true</delegatePattern>
<interfaceOnly>true</interfaceOnly>
Expand All @@ -368,11 +355,11 @@
<inputSpec>${project.basedir}/docs/openapi/pn-mandate-b2b-pg-internal.yaml</inputSpec>
<generatorName>spring</generatorName>
<library>spring-boot</library>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/server</templateDirectory>
<generateApiDocumentation>false</generateApiDocumentation>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<configOptions>
<useSpringBoot3>true</useSpringBoot3>
<dateLibrary>java11</dateLibrary>
<delegatePattern>true</delegatePattern>
<interfaceOnly>true</interfaceOnly>
Expand All @@ -389,6 +376,7 @@
</configOptions>
</configuration>
</execution>

<execution>
<id>generate-client-extreg-selfcare</id>
<goals>
Expand All @@ -400,19 +388,20 @@
<generatorName>java</generatorName>
<library>webclient</library>
<generateApiDocumentation>false</generateApiDocumentation>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/client</templateDirectory>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>true</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<configOptions>
<useJakartaEe>true</useJakartaEe>
<swaggerAnnotations>false</swaggerAnnotations>
<openApiNullable>false</openApiNullable>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcare.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcare.v1.api</apiPackage>
</configOptions>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcare.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcare.v1.api</apiPackage>
<modelNameSuffix>Dto</modelNameSuffix>
</configuration>
</execution>

<execution>
<id>generate-client-extreg-prvt</id>
<goals>
Expand All @@ -424,19 +413,20 @@
<generatorName>java</generatorName>
<library>webclient</library>
<generateApiDocumentation>false</generateApiDocumentation>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/client</templateDirectory>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>true</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<configOptions>
<useJakartaEe>true</useJakartaEe>
<swaggerAnnotations>false</swaggerAnnotations>
<openApiNullable>false</openApiNullable>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcaregroups.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcaregroups.v1.api</apiPackage>
</configOptions>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcaregroups.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.extregselfcaregroups.v1.api</apiPackage>
<modelNameSuffix>Dto</modelNameSuffix>
</configuration>
</execution>

<execution>
<id>generate-client-delivery</id>
<goals>
Expand All @@ -448,19 +438,20 @@
<generatorName>java</generatorName>
<library>webclient</library>
<generateApiDocumentation>false</generateApiDocumentation>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/client</templateDirectory>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>true</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<configOptions>
<useJakartaEe>true</useJakartaEe>
<swaggerAnnotations>false</swaggerAnnotations>
<openApiNullable>false</openApiNullable>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.delivery.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.delivery.v1.api</apiPackage>
</configOptions>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.delivery.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.delivery.v1.api</apiPackage>
<modelNameSuffix>Dto</modelNameSuffix>
</configuration>
</execution>

<execution>
<id>generate-client-datavault</id>
<goals>
Expand All @@ -472,17 +463,17 @@
<generatorName>java</generatorName>
<library>webclient</library>
<generateApiDocumentation>false</generateApiDocumentation>
<templateDirectory>${project.build.directory}/dependency-resources/scripts/openapi/templates/5.4.0/client</templateDirectory>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>true</generateSupportingFiles>
<modelNameSuffix>Dto</modelNameSuffix>
<configOptions>
<useJakartaEe>true</useJakartaEe>
<swaggerAnnotations>false</swaggerAnnotations>
<openApiNullable>false</openApiNullable>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.datavault.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.datavault.v1.api</apiPackage>
</configOptions>
<modelPackage>${project.groupId}.mandate.generated.openapi.msclient.datavault.v1.dto</modelPackage>
<apiPackage>${project.groupId}.mandate.generated.openapi.msclient.datavault.v1.api</apiPackage>
<modelNameSuffix>Dto</modelNameSuffix>
</configuration>
</execution>
</executions>
Expand Down
2 changes: 1 addition & 1 deletion scripts/aws/cfn/microservice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Resources:
ContainerEnvEntry4: !Sub 'AWS_DYNAMODB_TABLE_HISTORY=${MandatesDynamoTableHistoryName}'
ContainerEnvEntry5: 'PN_MANDATE_CLIENT_DATAVAULT_BASEPATH=http://alb.confidential.pn.internal:8080'
ContainerEnvEntry6: !Sub 'PN_MANDATE_CLIENT_EXTREG_BASEPATH=http://${ApplicationLoadBalancerDomain}:8080'
ContainerEnvEntry7: !Sub 'SPRING_CLOUD_FUNCTIONROUTER_QUEUES_LIST=${PnMandateInputsQueueName}'
ContainerEnvEntry7: !Sub 'PN_MANDATE_TOPICS_MANDATE-INPUTS=${PnMandateInputsQueueName}'
ContainerEnvEntry8: !Sub 'PN_MANDATE_SQS_TO_PN_DELIVERY_NAME=${Mandate2DeliveryQueueName}'
ContainerEnvEntry9: !Sub 'PN_MANDATE_PENDINGDURATION=${PendingDuration}'
ContainerEnvEntry10: !Sub 'PN_CRON_ANALYZER=${PnCronAnalyzer}'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.pagopa.pn.mandate.config;

import it.pagopa.pn.commons.conf.SharedAutoConfiguration;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import com.fasterxml.jackson.databind.ObjectWriter;
import it.pagopa.pn.commons.exceptions.PnInternalException;
import lombok.*;
import org.springframework.util.Base64Utils;

import software.amazon.awssdk.services.dynamodb.model.AttributeValue;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -27,7 +28,7 @@ public class PnLastEvaluatedKey {
private Map<String, AttributeValue> internalLastEvaluatedKey;

public static PnLastEvaluatedKey deserialize(String encoded) {
String json = new String(Base64Utils.decodeFromUrlSafeString(encoded), StandardCharsets.UTF_8);
String json = new String(Base64.getUrlDecoder().decode(encoded));
try {
KeyPair keyPair = reader.readValue(json);
PnLastEvaluatedKey pnLastEvaluatedKey = new PnLastEvaluatedKey();
Expand All @@ -45,7 +46,7 @@ public String serialize() {
KeyPair toSerialize = new KeyPair(externalLastEvaluatedKey, internalValues);
try {
String result = writer.writeValueAsString(toSerialize);
return Base64Utils.encodeToUrlSafeString(result.getBytes(StandardCharsets.UTF_8));
return Base64.getUrlEncoder().encodeToString(result.getBytes(StandardCharsets.UTF_8));
} catch (JsonProcessingException e) {
throw new PnInternalException("Unable to serialize LastEvaluatedKey", ERROR_CODE_MANDATE_UNSUPPORTED_LAST_EVALUTED_KEY, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Flux<PgGroupDto> getGroups(String id, boolean onlyActive) {

public Flux<String> checkAooUoIds(List<String> senderIdList){
log.logInvokingExternalService(PnLogger.EXTERNAL_SERVICES.PN_EXTERNAL_REGISTRIES, "Check aoo uo in senderId list ");
return this.aooUoIdsApi.getFilteredAooUoIdPrivate(senderIdList);
return this.aooUoIdsApi.getFilteredAooUoIdPrivate(senderIdList).flatMapMany(Flux::fromIterable);
}

}
Loading