Documentation ¶
Overview ¶
Package db contains methods for working with database connection profiles that combine connection parameters for a particular database.
For Postgres it's the connection service file:
https://www.postgresql.org/docs/current/libpq-pgservice.html
For MySQL it's the option file:
https://dev.mysql.com/doc/refman/8.0/en/option-files.html
Index ¶
- func Add(ctx context.Context, tc *client.TeleportClient, db tlsca.RouteToDatabase, ...) error
- func Delete(tc *client.TeleportClient, db tlsca.RouteToDatabase) error
- func Env(tc *client.TeleportClient, db tlsca.RouteToDatabase) (map[string]string, error)
- func GenerateDatabaseCertificates(ctx context.Context, req GenerateDatabaseCertificatesRequest) ([]string, error)
- func IsSupported(db tlsca.RouteToDatabase) bool
- func New(tc *client.TeleportClient, db tlsca.RouteToDatabase, ...) *profile.ConnectProfile
- type GenerateDatabaseCertificatesRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(ctx context.Context, tc *client.TeleportClient, db tlsca.RouteToDatabase, clientProfile client.ProfileStatus) error
Add updates database connection profile file.
func Delete ¶
func Delete(tc *client.TeleportClient, db tlsca.RouteToDatabase) error
Delete removes the specified database connection profile.
func Env ¶
func Env(tc *client.TeleportClient, db tlsca.RouteToDatabase) (map[string]string, error)
Env returns environment variables for the specified database profile.
func GenerateDatabaseCertificates ¶
func GenerateDatabaseCertificates(ctx context.Context, req GenerateDatabaseCertificatesRequest) ([]string, error)
GenerateDatabaseCertificates to be used by databases to set up mTLS authentication
func IsSupported ¶
func IsSupported(db tlsca.RouteToDatabase) bool
IsSupported checks if provided database is supported.
func New ¶
func New(tc *client.TeleportClient, db tlsca.RouteToDatabase, clientProfile client.ProfileStatus, rootCluster string, host string, port int) *profile.ConnectProfile
New makes a new database connection profile.
Types ¶
type GenerateDatabaseCertificatesRequest ¶
type GenerateDatabaseCertificatesRequest struct { ClusterAPI auth.ClientI Principals []string OutputFormat identityfile.Format OutputCanOverwrite bool OutputLocation string IdentityFileWriter identityfile.ConfigWriter TTL time.Duration Key *client.Key // JKSKeyStore is used to generate JKS keystore used for cassandra format. JKSPassword string }
GenerateDatabaseCertificatesRequest contains the required fields used to generate database certificates Those certificates will be used by databases to set up mTLS authentication against Teleport