-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added azure key strategy and get token section (#13)
Co-authored-by: Vitolo-Andrea <[email protected]> Co-authored-by: DanieleRanaldo <[email protected]>
- Loading branch information
1 parent
2d91a5e
commit 13846ba
Showing
27 changed files
with
1,380 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package it.gov.pagopa.tpp.dto; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.Map; | ||
|
||
@Data | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
public class TokenSectionDTO { | ||
private String contentType; | ||
private Map<String, String> pathAdditionalProperties; | ||
private Map<String, String> bodyAdditionalProperties; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,5 +48,4 @@ public class TppDTO { | |
private LocalDateTime lastUpdateDate; | ||
private TokenSection tokenSection; | ||
|
||
|
||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/it/gov/pagopa/tpp/dto/TppDTOWithoutTokenSection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package it.gov.pagopa.tpp.dto; | ||
|
||
import it.gov.pagopa.tpp.enums.AuthenticationType; | ||
import it.gov.pagopa.tpp.model.Contact; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Data | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
public class TppDTOWithoutTokenSection { | ||
private String tppId; | ||
|
||
@NotBlank(message = "Entity ID must not be blank") | ||
@Pattern(regexp = "^(\\d{11}|[A-Za-z0-9]{16})$", message = "Entity ID must be 11 digits or up to 16 alphanumeric characters") | ||
private String entityId; | ||
|
||
@NotBlank(message = "ID PSP must not be blank") | ||
private String idPsp; | ||
|
||
@NotBlank(message = "Business name must not be blank") | ||
private String businessName; | ||
|
||
@NotBlank(message = "Legal address must not be blank") | ||
private String legalAddress; | ||
|
||
@Pattern(regexp = "^(https?|ftp)://[^ /$.?#].[^ ]*$", message = "Message URL must be a valid URL") | ||
private String messageUrl; | ||
|
||
@Pattern(regexp = "^(https?|ftp)://[^ /$.?#].[^ ]*$", message = "Authentication URL must be a valid URL") | ||
private String authenticationUrl; | ||
|
||
@NotNull(message = "Authentication type must not be null") | ||
private AuthenticationType authenticationType; | ||
|
||
@NotNull(message = "Contact must not be null") | ||
private Contact contact; | ||
private Boolean state; | ||
private LocalDateTime creationDate; | ||
private LocalDateTime lastUpdateDate; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/it/gov/pagopa/tpp/dto/mapper/TokenSectionObjectToDTOMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package it.gov.pagopa.tpp.dto.mapper; | ||
|
||
import it.gov.pagopa.tpp.dto.TokenSectionDTO; | ||
import it.gov.pagopa.tpp.model.TokenSection; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class TokenSectionObjectToDTOMapper { | ||
|
||
public TokenSectionDTO map(TokenSection tokenSection) { | ||
return TokenSectionDTO.builder() | ||
.contentType(tokenSection.getContentType()) | ||
.pathAdditionalProperties(tokenSection.getPathAdditionalProperties()) | ||
.bodyAdditionalProperties(tokenSection.getBodyAdditionalProperties()) | ||
.build(); | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/it/gov/pagopa/tpp/dto/mapper/TppWithoutTokenSectionObjectToDTOMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package it.gov.pagopa.tpp.dto.mapper; | ||
|
||
import it.gov.pagopa.tpp.dto.TppDTOWithoutTokenSection; | ||
import it.gov.pagopa.tpp.model.Tpp; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class TppWithoutTokenSectionObjectToDTOMapper { | ||
|
||
public TppDTOWithoutTokenSection map(Tpp tpp){ | ||
return TppDTOWithoutTokenSection.builder() | ||
.state(tpp.getState()) | ||
.messageUrl(tpp.getMessageUrl()) | ||
.authenticationUrl(tpp.getAuthenticationUrl()) | ||
.authenticationType(tpp.getAuthenticationType()) | ||
.tppId(tpp.getTppId()) | ||
.idPsp(tpp.getIdPsp()) | ||
.legalAddress(tpp.getLegalAddress()) | ||
.businessName(tpp.getBusinessName()) | ||
.contact(tpp.getContact()) | ||
.entityId(tpp.getEntityId()) | ||
.creationDate(tpp.getCreationDate()) | ||
.lastUpdateDate(tpp.getLastUpdateDate()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/it/gov/pagopa/tpp/model/mapper/TokenSectionDTOToObjectMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package it.gov.pagopa.tpp.model.mapper; | ||
|
||
import it.gov.pagopa.tpp.dto.TokenSectionDTO; | ||
import it.gov.pagopa.tpp.model.TokenSection; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class TokenSectionDTOToObjectMapper { | ||
|
||
public TokenSection map(TokenSectionDTO tokenSectionDTO) { | ||
return new TokenSection( | ||
tokenSectionDTO.getContentType(), | ||
tokenSectionDTO.getPathAdditionalProperties(), | ||
tokenSectionDTO.getBodyAdditionalProperties() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.