Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 5d8f507e authored by Marco Amoia's avatar Marco Amoia
Browse files

Merge branch 'release' into 'main'

Release

See merge request !94
parents df08b063 d2b0f7fe
No related branches found
No related tags found
2 merge requests!107Update version to 1.2.0,!94Release
Pipeline #254165 passed
Showing
with 939 additions and 429 deletions
# Environment Variables Configuration
This document outlines the environment variables required to configure the application's connections to PostgreSQL, Redis, and other services. These variables are crucial for ensuring that the application connects properly to its backend services within a Kubernetes environment.
You can override this configuration changing the values.yaml
## Overview
The environment variables listed below are used to define the connection details and credentials for PostgreSQL, Redis, and other services. The values are templated using Helm, allowing for customization based on the namespace and other values provided in the Helm chart.
## Environment Variables
### DataSource Configuration
- `SPRING_DATASOURCE_URL`: The URL for the datasource connection.
- Value is derived from `db.url` specified in the Helm values.
- `SPRING_DATASOURCE_USERNAME`: The username for the datasource.
- Value is derived from `db.username` specified in the Helm values.
- `SPRING_DATASOURCE_PASSWORD`: The password for the datasource.
- Value is derived from `db.password` specified in the Helm values.
### Microservices Configuration
- `MICROSERVICE_IDENTITY_PROVIDER_URL`: The URL for the Identity Provider microservice.
- Value is derived from `microservices.identityProviderUrl` specified in the Helm values.
-
- `MICROSERVICE_ONBOARDING_URL`: The URL for the Onboarding microservice.
- Value is derived from `microservices.onboardingUrl` specified in the Helm values.
### Identity Attribute Initialization Configuration
- `DATABASESEEDING_SECURITYATTRIBUTEPROVIDERMAPPING_ENABLED`: Toggles the initialization of identity attributes.
- Value is derived from `databaseSeeding.securityAttributeProviderMapping.enabled` specified in the Helm values. **Default: true**.
- `DATABASESEEDING_SECURITYATTRIBUTEPROVIDERMAPPING_FILEPATH`: Specifies the file path to the JSON configuration file used for identity attribute initialization.
- Value is derived from `databaseSeeding.securityAttributeProviderMapping.filePath` specified in the Helm values. **Default: classpath:db.seeding/identityAttributes.default.json**.
## Usage
To use these environment variables, define them in your Kubernetes manifests or Helm chart. The values for URLs and passwords will be dynamically generated based on the namespace and other configuration values.
### Example `values-common.yaml`
```yaml
global:
keystore:
password: "your-keystore-password"
```
### Example `values-authority.yaml`
```yaml
db:
url: "jdbc:postgresql://postgresql.{{ .Release.Namespace }}.svc.cluster.local:5432/securityattributesprovider"
username: "securityattributesprovider"
password: "securityattributesprovider"
microservices:
identityProviderUrl: http://identity-provider.{{ .Release.Namespace }}.svc.cluster.local:8080
onboardingUrl: http://onboarding.{{ .Release.Namespace }}.svc.cluster.local:8080
databaseSeeding:
securityAttributeProviderMapping:
enabled: true
filePath: "classpath:db.seeding/identityAttributes.default.json OR file:///my/custom/path/file.json"
```
This diff is collapsed.
PROJECT_VERSION_NUMBER="0.8.0" PROJECT_VERSION_NUMBER="1.0.0"
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>com.aruba.simpl</groupId> <groupId>eu.europa.ec.simpl</groupId>
<artifactId>simpl-parent</artifactId> <artifactId>simpl-parent</artifactId>
<version>0.8.0</version> <version>1.0.0</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.aruba.simpl</groupId> <groupId>eu.europa.ec.simpl</groupId>
<artifactId>simpl-spring-boot-starter</artifactId> <artifactId>simpl-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.aruba.simpl</groupId> <groupId>eu.europa.ec.simpl</groupId>
<artifactId>simpl-test-lib</artifactId> <artifactId>simpl-test-lib</artifactId>
</dependency> </dependency>
<dependency> <dependency>
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
<dependency> <dependency>
<groupId>org.instancio</groupId> <groupId>org.instancio</groupId>
<artifactId>instancio-junit</artifactId> <artifactId>instancio-junit</artifactId>
<version>${instancio.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
package com.aruba.simpl.securityattributesprovider.controllers;
import com.aruba.simpl.common.exchanges.securityattributeprovider.SapCliExchange;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO;
import com.aruba.simpl.securityattributesprovider.services.CliService;
import io.swagger.v3.oas.annotations.Hidden;
import java.util.List;
import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
@Log4j2
@RestController
@Hidden
public class CliController implements SapCliExchange {
private final CliService cliService;
public CliController(CliService cliService) {
this.cliService = cliService;
}
@Override
public void initializeIdentityAttributes(@RequestBody List<IdentityAttributeDTO> list, HttpHeaders token) {
log.info("Initializing identity attributes from CLI");
cliService.createAttributes(list);
}
}
package com.aruba.simpl.securityattributesprovider.controllers;
import com.aruba.simpl.common.exchanges.securityattributeprovider.IdentityAttributeExchange;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO;
import com.aruba.simpl.common.model.filters.IdentityAttributeFilter;
import com.aruba.simpl.common.model.responses.PageResponse;
import com.aruba.simpl.common.model.validators.UpdateOperation;
import com.aruba.simpl.securityattributesprovider.services.IdentityAttributeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import java.util.List;
import java.util.UUID;
import lombok.extern.log4j.Log4j2;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Log4j2
@RestController
public class IdentityAttributeController implements IdentityAttributeExchange {
private final IdentityAttributeService service;
public IdentityAttributeController(IdentityAttributeService service) {
this.service = service;
}
@Operation(
summary = "Create Identity Attribute",
description = "Creates a new identity attribute.",
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "Identity attribute to be created",
required = true,
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = IdentityAttributeDTO.class))),
responses = {
@ApiResponse(
responseCode = "201",
description = "Successfully created identity attribute",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = IdentityAttributeDTO.class))),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role"),
@ApiResponse(
responseCode = "409",
description = "Conflict: Identity attribute with the same code or name already exists")
})
@Override
public IdentityAttributeDTO create(@RequestBody IdentityAttributeDTO attribute) {
return service.create(attribute);
}
@Operation(
summary = "Find Identity Attribute by ID",
description = "Retrieves an identity attribute by its unique identifier.",
parameters = {
@Parameter(
name = "id",
description = "UUID of the identity attribute to be retrieved",
required = true,
schema = @Schema(type = "string", format = "uuid"))
},
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully retrieved identity attribute",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = IdentityAttributeDTO.class))),
@ApiResponse(responseCode = "404", description = "Identity attribute not found"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public IdentityAttributeDTO findById(@PathVariable UUID id) {
return service.findById(id);
}
@Operation(
summary = "Update Identity Attribute",
description = "Updates an existing identity attribute by its unique identifier.",
parameters = {
@Parameter(
name = "id",
description = "UUID of the identity attribute to be updated",
required = true,
schema = @Schema(type = "string", format = "uuid"))
},
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "Updated identity attribute data",
required = true,
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = IdentityAttributeDTO.class))),
responses = {
@ApiResponse(responseCode = "204", description = "Successfully updated identity attribute"),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "404", description = "Identity attribute not found"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public void updateAttributes(
@PathVariable UUID id, @RequestBody @Validated(UpdateOperation.class) IdentityAttributeDTO attribute) {
attribute.setId(id);
service.update(id, attribute);
}
@Operation(
summary = "Delete Identity Attribute",
description = "Deletes an identity attribute by its unique identifier.",
parameters = {
@Parameter(
name = "id",
description = "UUID of the identity attribute to be deleted",
required = true,
schema = @Schema(type = "string", format = "uuid"))
},
responses = {
@ApiResponse(responseCode = "204", description = "Successfully deleted identity attribute"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role"),
@ApiResponse(responseCode = "404", description = "Identity attribute not found")
})
@Override
public void delete(@PathVariable UUID id) {
service.delete(id);
}
@Operation(
summary = "Search Identity Attributes",
description = "Searches for identity attributes based on provided filters and pagination options.",
responses = {
@ApiResponse(responseCode = "200", description = "Successfully retrieved search results"),
@ApiResponse(responseCode = "400", description = "Invalid input data")
})
@Override
public PageResponse<IdentityAttributeDTO> search(
@ParameterObject @ModelAttribute IdentityAttributeFilter filter,
@PageableDefault(sort = "id") @ParameterObject Pageable pageable) {
return new PageResponse<>(service.search(filter, pageable));
}
@Operation(
summary = "Update Assignable Parameter",
description = "Updates the assignable parameter for a list of identity attributes.",
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "List of UUIDs representing identity attributes",
required = true,
content =
@Content(
mediaType = "application/json",
array = @ArraySchema(schema = @Schema(type = "string", format = "uuid")))),
parameters = {
@Parameter(
name = "value",
description = "Boolean value to assign to the 'assignable' parameter",
required = true,
schema = @Schema(type = "boolean"))
},
responses = {
@ApiResponse(responseCode = "200", description = "Successfully updated assignable parameter"),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public void updateAssignableParameter(@RequestBody List<UUID> body, @PathVariable boolean value) {
service.updateAssignableParameter(body, value);
}
@Operation(
summary = "Add Participant Type",
description = "Adds a participant type to a list of identity attributes.",
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "Array of UUIDs representing identity attributes",
required = true,
content =
@Content(
mediaType = "application/json",
array = @ArraySchema(schema = @Schema(type = "string", format = "uuid")))),
parameters = {
@Parameter(
name = "participantType",
description = "Type of participant to be added",
required = true,
schema = @Schema(implementation = String.class))
},
responses = {
@ApiResponse(responseCode = "200", description = "Successfully added participant type"),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public void addParticipantType(@RequestBody UUID[] body, @PathVariable String participantType) {
service.addParticipantType(body, participantType);
}
@Operation(
summary = "Unassign Identity Attributes",
description = "Unassigns a list of identity attributes from a user.",
parameters = {
@Parameter(
name = "userId",
description = "UUID of the user from whom the identity attributes will be unassigned",
required = true,
schema = @Schema(type = "string", format = "uuid"))
},
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "List of UUIDs representing identity attributes to be unassigned",
required = true,
content =
@Content(
mediaType = "application/json",
array = @ArraySchema(schema = @Schema(type = "string", format = "uuid")))),
responses = {
@ApiResponse(responseCode = "200", description = "Successfully unassigned identity attributes"),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public void unassign(UUID userId, List<UUID> identityAttributes) {
service.unassign(userId, identityAttributes);
}
@Operation(
summary = "Assign Identity Attributes",
description = "Assigns a list of identity attributes to a user.",
parameters = {
@Parameter(
name = "userId",
description = "UUID of the user to whom the identity attributes will be assigned",
required = true,
schema = @Schema(type = "string", format = "uuid"))
},
requestBody =
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "List of UUIDs representing identity attributes to be assigned",
required = true,
content =
@Content(
mediaType = "application/json",
array = @ArraySchema(schema = @Schema(type = "string", format = "uuid")))),
responses = {
@ApiResponse(responseCode = "204", description = "Successfully assigned identity attributes"),
@ApiResponse(responseCode = "400", description = "Invalid input data"),
@ApiResponse(responseCode = "401", description = "Access denied"),
@ApiResponse(responseCode = "403", description = "Forbidden: User does not have the required role")
})
@Override
public void assign(UUID userId, List<UUID> identityAttributes) {
service.assign(userId, identityAttributes);
}
@Override
public void assignSnapshot(String participantType, UUID userId, List<UUID> excludedAttributes) {
service.assignLastSnapshot(participantType, userId, excludedAttributes);
}
}
package com.aruba.simpl.securityattributesprovider.services;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
public interface CliService {
@Transactional
void createAttributes(List<IdentityAttributeDTO> list);
}
package com.aruba.simpl.securityattributesprovider.services.impl;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO;
import com.aruba.simpl.common.model.validators.CreateOperation;
import com.aruba.simpl.securityattributesprovider.services.CliService;
import com.aruba.simpl.securityattributesprovider.services.IdentityAttributeService;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@Service
public class CliServiceImpl implements CliService {
private final IdentityAttributeService identityAttributeService;
public CliServiceImpl(IdentityAttributeService identityAttributeService) {
this.identityAttributeService = identityAttributeService;
}
@Override
@Transactional
public void createAttributes(@Validated(CreateOperation.class) List<IdentityAttributeDTO> list) {
identityAttributeService.createBatch(list);
}
}
package com.aruba.simpl.securityattributesprovider; package eu.europa.ec.simpl.securityattributesprovider;
import com.aruba.simpl.common.model.dto.IdentityAttributeWithOwnershipDTO; import eu.europa.ec.simpl.common.model.dto.IdentityAttributeWithOwnershipDTO;
import org.springdoc.core.utils.SpringDocUtils; import org.springdoc.core.utils.SpringDocUtils;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.aruba.simpl.securityattributesprovider.configurations; package eu.europa.ec.simpl.securityattributesprovider.configurations;
import com.aruba.simpl.common.argumentresolvers.PageableArgumentResolver; import eu.europa.ec.simpl.common.argumentresolvers.PageableArgumentResolver;
import com.aruba.simpl.common.argumentresolvers.QueryParamsArgumentResolver; import eu.europa.ec.simpl.common.argumentresolvers.QueryParamsArgumentResolver;
import com.aruba.simpl.common.exchanges.identityprovider.ParticipantExchange; import eu.europa.ec.simpl.common.exchanges.identityprovider.IdentityProviderParticipantExchange;
import com.aruba.simpl.common.exchanges.onboarding.ParticipantTypeExchange; import eu.europa.ec.simpl.common.exchanges.onboarding.ParticipantTypeExchange;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestClient; import org.springframework.web.client.RestClient;
...@@ -13,16 +13,25 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory; ...@@ -13,16 +13,25 @@ import org.springframework.web.service.invoker.HttpServiceProxyFactory;
@Configuration @Configuration
public class ClientConfig { public class ClientConfig {
private final MicroserviceProperties microserviceProperties;
public ClientConfig(MicroserviceProperties microserviceProperties) {
this.microserviceProperties = microserviceProperties;
}
@Bean @Bean
public ParticipantExchange participantExchange( public IdentityProviderParticipantExchange identityProviderParticipantExchange(
MicroserviceProperties properties, RestClient.Builder restClientBuilder) { RestClient.Builder restClientBuilder) {
return buildExchange(properties.identityProvider().url(), restClientBuilder, ParticipantExchange.class); return buildExchange(
microserviceProperties.identityProvider().url(),
restClientBuilder,
IdentityProviderParticipantExchange.class);
} }
@Bean @Bean
public ParticipantTypeExchange participantTypeExchange( public ParticipantTypeExchange participantTypeExchange(RestClient.Builder restClientBuilder) {
MicroserviceProperties properties, RestClient.Builder restClientBuilder) { return buildExchange(
return buildExchange(properties.onboarding().url(), restClientBuilder, ParticipantTypeExchange.class); microserviceProperties.onboarding().url(), restClientBuilder, ParticipantTypeExchange.class);
} }
private <E> E buildExchange(String baseurl, RestClient.Builder restClientBuilder, Class<E> clazz) { private <E> E buildExchange(String baseurl, RestClient.Builder restClientBuilder, Class<E> clazz) {
......
package com.aruba.simpl.securityattributesprovider.configurations; package eu.europa.ec.simpl.securityattributesprovider.configurations;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
......
package com.aruba.simpl.securityattributesprovider.configurations; package eu.europa.ec.simpl.securityattributesprovider.configurations;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
......
package com.aruba.simpl.securityattributesprovider.configurations; package eu.europa.ec.simpl.securityattributesprovider.configurations;
import java.util.Arrays; import java.util.Arrays;
import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.customizers.OpenApiCustomizer;
......
package eu.europa.ec.simpl.securityattributesprovider.controllers;
import eu.europa.ec.simpl.common.exchanges.securityattributeprovider.IdentityAttributeExchange;
import eu.europa.ec.simpl.common.model.dto.IdentityAttributeDTO;
import eu.europa.ec.simpl.common.model.filters.IdentityAttributeFilter;
import eu.europa.ec.simpl.common.model.responses.PageResponse;
import eu.europa.ec.simpl.common.model.validators.UpdateOperation;
import eu.europa.ec.simpl.securityattributesprovider.services.IdentityAttributeService;
import io.swagger.v3.oas.annotations.Hidden;
import java.util.List;
import java.util.UUID;
import lombok.extern.log4j.Log4j2;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Log4j2
@RestController
public class IdentityAttributeController implements IdentityAttributeExchange {
private final IdentityAttributeService service;
public IdentityAttributeController(IdentityAttributeService service) {
this.service = service;
}
@Override
public IdentityAttributeDTO create(@RequestBody IdentityAttributeDTO attribute) {
return service.create(attribute);
}
@Override
public IdentityAttributeDTO findById(@PathVariable UUID id) {
return service.findById(id);
}
@Override
public void updateAttributes(
@PathVariable UUID id, @RequestBody @Validated(UpdateOperation.class) IdentityAttributeDTO attribute) {
attribute.setId(id);
service.update(id, attribute);
}
@Override
public void delete(@PathVariable UUID id) {
service.delete(id);
}
@Override
public PageResponse<IdentityAttributeDTO> search(
@ParameterObject @ModelAttribute IdentityAttributeFilter filter,
@PageableDefault(sort = "id") @ParameterObject Pageable pageable) {
return new PageResponse<>(service.search(filter, pageable));
}
@Override
public void updateAssignableParameter(@RequestBody List<UUID> body, @PathVariable boolean value) {
service.updateAssignableParameter(body, value);
}
@Override
public void addParticipantType(@RequestBody UUID[] body, @PathVariable String participantType) {
service.addParticipantType(body, participantType);
}
@Override
public void unassign(UUID userId, List<UUID> identityAttributes) {
service.unassign(userId, identityAttributes);
}
@Override
public void assign(UUID userId, List<UUID> identityAttributes) {
service.assign(userId, identityAttributes);
}
@Hidden
@Override
public void assignSnapshot(String participantType, UUID userId, List<UUID> excludedAttributes) {
service.assignLastSnapshot(participantType, userId, excludedAttributes);
}
@Hidden
@Override
public void importIdentityAttributes(@RequestBody List<IdentityAttributeDTO> list) {
log.info("Initializing identity attributes from CLI");
service.createBatch(list);
}
}
package com.aruba.simpl.securityattributesprovider.controllers; package eu.europa.ec.simpl.securityattributesprovider.controllers;
import com.aruba.simpl.common.model.constants.SimplHeaders; import eu.europa.ec.simpl.common.model.constants.SimplHeaders;
import com.aruba.simpl.common.model.dto.IdentityAttributeDTO; import eu.europa.ec.simpl.common.model.dto.IdentityAttributeDTO;
import com.aruba.simpl.common.model.dto.IdentityAttributeWithOwnershipDTO; import eu.europa.ec.simpl.common.model.dto.IdentityAttributeWithOwnershipDTO;
import com.aruba.simpl.securityattributesprovider.services.IdentityAttributeService; import eu.europa.ec.simpl.securityattributesprovider.services.IdentityAttributeService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn; import io.swagger.v3.oas.annotations.enums.ParameterIn;
......
package com.aruba.simpl.securityattributesprovider.exceptions; package eu.europa.ec.simpl.securityattributesprovider.exceptions;
import com.aruba.simpl.common.exceptions.StatusException; import eu.europa.ec.simpl.common.exceptions.StatusException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
public class IdentityAttributeAlreadyExistException extends StatusException { public class IdentityAttributeAlreadyExistException extends StatusException {
......
package com.aruba.simpl.securityattributesprovider.exceptions; package eu.europa.ec.simpl.securityattributesprovider.exceptions;
import com.aruba.simpl.common.exceptions.StatusException; import eu.europa.ec.simpl.common.exceptions.StatusException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
public class IdentityAttributeAssignedException extends StatusException { public class IdentityAttributeAssignedException extends StatusException {
......
package com.aruba.simpl.securityattributesprovider.exceptions; package eu.europa.ec.simpl.securityattributesprovider.exceptions;
import com.aruba.simpl.common.exceptions.StatusException; import eu.europa.ec.simpl.common.exceptions.StatusException;
import java.util.UUID; import java.util.UUID;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
......
package com.aruba.simpl.securityattributesprovider.exceptions; package eu.europa.ec.simpl.securityattributesprovider.exceptions;
import com.aruba.simpl.common.exceptions.StatusException; import eu.europa.ec.simpl.common.exceptions.StatusException;
import java.util.List; import java.util.Set;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
public class ParticipantTypeDoesNotExistException extends StatusException { public class ParticipantTypeDoesNotExistException extends StatusException {
public ParticipantTypeDoesNotExistException(String participantType) { public ParticipantTypeDoesNotExistException(Set<String> participantTypes) {
this(List.of(participantType));
}
public ParticipantTypeDoesNotExistException(List<String> participantTypes) {
super( super(
HttpStatus.BAD_REQUEST, HttpStatus.BAD_REQUEST,
"Non-existing participant type(s): %s.".formatted(String.join(", ", participantTypes))); "Non-existing participant type(s): %s.".formatted(String.join(", ", participantTypes)));
......
package com.aruba.simpl.securityattributesprovider.model.dto; package eu.europa.ec.simpl.securityattributesprovider.model.dto;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment