diff --git a/airbyte-integrations/connectors/destination-s3/metadata.yaml b/airbyte-integrations/connectors/destination-s3/metadata.yaml index e3af190b6de2..f78eee38171d 100644 --- a/airbyte-integrations/connectors/destination-s3/metadata.yaml +++ b/airbyte-integrations/connectors/destination-s3/metadata.yaml @@ -2,7 +2,7 @@ data: connectorSubtype: file connectorType: destination definitionId: 4816b78f-1489-44c1-9060-4b19d5fa9362 - dockerImageTag: 0.6.2 + dockerImageTag: 0.6.3 dockerRepository: airbyte/destination-s3 githubIssueLabel: destination-s3 icon: s3.svg diff --git a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3Destination.java b/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3Destination.java deleted file mode 100644 index 4d5e810e899a..000000000000 --- a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3Destination.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2023 Airbyte, Inc., all rights reserved. - */ - -package io.airbyte.integrations.destination.s3; - -import com.google.common.annotations.VisibleForTesting; -import io.airbyte.cdk.integrations.base.IntegrationRunner; -import io.airbyte.cdk.integrations.destination.s3.BaseS3Destination; -import io.airbyte.cdk.integrations.destination.s3.S3DestinationConfigFactory; -import io.airbyte.cdk.integrations.destination.s3.StorageProvider; -import java.util.Map; - -public class S3Destination extends BaseS3Destination { - - public S3Destination() {} - - @VisibleForTesting - protected S3Destination(final S3DestinationConfigFactory s3DestinationConfigFactory, Map env) { - super(s3DestinationConfigFactory, env); - } - - public static void main(final String[] args) throws Exception { - new IntegrationRunner(new S3Destination()).run(args); - } - - @Override - public StorageProvider storageProvider() { - return StorageProvider.AWS_S3; - } - -} diff --git a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationRunner.java b/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationRunner.java deleted file mode 100644 index 72734a3e18a3..000000000000 --- a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationRunner.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2023 Airbyte, Inc., all rights reserved. - */ - -package io.airbyte.integrations.destination.s3; - -import io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner; - -public class S3DestinationRunner { - - public static void main(final String[] args) throws Exception { - AdaptiveDestinationRunner.baseOnEnv() - .withOssDestination(S3Destination::new) - .withCloudDestination(S3DestinationStrictEncrypt::new) - .run(args); - } - -} diff --git a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.java b/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.java deleted file mode 100644 index 6b8871069f34..000000000000 --- a/airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2023 Airbyte, Inc., all rights reserved. - */ - -package io.airbyte.integrations.destination.s3; - -import com.fasterxml.jackson.databind.JsonNode; -import com.google.common.annotations.VisibleForTesting; -import io.airbyte.cdk.integrations.destination.s3.S3BaseChecks; -import io.airbyte.cdk.integrations.destination.s3.S3DestinationConfig; -import io.airbyte.cdk.integrations.destination.s3.S3DestinationConfigFactory; -import io.airbyte.protocol.models.v0.AirbyteConnectionStatus; -import io.airbyte.protocol.models.v0.AirbyteConnectionStatus.Status; -import java.util.Map; - -public class S3DestinationStrictEncrypt extends S3Destination { - - public S3DestinationStrictEncrypt() { - super(); - } - - @VisibleForTesting - protected S3DestinationStrictEncrypt(final S3DestinationConfigFactory configFactory, Map environment) { - super(configFactory, environment); - } - - @Override - public AirbyteConnectionStatus check(final JsonNode config) { - final S3DestinationConfig destinationConfig = - this.getConfigFactory().getS3DestinationConfig(config, super.storageProvider(), super.getEnvironment()); - - // Fails early to avoid extraneous validations checks if custom endpoint is not secure - if (!S3BaseChecks.testCustomEndpointSecured(destinationConfig.getEndpoint())) { - return new AirbyteConnectionStatus() - .withStatus(Status.FAILED) - .withMessage("Custom endpoint does not use HTTPS"); - } - return super.check(config); - } - -} diff --git a/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3Destination.kt b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3Destination.kt new file mode 100644 index 000000000000..8c871eaa53d5 --- /dev/null +++ b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3Destination.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Airbyte, Inc., all rights reserved. + */ +package io.airbyte.integrations.destination.s3 + +import com.google.common.annotations.VisibleForTesting +import io.airbyte.cdk.integrations.base.IntegrationRunner +import io.airbyte.cdk.integrations.destination.s3.BaseS3Destination +import io.airbyte.cdk.integrations.destination.s3.S3DestinationConfigFactory +import io.airbyte.cdk.integrations.destination.s3.StorageProvider + +open class S3Destination : BaseS3Destination { + constructor() + + @VisibleForTesting + constructor( + s3DestinationConfigFactory: S3DestinationConfigFactory, + env: Map + ) : super(s3DestinationConfigFactory, env) + + override fun storageProvider(): StorageProvider { + return StorageProvider.AWS_S3 + } + + companion object { + @Throws(Exception::class) + @JvmStatic + fun main(args: Array) { + IntegrationRunner(S3Destination()).run(args) + } + } +} diff --git a/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationRunner.kt b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationRunner.kt new file mode 100644 index 000000000000..b0f20c5cc1f9 --- /dev/null +++ b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationRunner.kt @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Airbyte, Inc., all rights reserved. + */ +package io.airbyte.integrations.destination.s3 + +import io.airbyte.cdk.integrations.base.adaptive.AdaptiveDestinationRunner.baseOnEnv + +object S3DestinationRunner { + @Throws(Exception::class) + @JvmStatic + fun main(args: Array) { + baseOnEnv() + .withOssDestination { S3Destination() } + .withCloudDestination { S3DestinationStrictEncrypt() } + .run(args) + } +} diff --git a/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.kt b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.kt new file mode 100644 index 000000000000..9798ccd24349 --- /dev/null +++ b/airbyte-integrations/connectors/destination-s3/src/main/kotlin/io/airbyte/integrations/destination/s3/S3DestinationStrictEncrypt.kt @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2023 Airbyte, Inc., all rights reserved. + */ +package io.airbyte.integrations.destination.s3 + +import com.fasterxml.jackson.databind.JsonNode +import com.google.common.annotations.VisibleForTesting +import io.airbyte.cdk.integrations.destination.s3.S3BaseChecks.testCustomEndpointSecured +import io.airbyte.cdk.integrations.destination.s3.S3DestinationConfigFactory +import io.airbyte.protocol.models.v0.AirbyteConnectionStatus + +class S3DestinationStrictEncrypt : S3Destination { + constructor() : super() + + @VisibleForTesting + constructor( + configFactory: S3DestinationConfigFactory, + environment: Map + ) : super(configFactory, environment) + + override fun check(config: JsonNode): AirbyteConnectionStatus? { + val destinationConfig = + configFactory.getS3DestinationConfig(config, super.storageProvider(), super.environment) + + // Fails early to avoid extraneous validations checks if custom endpoint is not secure + if (!testCustomEndpointSecured(destinationConfig.endpoint)) { + return AirbyteConnectionStatus() + .withStatus(AirbyteConnectionStatus.Status.FAILED) + .withMessage("Custom endpoint does not use HTTPS") + } + return super.check(config) + } +} diff --git a/docs/integrations/destinations/s3.md b/docs/integrations/destinations/s3.md index 884f41ad9f36..891a2b0260d6 100644 --- a/docs/integrations/destinations/s3.md +++ b/docs/integrations/destinations/s3.md @@ -514,6 +514,7 @@ To see connector limitations, or troubleshoot your S3 connector, see more [in ou | Version | Date | Pull Request | Subject | | :------ | :--------- | :--------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- | +| 0.6.3 | 2024-04-15 | [38204](https://github.com/airbytehq/airbyte/pull/38204) | convert all production code to kotlin | | 0.6.2 | 2024-04-15 | [38204](https://github.com/airbytehq/airbyte/pull/38204) | add assume role auth | | 0.6.1 | 2024-04-08 | [37546](https://github.com/airbytehq/airbyte/pull/37546) | Adapt to CDK 0.30.8; | | 0.6.0 | 2024-04-08 | [36869](https://github.com/airbytehq/airbyte/pull/36869) | Adapt to CDK 0.29.8; Kotlin converted code. |