common

package
v1.2.3-fred.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

DatabaseProtocols is the list of the database protocols supported.

View Source
var ProtocolsWithPingSupport = DatabaseProtocols

ProtocolsWithPingSupport is the list of protocols that Ping connection is supported. For now, only database protocols are supported.

SupportedProtocols is the list of supported ALPN protocols.

Functions

func HasPingSupport

func HasPingSupport(protocol Protocol) bool

HasPingSupport checks if the provided protocol supports Ping protocol.

func IsDBTLSProtocol

func IsDBTLSProtocol(protocol Protocol) bool

IsDBTLSProtocol returns if DB protocol has supported native TLS protocol. where connection can be TLS terminated on ALPN proxy side. For protocol like MySQL or Postgres where custom TLS implementation is used the incoming connection needs to be forwarded to proxy database service where custom TLS handler is invoked to terminated DB connection.

func IsPingProtocol

func IsPingProtocol(protocol Protocol) bool

IsPingProtocol checks if the provided protocol is suffixed with Ping.

func ProtocolsToString

func ProtocolsToString(protocols []Protocol) []string

ProtocolsToString converts the list of Protocols to the list of strings.

Types

type Protocol

type Protocol string

Protocol is the TLS ALPN protocol type.

const (
	// ProtocolPostgres is TLS ALPN protocol value used to indicate Postgres protocol.
	ProtocolPostgres Protocol = "teleport-postgres"

	// ProtocolMySQL is TLS ALPN protocol value used to indicate MySQL protocol.
	ProtocolMySQL Protocol = "teleport-mysql"

	// ProtocolMongoDB is TLS ALPN protocol value used to indicate Mongo protocol.
	ProtocolMongoDB Protocol = "teleport-mongodb"

	// ProtocolRedisDB is TLS ALPN protocol value used to indicate Redis protocol.
	ProtocolRedisDB Protocol = "teleport-redis"

	// ProtocolSQLServer is the TLS ALPN protocol value used to indicate SQL Server protocol.
	ProtocolSQLServer Protocol = "teleport-sqlserver"

	// ProtocolSnowflake is TLS ALPN protocol value used to indicate Snowflake protocol.
	ProtocolSnowflake Protocol = "teleport-snowflake"

	// ProtocolCassandra is the TLS ALPN protocol value used to indicate Cassandra protocol.
	ProtocolCassandra Protocol = "teleport-cassandra"

	// ProtocolElasticsearch is TLS ALPN protocol value used to indicate Elasticsearch protocol.
	ProtocolElasticsearch Protocol = "teleport-elasticsearch"

	// ProtocolProxySSH is TLS ALPN protocol value used to indicate Proxy SSH protocol.
	ProtocolProxySSH Protocol = "teleport-proxy-ssh"

	// ProtocolReverseTunnel is TLS ALPN protocol value used to indicate Proxy reversetunnel protocol.
	ProtocolReverseTunnel Protocol = "teleport-reversetunnel"

	// ProtocolReverseTunnelV2 is TLS ALPN protocol value used to indicate reversetunnel clients
	// that are aware of proxy peering. This is only used on the client side to allow intermediate
	// load balancers to make decisions based on the ALPN header. ProtocolReverseTunnel should still
	// be included in the list of ALPN header for the proxy server to handle the connection properly.
	ProtocolReverseTunnelV2 Protocol = "teleport-reversetunnelv2"

	// ProtocolHTTP is TLS ALPN protocol value used to indicate HTTP2 protocol
	// ProtocolHTTP is TLS ALPN protocol value used to indicate HTTP 1.1 protocol
	ProtocolHTTP Protocol = "http/1.1"

	// ProtocolHTTP2 is TLS ALPN protocol value used to indicate HTTP2 protocol.
	ProtocolHTTP2 Protocol = "h2"

	// ProtocolDefault is default TLS ALPN value.
	ProtocolDefault Protocol = ""

	// ProtocolAuth allows dialing local/remote auth service based on SNI cluster name value.
	ProtocolAuth Protocol = "teleport-auth@"

	// ProtocolProxyGRPC is TLS ALPN protocol value used to indicate gRPC
	// traffic intended for the Teleport proxy.
	ProtocolProxyGRPC Protocol = "teleport-proxy-grpc"

	// ProtocolMySQLWithVerPrefix is TLS ALPN prefix used by tsh to carry
	// MySQL server version.
	ProtocolMySQLWithVerPrefix = Protocol(string(ProtocolMySQL) + "-")

	// ProtocolTCP is TLS ALPN protocol value used to indicate plain TCP connection.
	ProtocolTCP Protocol = "teleport-tcp"

	// ProtocolPingSuffix is TLS ALPN suffix used to wrap connections with
	// Ping.
	ProtocolPingSuffix Protocol = "-ping"
)

func ProtocolWithPing

func ProtocolWithPing(protocol Protocol) Protocol

ProtocolWithPing receives a protocol and returns it with the Ping protocol suffix.

func ProtocolsWithPing

func ProtocolsWithPing(protocols ...Protocol) []Protocol

ProtocolsWithPing receives a list a protocols and returns a list of them with the Ping protocol suffix.

func ToALPNProtocol

func ToALPNProtocol(dbProtocol string) (Protocol, error)

ToALPNProtocol maps provided database protocol to ALPN protocol.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL