keypaths

package
v0.0.0-...-5e097c4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Overview

Package keypaths defines several keypaths used by multiple Teleport services.

Index

Constants

View Source
const (

	// FileExtTLSCertLegacy is the legacy suffix/extension of a file where a TLS cert is stored.
	FileExtTLSCertLegacy = "-x509.pem"
	// FileExtTLSCert is the suffix/extension of a file where a TLS cert is stored.
	FileExtTLSCert = ".crt"
	// FileExtKubeCred is the suffix/extension of a file where a kubernetes
	// credential is stored (TLS key and cert combined in a single file).
	FileExtKubeCred = ".cred"
)

keypath constants aren't exported in order to force helper function usage and maintain consistency.

Variables

This section is empty.

Functions

func AppCertPath

func AppCertPath(baseDir, proxy, username, cluster, appname string) string

AppCertPath returns the path to the user's TLS certificate for the given proxy, cluster, and app.

<baseDir>/keys/<proxy>/<username>-app/<cluster>/<appname>.crt

func AppCredentialDir

func AppCredentialDir(baseDir, proxy, username, cluster string) string

AppCredentialDir returns the path to the user's app credential directory for the given proxy and cluster.

<baseDir>/keys/<proxy>/<username>-app/<cluster>

func AppDir

func AppDir(baseDir, proxy, username string) string

AppDir returns the path to the user's app directory for the given proxy.

<baseDir>/keys/<proxy>/<username>-app

func AppKeyPath

func AppKeyPath(baseDir, proxy, username, cluster, appname string) string

AppKeyPath returns the path to the user's private key for the given proxy, cluster, and app.

<baseDir>/keys/<proxy>/<username>-app/<cluster>/<appname>.key

func AppLocalCAPath

func AppLocalCAPath(baseDir, proxy, username, cluster, appname string) string

AppLocalCAPath returns the path to a self-signed localhost CA for the given proxy, cluster, and app.

<baseDir>/keys/<proxy>/<username>-app/<cluster>/<appname>-localca.pem

func CAsDir

func CAsDir(baseDir, proxy string) string

CAsDir returns path to trusted clusters certificates directory.

<baseDir>/keys/<proxy>/cas

func CurrentProfileFilePath

func CurrentProfileFilePath(baseDir string) string

CurrentProfile returns the path to the current profile file.

<baseDir>/current-profile

func DatabaseCertPath

func DatabaseCertPath(baseDir, proxy, username, cluster, dbname string) string

DatabaseCertPath returns the path to the user's TLS certificate for the given proxy, cluster, and database.

<baseDir>/keys/<proxy>/<username>-db/<cluster>/<dbname>.crt

func DatabaseCredentialDir

func DatabaseCredentialDir(baseDir, proxy, username, cluster string) string

DatabaseCredentialDir returns the path to the user's database cert directory for the given proxy and cluster.

<baseDir>/keys/<proxy>/<username>-db/<cluster>

func DatabaseDir

func DatabaseDir(baseDir, proxy, username string) string

DatabaseDir returns the path to the user's database directory for the given proxy.

<baseDir>/keys/<proxy>/<username>-db

func DatabaseKeyPath

func DatabaseKeyPath(baseDir, proxy, username, cluster, dbname string) string

DatabaseKeyPath returns the path to the user's TLS private key for the given proxy, cluster, and database.

<baseDir>/keys/<proxy>/<username>-db/<cluster>/<dbname>.key

func DatabaseOracleWalletDirectory

func DatabaseOracleWalletDirectory(baseDir, proxy, username, cluster, dbname string) string

DatabaseOracleWalletDirectory returns the path to the user's Oracle Wallet configuration directory. for the given proxy, cluster and database. <baseDir>/keys/<proxy>/<username>-db/<cluster>/dbname-wallet/

func IdentitySSHCertPath

func IdentitySSHCertPath(path string) string

IdentitySSHCertPath returns the path to the identity file's SSH certificate.

<identity-file-dir>/<path>-cert.pub

func IsProfileKubeConfigPath

func IsProfileKubeConfigPath(path string) (bool, error)

IsProfileKubeConfigPath makes a best effort attempt to check if the given path is a profile specific kubeconfig path generated by this package.

func KeyDir

func KeyDir(baseDir string) string

KeyDir returns the path to the keys directory.

<baseDir>/keys

func KnownHostsPath

func KnownHostsPath(baseDir string) string

KnownHostsPath returns the path to the known hosts file.

<baseDir>/known_hosts

func KubeConfigPath

func KubeConfigPath(baseDir, proxy, username, cluster, kubename string) string

KubeConfigPath returns the path to the user's standalone kubeconfig for the given proxy, cluster, and kube cluster.

<baseDir>/keys/<proxy>/<username>-kube/<cluster>/<kubename>-kubeconfig

func KubeCredLockfilePath

func KubeCredLockfilePath(baseDir, proxy string) string

KubeCredLockfilePath returns the kube credentials lock file for given proxy

<baseDir>/keys/<proxy>/kube_credentials.lock

func KubeCredPath

func KubeCredPath(baseDir, proxy, username, cluster, kubename string) string

KubeCredPath returns the path to the user's TLS credential for the given proxy, cluster, and kube cluster.

<baseDir>/keys/<proxy>/<username>-kube/<cluster>/<kubename>.cred

func KubeCredentialDir

func KubeCredentialDir(baseDir, proxy, username, cluster string) string

KubeCredentialDir returns the path to the user's kube credential directory for the given proxy and cluster.

<baseDir>/keys/<proxy>/<username>-kube/<cluster>

func KubeDir

func KubeDir(baseDir, proxy, username string) string

KubeDir returns the path to the user's kube directory for the given proxy.

<baseDir>/keys/<proxy>/<username>-kube

func PPKFilePath

func PPKFilePath(baseDir, proxy, username string) string

PPKFilePath returns the path to the user's PuTTY PPK-formatted keypair for the given proxy and cluster.

<baseDir>/keys/<proxy>/<username>.ppk

func ProfileFilePath

func ProfileFilePath(baseDir, profileName string) string

ProfileFilePath returns the path to the profile file for the given profile.

<baseDir>/<profileName>.yaml

func ProxyKeyDir

func ProxyKeyDir(baseDir, proxy string) string

ProxyKeyDir returns the path to the proxy's keys directory.

<baseDir>/keys/<proxy>

func PublicKeyPath

func PublicKeyPath(baseDir, proxy, username string) string

PublicKeyPath returns the path to the users's public key for the given proxy.

<baseDir>/keys/<proxy>/<username>.pub

func SSHCertPath

func SSHCertPath(baseDir, proxy, username, cluster string) string

SSHCertPath returns the path to the users's SSH certificate for the given proxy and cluster.

<baseDir>/keys/<proxy>/<username>-ssh/<cluster>-cert.pub

func SSHDir

func SSHDir(baseDir, proxy, username string) string

SSHDir returns the path to the user's SSH directory for the given proxy.

<baseDir>/keys/<proxy>/<username>-ssh

func TLSCAsPath

func TLSCAsPath(baseDir, proxy string) string

TLSCAsPath returns the path to the users's TLS CA's certificates for the given proxy. <baseDir>/keys/<proxy>/certs.pem DELETE IN 10.0. Deprecated

func TLSCAsPathCluster

func TLSCAsPathCluster(baseDir, proxy, cluster string) string

TLSCAsPathCluster returns the path to the specified cluster's CA directory.

<baseDir>/keys/<proxy>/cas/<cluster>.pem

func TLSCertPath

func TLSCertPath(baseDir, proxy, username string) string

TLSCertPath returns the path to the users's TLS certificate for the given proxy.

<baseDir>/keys/<proxy>/<username>.crt

func TLSCertPathLegacy

func TLSCertPathLegacy(baseDir, proxy, username string) string

TLSCertPathLegacy returns the legacy path used in Teleport 16.x and older to the users's TLS certificate for the given proxy.

<baseDir>/keys/<proxy>/<username>-x509.pem

func TrimKeyPathSuffix

func TrimKeyPathSuffix(path string) string

TrimKeyPathSuffix returns the given path with any key suffix/extension trimmed off.

func UserSSHKeyPath

func UserSSHKeyPath(baseDir, proxy, username string) string

UserSSHKeyPath returns the path to the users's SSH private key for the given proxy.

<baseDir>/keys/<proxy>/<username>.

func UserTLSKeyPath

func UserTLSKeyPath(baseDir, proxy, username string) string

UserTLSKeyPath returns the path to the users's TLS private key for the given proxy.

<baseDir>/keys/<proxy>/<username>.key

Types

This section is empty.

Jump to

Keyboard shortcuts

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