nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
921 stars 276 forks source link

Support ANY S3 Endpoints, not just Amazon #4585

Open ruqez opened 3 years ago

ruqez commented 3 years ago

Is your feature request related to a problem? Please describe. The new "Amazon S3" file writer is currently locked to only Amazon AWS and does not support the withEndpointConfiguration (in the legacy AWS SDK 1.x com.amazonaws:aws-java-sdk-s3) or endpointOverride (in the AWS SDK 2.x software.amazon.awssdk), that is, a user-defined HOST and PORT to connect to all 100% compatible S3 Object Storage platforms is not supported by Mirth, it only supports the Amazon hard coded AWS endpoint.

Describe your use case Currently the "Amazon S3 File Writer" is just that... AMAZON ONLY. It is not a true "S3 API File Writer", it is merely an Amazon S3 connector. There are, however, dozens of 100% compatible S3 Object Storage platforms. Many can be self-hosted while others are hosted solutions that all are 100% compatible with the S3 API. To update your Amazon-only connector to be a fully compatible "S3 File Writer" only requires the addition of adding the ability to configure the Host and Port (example: https://s3.customdomain.com:9000).

Describe the solution you'd like Add support to make the "Amazon S3" File writer a generic S3 connector and not just an Amazon only.

Either add support using the legacy 1.x com.amazonaws:aws-java-sdk-s3 AWS SDK withEndpointConfiguration or the 2.x software.amazon.awssdk AWS SDK endpointOverride

2.x AWS SDK EXAMPLE

AwsBasicCredentials awsCreds = AwsBasicCredentials.create(accessKey, secretKey);
S3Client s3Client = S3Client.builder()
                .endpointOverride(new URI(HOST_PORT))
                .region(REGION)
                .credentialsProvider(StaticCredentialsProvider.create(awsCreds))
                .build();

Where HOST_PORT is host:port (example: "http://self-hosted-s3.example.com:9000")

1.x legacy AWS SDK EXAMPLE

AWSCredentials credentials = new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY);
ClientConfiguration clientConfiguration = new ClientConfiguration();
clientConfiguration.setSignerOverride("AWSS3V4SignerType");

s3Client = AmazonS3ClientBuilder
                .standard()
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(HOST_PORT, Regions.US_EAST_1.name()))
                .withPathStyleAccessEnabled(true)
                .withClientConfiguration(clientConfiguration)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();

Where HOST_PORT is host:port (example: "http://self-hosted-s3.example.com:9000")

Describe alternatives you've considered

Additional context It would be great if Mirth could support ALL S3 compatible Object Storage platforms including self-hosted S3 endpoints! It would make development easier if we could could connect directly to Docker MinIO containers and it would make our PRODUCTION environment more modern if we could connect directly to our PureStorage FlashBlade Object Store (100% compatible self-hosted S3 Object Storage).

vysotskyik commented 8 months ago

Hey, any updates on it?