Skip to content

Commit

Permalink
remove destination-postgres-strictencrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-airbyte committed Jul 17, 2024
1 parent ccc851d commit eb053bf
Show file tree
Hide file tree
Showing 49 changed files with 149 additions and 337 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
package io.airbyte.cdk.integrations

import io.airbyte.cdk.integrations.base.Integration
import io.airbyte.commons.features.EnvVariableFeatureFlags
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.json.Jsons
import io.airbyte.commons.resources.MoreResources
import io.airbyte.protocol.models.v0.ConnectorSpecification

abstract class BaseConnector : Integration {
override var featureFlags: FeatureFlags = EnvVariableFeatureFlags()
/**
* By convention the spec is stored as a resource for java connectors. That resource is called
* spec.json.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package io.airbyte.cdk.integrations.base

import com.fasterxml.jackson.databind.JsonNode
import io.airbyte.cdk.integrations.base.adaptive.AdaptiveSourceRunner
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus
import io.airbyte.protocol.models.v0.ConnectorSpecification

Expand All @@ -29,4 +31,12 @@ interface Integration {
* - any exception.
*/
@Throws(Exception::class) fun check(config: JsonNode): AirbyteConnectionStatus?

abstract var featureFlags: FeatureFlags
fun isCloudDeployment(): Boolean {
return AdaptiveSourceRunner.CLOUD_MODE.equals(
featureFlags.deploymentMode(),
ignoreCase = true
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.JsonNode
import io.airbyte.cdk.integrations.base.AirbyteMessageConsumer
import io.airbyte.cdk.integrations.base.Destination
import io.airbyte.cdk.integrations.base.SerializedAirbyteMessageConsumer
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus
import io.airbyte.protocol.models.v0.AirbyteMessage
import io.airbyte.protocol.models.v0.ConfiguredAirbyteCatalog
Expand All @@ -15,6 +16,7 @@ import java.util.function.Consumer

abstract class SpecModifyingDestination(private val destination: Destination) : Destination {
override val isV2Destination: Boolean = destination.isV2Destination
override var featureFlags: FeatureFlags = destination.featureFlags

@Throws(Exception::class)
abstract fun modifySpec(originalSpec: ConnectorSpecification): ConnectorSpecification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package io.airbyte.cdk.integrations.base.spec_modification

import com.fasterxml.jackson.databind.JsonNode
import io.airbyte.cdk.integrations.base.Source
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.util.AutoCloseableIterator
import io.airbyte.protocol.models.v0.*

Expand All @@ -14,6 +15,7 @@ import io.airbyte.protocol.models.v0.*
* want to allow users to send data unencrypted.
*/
abstract class SpecModifyingSource(private val source: Source) : Source {
override var featureFlags: FeatureFlags = source.featureFlags
@Throws(Exception::class)
abstract fun modifySpec(originalSpec: ConnectorSpecification): ConnectorSpecification

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import io.airbyte.cdk.integrations.base.AirbyteTraceMessageUtility
import io.airbyte.cdk.integrations.base.Destination
import io.airbyte.cdk.integrations.base.SerializedAirbyteMessageConsumer
import io.airbyte.commons.concurrency.VoidCallable
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.json.Jsons
import io.airbyte.commons.resources.MoreResources
import io.airbyte.protocol.models.v0.AirbyteConnectionStatus
Expand All @@ -25,24 +26,27 @@ private val LOGGER = KotlinLogging.logger {}
* Decorates a Destination with an SSH Tunnel using the standard configuration that Airbyte uses for
* configuring SSH.
*/
class SshWrappedDestination : Destination {
open class SshWrappedDestination : Destination {
private val delegate: Destination
private val hostKey: List<String>?
private val portKey: List<String>?
private val endPointKey: String?
final override var featureFlags: FeatureFlags

constructor(delegate: Destination, hostKey: List<String>, portKey: List<String>) {
this.delegate = delegate
this.hostKey = hostKey
this.portKey = portKey
this.endPointKey = null
this.featureFlags = delegate.featureFlags
}

constructor(delegate: Destination, endPointKey: String) {
this.delegate = delegate
this.endPointKey = endPointKey
this.portKey = null
this.hostKey = null
this.featureFlags = delegate.featureFlags
}

@Throws(Exception::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package io.airbyte.cdk.integrations.base.ssh
import com.fasterxml.jackson.databind.JsonNode
import io.airbyte.cdk.integrations.base.AirbyteTraceMessageUtility
import io.airbyte.cdk.integrations.base.Source
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.util.AutoCloseableIterator
import io.airbyte.commons.util.AutoCloseableIterators
import io.airbyte.protocol.models.v0.*
Expand All @@ -19,19 +20,22 @@ class SshWrappedSource : Source {
private val hostKey: List<String>
private val portKey: List<String>
private val sshGroup: Optional<String>
final override var featureFlags: FeatureFlags

constructor(delegate: Source, hostKey: List<String>, portKey: List<String>) {
this.delegate = delegate
this.hostKey = hostKey
this.portKey = portKey
this.sshGroup = Optional.empty()
this.featureFlags = delegate.featureFlags
}

constructor(delegate: Source, hostKey: List<String>, portKey: List<String>, sshGroup: String) {
this.delegate = delegate
this.hostKey = hostKey
this.portKey = portKey
this.sshGroup = Optional.of(sshGroup)
this.featureFlags = delegate.featureFlags
}

@Throws(Exception::class)
Expand All @@ -53,6 +57,10 @@ class SshWrappedSource : Source {
}
}

override fun isCloudDeployment(): Boolean {
return delegate.isCloudDeployment()
}

@Throws(Exception::class)
override fun discover(config: JsonNode): AirbyteCatalog {
return SshTunnel.sshWrap(config, hostKey, portKey) { c: JsonNode -> delegate.discover(c) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import io.airbyte.cdk.integrations.standardtest.destination.argproviders.util.Ar
import io.airbyte.cdk.integrations.standardtest.destination.comparator.BasicTestDataComparator
import io.airbyte.cdk.integrations.standardtest.destination.comparator.TestDataComparator
import io.airbyte.commons.features.EnvVariableFeatureFlags
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.jackson.MoreMappers
import io.airbyte.commons.json.Jsons
import io.airbyte.commons.lang.Exceptions
Expand Down Expand Up @@ -87,6 +88,8 @@ abstract class DestinationAcceptanceTest {
protected var localRoot: Path? = null
open protected var _testDataComparator: TestDataComparator = getTestDataComparator()

protected open var featureFlags: FeatureFlags = EnvVariableFeatureFlags()

protected open fun getTestDataComparator(): TestDataComparator {
return BasicTestDataComparator { @Suppress("deprecated") this.resolveIdentifier(it) }
}
Expand Down Expand Up @@ -1499,7 +1502,7 @@ abstract class DestinationAcceptanceTest {
null,
null,
false,
EnvVariableFeatureFlags()
featureFlags
)
)
.run(JobGetSpecConfig().withDockerImage(imageName), jobRoot)
Expand All @@ -1519,7 +1522,7 @@ abstract class DestinationAcceptanceTest {
null,
null,
false,
EnvVariableFeatureFlags()
featureFlags
),
mConnectorConfigUpdater
)
Expand All @@ -1541,7 +1544,7 @@ abstract class DestinationAcceptanceTest {
null,
null,
false,
EnvVariableFeatureFlags()
featureFlags
),
mConnectorConfigUpdater
)
Expand Down Expand Up @@ -1569,7 +1572,7 @@ abstract class DestinationAcceptanceTest {
null,
null,
false,
EnvVariableFeatureFlags()
featureFlags
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import io.airbyte.cdk.integrations.util.ApmTraceUtils.addExceptionToTrace
import io.airbyte.cdk.integrations.util.ConnectorExceptionUtil
import io.airbyte.commons.exceptions.ConfigErrorException
import io.airbyte.commons.exceptions.ConnectionErrorException
import io.airbyte.commons.features.EnvVariableFeatureFlags
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.functional.CheckedConsumer
import io.airbyte.commons.lang.Exceptions
import io.airbyte.commons.stream.AirbyteStreamUtils
Expand All @@ -49,8 +47,6 @@ private val LOGGER = KotlinLogging.logger {}
abstract class AbstractDbSource<DataType, Database : AbstractDatabase?>
protected constructor(driverClassName: String) :
JdbcConnector(driverClassName), Source, AutoCloseable {
// TODO: Remove when the flag is not use anymore
var featureFlags: FeatureFlags = EnvVariableFeatureFlags()

@Trace(operationName = CHECK_TRACE_OPERATION_NAME)
@Throws(Exception::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ObjectNode
import com.google.common.collect.ImmutableMap
import io.airbyte.commons.features.EnvVariableFeatureFlags
import io.airbyte.commons.features.FeatureFlags
import io.airbyte.commons.json.Jsons
import io.airbyte.commons.lang.Exceptions
import io.airbyte.commons.resources.MoreResources
Expand Down Expand Up @@ -65,6 +66,7 @@ abstract class BaseTypingDedupingTest {
protected var streamNamespace: String? = null
protected var streamName: String = "dummy"
private var streamsToTearDown: MutableList<AirbyteStreamNameNamespacePair>? = null
protected open var featureFlags: FeatureFlags = EnvVariableFeatureFlags()

protected abstract val imageName: String
/** @return the docker image to run, e.g. `"airbyte/destination-bigquery:dev"`. */
Expand Down Expand Up @@ -1206,7 +1208,7 @@ abstract class BaseTypingDedupingTest {
null,
null,
false,
EnvVariableFeatureFlags()
featureFlags
)
)

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit eb053bf

Please sign in to comment.