Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/1442 domain specific s3 in engine #1769

Merged
merged 5 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
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
Next Next commit
1442 fix usage of domain specific s3 in engine
markostreich committed Jun 14, 2024
commit b3a504a0b791258daf0b35479892249b62788cfd
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ public FileExtensionService fileExtensionValidation(final SupportedFileExtension
}

/**
* Instance of a {@link FileExtensionService} containing supported file extensions configured within in the 'de.muenchen.oss.digiwf.s3' scope.
* Instance of a {@link FileExtensionService} containing supported file extensions configured within in the 'de.muenchen.oss.digiwf.s3.client' scope.
*
* @return {@link FileExtensionService} for managing file extensions.
*/
@@ -116,21 +116,14 @@ public FileExtensionService fileExtensionValidationFromS3IntegrationClientProper
}

/**
* Instance of an {@link S3StorageUrlProvider} containing an externally created {@link S3DomainProvider} for retrieving S
* Instance of an {@link S3StorageUrlProvider} containing an externally created {@link S3DomainProvider} for retrieving the S3 storage URL.
*
* @param s3DomainProvider
* @return
* @param s3DomainProvider Provider of domain specific S3 storages configured in process configurations.
* @return Provider of the S3 storage URL.
*/
@Bean
@ConditionalOnBean(S3DomainProvider.class)
public S3StorageUrlProvider s3StorageUrlProvider(final S3DomainProvider s3DomainProvider) {
return new S3StorageUrlProvider(s3DomainProvider, this.s3IntegrationClientProperties.getDocumentStorageUrl());
}

@Bean
@ConditionalOnMissingBean(S3DomainProvider.class)
public S3StorageUrlProvider s3StorageUrlProviderWithoutDomainProvider() {
return new S3StorageUrlProvider(this.s3IntegrationClientProperties.getDocumentStorageUrl());
}

}
Original file line number Diff line number Diff line change
@@ -29,15 +29,6 @@ public S3StorageUrlProvider(final S3DomainProvider s3DomainProvider, final Strin
this.defaultDocumentStorageUrl = defaultDocumentStorageUrl;
}

/**
* Constructor for client users which do not obtain their own {@link S3DomainProvider}.
*
* @param defaultDocumentStorageUrl The default S3 storage URL to use if no domain-specific URL is available.
*/
public S3StorageUrlProvider(final String defaultDocumentStorageUrl) {
this(processDefinition -> Optional.empty(), defaultDocumentStorageUrl);
}

/**
* Provides an S3 storage URL either configured in a process configuration of a given process definition or the default URL.
*
Original file line number Diff line number Diff line change
@@ -32,15 +32,6 @@ spring:
sendMessage-out-0:
destination: dwf-connector-${DIGIWF_ENV}

de:
muenchen:
oss:
digiwf:
s3:
client:
document-storage-url: "${DOCUMENT_STORAGE_HOST:http://localhost}:${DOCUMENT_STORAGE_PORT:8080}"
enable-security: false

io:
muenchendigital:
digiwf:
Original file line number Diff line number Diff line change
@@ -22,10 +22,7 @@
import org.springframework.web.client.HttpServerErrorException;
import reactor.core.publisher.Mono;

import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.*;

import static de.muenchen.oss.digiwf.task.service.application.usecase.TestFixtures.generateTask;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
@@ -45,7 +42,7 @@ class WorkOnTaskFileUseCaseTest {

private final CurrentUserPort currentUserPort = mock(CurrentUserPort.class);

private final S3StorageUrlProvider s3StorageUrlProvider = new S3StorageUrlProvider("defaultS3Url");
private final S3StorageUrlProvider s3StorageUrlProvider = new S3StorageUrlProvider(processDefinitionId -> Optional.empty(), "defaultS3Url");

private final WorkOnTaskFileUseCase useCase = new WorkOnTaskFileUseCase(documentStorageFolderRepository, presignedUrlPort, taskFileConfigResolverPort,
taskQueryPort, currentUserPort, s3StorageUrlProvider);