CloudHostCheck

Validates the value a user typed into the Host field before any connection is attempted.

On Airbyte Cloud (FeatureFlag.AIRBYTE_CLOUD_DEPLOYMENT) two mistakes are common enough to deserve their own message instead of the generic unreachable-host error the driver produces:

  • a loopback or unspecified address (localhost, 127.x.x.x, ::1, 0.0.0.0) without an SSH tunnel, which Airbyte Cloud can never reach;

  • a full URL, credentials or a host:port pair pasted into the field instead of a bare hostname.

Outside Airbyte Cloud the check is a no-op: a self-managed deployment may well run next to its database.

validateHostSyntax runs the second half alone, with a connector-specific message, for a connector whose Host can only ever be a public domain and which offers neither an SSH tunnel nor a Port field (a cloud warehouse such as Snowflake): there the loopback message would send the user to a tunnel option that does not exist.

Call it before the JDBC connection is opened, typically at the start of io.airbyte.cdk.discover.MetadataQuerier.Factory.session: with an unreachable host the connection attempt fails first and io.airbyte.cdk.discover.MetadataQuerier.extraChecks is never reached.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun validate(host: String, sshTunnel: SshTunnelMethodConfiguration?, featureFlags: Set<FeatureFlag>)
Link copied to clipboard
fun validateHostSyntax(host: String, featureFlags: Set<FeatureFlag>, message: String = HOST_SYNTAX_MESSAGE)

The syntax half of validate on its own: no loopback check, and a message of the caller's choosing instead of HOST_SYNTAX_MESSAGE, which names a Port field.