Commit 13c9d3f9 authored by Jürgen Hannus's avatar Jürgen Hannus
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Jürgen Hannus

See merge request teis/common-api-gateway!188
parents ef1261f5 d306ae3f
......@@ -9,11 +9,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(MinioProperties.class)
@EnableConfigurationProperties(FileStorageProperties.class)
@RequiredArgsConstructor
public class MinioConfig {
public class FileStorageConfig {
private final MinioProperties properties;
private final FileStorageProperties properties;
@Bean
MinioClient minioClient() throws InvalidPortException, InvalidEndpointException {
......
......@@ -8,8 +8,8 @@ import javax.validation.constraints.NotNull;
@Getter
@Setter
@ConfigurationProperties(prefix = "minio")
public class MinioProperties {
@ConfigurationProperties(prefix = "teis.file.storage")
public class FileStorageProperties {
@NotNull
private String url;
......
......@@ -3,6 +3,7 @@ package ee.sm.ti.teis.commongateway.riskassessments.riskassessment;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.dto.*;
import ee.sm.ti.teis.commongateway.riskassessments.riskassessment.request.*;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.types.enums.RiskFactorAssessmentsOutputType;
import io.swagger.annotations.ApiOperation;
......@@ -17,7 +18,7 @@ import java.util.UUID;
@RequiredArgsConstructor
public class RiskAssessmentController extends TeisBaseController {
private final RiskAssessmentProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.create}", response = RiskAssessmentPublicDto.class)
@PostMapping
......@@ -26,7 +27,7 @@ public class RiskAssessmentController extends TeisBaseController {
CreateRiskAssessmentPublicRequest request = new CreateRiskAssessmentPublicRequest();
request.setPayload(dto, requestMetaDTO);
return service.create(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.copy}", response = RiskAssessmentPublicDto.class)
......@@ -37,7 +38,7 @@ public class RiskAssessmentController extends TeisBaseController {
dto.setRiskAssessment(RiskAssessmentPublicDto.builder().id(id).build());
request.setPayload(dto, requestMetaDTO);
return service.copy(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get}", response = RiskAssessmentPublicDto.class)
......@@ -47,7 +48,7 @@ public class RiskAssessmentController extends TeisBaseController {
GetRiskAssessmentsPublicRequest request = new GetRiskAssessmentsPublicRequest();
request.setPayload(employerId, requestMetaDTO);
return service.getRiskAssessments(request);
return (List<RiskAssessmentPublicDto>) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.update-title}")
......@@ -59,7 +60,7 @@ public class RiskAssessmentController extends TeisBaseController {
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
return service.updateTitle(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.conclusion}", response = RiskAssessmentConclusionDto.class)
......@@ -68,7 +69,7 @@ public class RiskAssessmentController extends TeisBaseController {
RiskAssessmentConclusionPublicRequest request = new RiskAssessmentConclusionPublicRequest();
request.setPayload(id, requestMetaDTO);
return service.getConclusion(request);
return (RiskAssessmentConclusionDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.action-plan-conclusion}", response = RiskAssessmentActionPlanConclusionDto.class)
......@@ -78,7 +79,7 @@ public class RiskAssessmentController extends TeisBaseController {
RiskAssessmentActionPlanConclusionPublicRequest request = new RiskAssessmentActionPlanConclusionPublicRequest();
request.setPayload(id, requestMetaDTO);
return service.getActionPlanConclusion(request);
return (RiskAssessmentActionPlanConclusionDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-business-types}", response = RiskAssessmentPublicDto.class)
......@@ -88,7 +89,7 @@ public class RiskAssessmentController extends TeisBaseController {
RiskAssessmentBusinessTypePublicRequest request = new RiskAssessmentBusinessTypePublicRequest();
request.setPayload(id, requestMetaDTO);
return service.getRiskAssessmentBusinessTypes(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-by-id}", response = RiskAssessmentPublicDto.class)
......@@ -98,7 +99,7 @@ public class RiskAssessmentController extends TeisBaseController {
GetRiskAssessmentPublicRequest request = new GetRiskAssessmentPublicRequest();
request.setPayload(id, requestMetaDTO);
return service.getRiskAssessment(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.get-risk-factor-assessments}", response = RiskAssessmentPublicDto.class)
......@@ -108,7 +109,7 @@ public class RiskAssessmentController extends TeisBaseController {
RiskAssessmentRiskFactorAssessmentPublicRequest request = new RiskAssessmentRiskFactorAssessmentPublicRequest();
request.setPayload(new RiskAssessmentRiskFactorAssessmentPublicRequest.Parameters(id, outputType), requestMetaDTO);
return service.getRiskFactorAssessments(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.update-status}", response = RiskAssessmentPublicDto.class)
......@@ -120,15 +121,25 @@ public class RiskAssessmentController extends TeisBaseController {
dto.setId(id);
request.setPayload(dto, requestMetaDTO);
return service.updateStatus(request);
return (RiskAssessmentPublicDto) service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.delete}")
@DeleteMapping("{id}")
public void delete(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
public void delete(@PathVariable UUID id, RequestMetaDTO requestMetaDTO) {
DeleteRiskAssessmentRequest request = new DeleteRiskAssessmentRequest();
request.setPayload(id, requestMetaDTO);
service.delete(request);
service.sendAndReceive(request);
}
@ApiOperation(value = "${teis.api.risk-assessments.risk-assessment.exists}")
@GetMapping("employer-risk-assessment-exists")
public RiskAssessmentExistsDto exists(RequestMetaDTO requestMetaDTO) {
RiskAssessmentExistsPublicRequest request = new RiskAssessmentExistsPublicRequest();
request.setRequestMetaDTO(requestMetaDTO);
return (RiskAssessmentExistsDto) service.sendAndReceive(request);
}
}
package ee.sm.ti.teis.commongateway.signing;
import ee.sm.ti.teis.commongateway.file.FileMetadataDto;
import ee.sm.ti.teis.commongateway.signing.request.SignExistingFileRequest;
import ee.sm.ti.teis.commongateway.signing.response.SignExistingFileResponse;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@Deprecated(since = "1.19.0-SNAPSHOT", forRemoval = true)
@RequiredArgsConstructor
public class SigningProcessingService {
private final RabbitTemplate gwRabbitTemplate;
public FileMetadataDto signExistingFile(SignExistingFileRequest request) {
SignExistingFileResponse response =
(SignExistingFileResponse) gwRabbitTemplate.convertSendAndReceive(request.routingKey(), request);
if (response != null) {
return response.processResponse();
}
throw new NoResponseFromRabbitException(request.getRequestMetaDTO().getRequestId());
}
}
......@@ -3,6 +3,7 @@ package ee.sm.ti.teis.commongateway.signing;
import ee.sm.ti.teis.commongateway.file.FileMetadataDto;
import ee.sm.ti.teis.commongateway.signing.request.SignExistingFileRequest;
import ee.sm.ti.teis.gatewaycommon.controller.TeisBaseController;
import ee.sm.ti.teis.gatewaycommon.rabbit.RequestProcessingService;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
......@@ -21,15 +22,15 @@ import java.util.UUID;
@RequiredArgsConstructor
public class SigningTestController extends TeisBaseController {
private final SigningProcessingService service;
private final RequestProcessingService service;
@ApiOperation(value = "${teis.api.signings.sign-file-by-id}", response = FileMetadataDto.class)
@PostMapping("sign-file/{fileId}")
public FileMetadataDto signFile(@PathVariable("fileId") UUID fileId,
RequestMetaDTO requestMetaDTO, HttpServletResponse response) {
public FileMetadataDto signFile(@PathVariable("fileId") UUID fileId, RequestMetaDTO requestMetaDTO,
HttpServletResponse response) {
SignExistingFileRequest request = new SignExistingFileRequest();
request.setPayload(fileId, requestMetaDTO);
return service.signExistingFile(request);
return (FileMetadataDto) service.sendAndReceive(request);
}
}
......@@ -4,6 +4,7 @@ spring:
port: 5672
username: guest
password: guest
teis:
mockauth:
token-secret: # use dev environment token secret defined in k8s teis-secrets.MOCK_AUTH_TOKEN_SECRET value
......@@ -17,11 +18,12 @@ teis:
issuer-uri:
# Self-service application base URL, reference variable in Wiki BASE_URL_PUBLIC
baseurl:
minio:
url: http://localhost:9000
access-key: miniotest
secret-key: miniosecret
bucket: teis
file:
storage:
url: http://localhost:9000
access-key: miniotest
secret-key: miniosecret
# Change Tomcat port locally. Default is 8080
#server:
# port: 9000
......@@ -60,12 +60,12 @@ teis:
update-timeout: ${RABBIT_TEMPLATE_GW_EXCHANGE_REPLY_TIMEOUT:6000}
upload:
max-http-request-header-size: ${FILE_UPLOAD_MAX_HTTP_REQUEST_HEADER_SIZE:1024000}
storage:
url: ${S3_HOST:localhost}
access-key: ${S3_ACCESS_KEY:s3MinioAccessKey}
secret-key: ${S3_SECRET_KEY:s3MinioSecretKey}
init-bucket-configuration: true
parameter:
cache-duration: PT30S
minio:
url: ${S3_HOST:localhost}
access-key: ${S3_ACCESS_KEY:s3MinioAccessKey}
secret-key: ${S3_SECRET_KEY:s3MinioSecretKey}
bucket: ${S3_BUCKET:teis}
bucket-thumbnail: ${S3_BUCKET_THUMBNAIL:teis-thumbnail}
......@@ -50,8 +50,9 @@ teis.api.messages.get-role-definitions-privileges: Teenus väljastab rollide pri
teis.api.messages.get-role-definitions-privileges-ids: 346a9e4c-59c5-4368-8b1f-90e06e3b6514,86cd6b6e-1b53-4997-a2fd-630b06d33f74
teis.api.messages.post-audit-log: Teenus lisab uue uue audit logi kirje
teis.api.messages.get-audit-log: Teenus tagastab soovitud objektiga seotud audit logi kirjed. Kui sisendis on esindatud mõlemad id väljad, kasutatakse otsingus dataObjectId-d.
teis.api.messages.get-employer-audit-log: Teenus võimaldab ettevõttel vaadata selle ettevõtte kohta tehtud logikandeid.
teis.api.messages.audit-log-exists: Teenus võimaldab kontrollida, kas teatud kasutaja, andmeobjekti ja tegevuse tüübi kohta on viimasel ajal tehtud auditlogi kanne.
teis.api.messages.get-auditlog-parentObjectId: Kõik kirjed mille parent ojekti id on.
teis.api.messages.get-auditlog-parentObjectId: Kõik kirjed mille parent objekti id on.
teis.api.messages.get-auditlog-dataObjectId: Kõik kirjed mille andme objekti id on.
teis.api.messages.logout: Iseteenindusest välja logimine client_id ja refresh_tokeni alusel.
teis.api.messages.post-usage-data: API-t kasutatakse andmejälgijasse isikuandmete töötlemise kohta info saatmiseks.
......@@ -149,6 +150,7 @@ teis.api.risk-assessments.risk-assessment.get-by-id: Teenus väljastab riskianal
teis.api.risk-assessments.risk-assessment.get-risk-factor-assessments: Teenus väljastab riskianalüüsi raames antud ohu hinnangute andmed oos hinnatavate ohtude kirjeldustega.
teis.api.risk-assessments.risk-assessment.delete: Teenus kustutab riskianalüüsi. Teenust kasutab iseteenindus, et kustutada ekslikult loodud riskianalüüs. Kustutada ei saa kinnitatud riskianalüüsi.
teis.api.risk-assessments.risk-assessment.copy: Teenus loob uue riskianalüüsi olemasoleva riskianalüüsi kopeerimise teel.
teis.api.risk-assessments.risk-assessment.exists: Teenus väljastab info, kas ettevõttel on olemas esitatud riskianalüüs. Teenust kasutatakse, et kasutajaliideses saada teada, kas on olemas riskianalüüs ja juhtida kasutajat riskianalüüsi tegema.
teis.api.risk-assessments.risk-statement-assessment.patch: Teenus salvestab abinõu rakendamise vastuse (kas abinõu on rakendatud). Teenust kasutab iseteenindus, et salvestada kasutaja tehtud valikud.
teis.api.risk-assessments.risk-statement-assessment.patch-description: Teenus salvestab täiendavalt lisatud abinõu kirjelduse muudatuse. Teenust kasutab iseteenindus, et kasutaja saaks korrigeerida vigaselt sisestatud kirjeldust.
......@@ -170,3 +172,5 @@ teis.api.representatives.authority-permission.update-valid-until: Teenus muudab
teis.api.representatives.authority-permission.validate: Test-teenus võimaldab kontrollida, kas ettevõttel on ligipääsu õigus teatud ettevõtte andmetele (nt kas töötervishoiu arst omab ligipääsu teatud ettevõtte andmetele).
teis.api.representatives.authority.get-list: Päringuteenus otsib sisendis esitatud tingimustele vastavad Authority andmeobjektid. TI siseselt kasutatakse päringut Authority'te haldamise käigus, et kuvada Authority'te nimistu. Iseteeninduses kasutatakse päringut ligipääsu õiguste haldamise käigus, et valida Authority, mille anda ligipääsu õigus.
teis.api.authorities.get-authority-licences: Teenus väljastab teatud ülesandeid täitvale ettevõttele (nt töötervishoiuteenuse osutajale) nende ülesannete täitmiseks antud tegevusload. Kasutatakse selleks, et kuvada kasutajaliideses ettevõttele antud tegevusload. Kasutatakse halduse kontekstis, et kontrollida, mis andmed on süsteemis ettevõtte tegevuslubade kohta olemas.
theGroup=ee.sm.ti.teis
//commonApiGatewayVersion=forSearch ^commonApiGatewayVersion=.*?-SNAPSHOT
theVersion=1.19.0
commonsVersion=1.19.0
theVersion=1.20.0
commonsVersion=1.20.0
pluginVersion=1.2.0
filesVersion=1.16.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment