Documentation ¶
Index ¶
- Variables
- func AutocompleteHost(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CertToKeyStore(cert *x509.Certificate, key *rsa.PrivateKey) (ks keystore.KeyStore, pass []byte, err error)
- func CheckIfTokenIsExpired(rawToken string) bool
- func ClientTokenFile(homedir string) string
- func Connect(addr string, tlsNeeded bool, tlsConfig *tls.Config, ...) (net.Conn, error)
- func ConnectWSProxy(proxyUrl string, addr string) (net.Conn, error)
- func DownloadCertificateChain(hostname string) (certChainPath string, err error)
- func EnterDBName(inputDBName, suggestedDBname string) (enteredDBName string, err error)
- func ExecCommand(name string, arg ...string) error
- func FetchCertAndReturnPaths(logger *zap.Logger, hostname string) (crtPath, keyPath, caPath string, err error)
- func FetchResource(token string, name string) (resource models.ClientResource, err error)
- func FetchResources(token string, filteredTypes ...string) (resources models.ClientResources, err error)
- func FindWindowsExecutable(parentDir, contains, suffix string) string
- func GetClientToken(homeDir string) (string, error)
- func GetSocketPort(name string, token string) (socketPort int, err error)
- func IsClientCertValid() (crtPath, keyPath string, valid bool)
- func IsExistingClientTokenValid(homeDir string) (valid bool, token, identity string, err error)
- func Launch(logger *zap.Logger, url string, listener net.Listener) string
- func Login(org string) (token string, claims jwt.MapClaims, err error)
- func MTLSLogin(logger *zap.Logger, hostname string) (string, jwt.MapClaims, error)
- func MTLSTokenFile() string
- func MonWinCh(session *ssh.Session, fd uintptr)
- func OnInterruptDo(action func())
- func OrgIDFromToken() (orgID string)
- func PickHost(inputHost string, socketTypes ...string) (models.ClientResource, error)
- func PickResourceTypes(inputFilter string) (pickedTypes []string, err error)
- func ReadOrgCert(orgID string) (cert *x509.Certificate, key *rsa.PrivateKey, caCert *x509.Certificate, ...)
- func ReadTokenOrAskToLogIn() (token string, err error)
- func StartConnectorAuthListener(hostname string, port int, certificate tls.Certificate, ...) (int, error)
- func TermSize(fd uintptr) []byte
- func ValidateClientToken(token string) (identity string, claims jwt.MapClaims, err error)
- func WriteCertToFile(cert *CertificateResponse, socketDNS string) (crtPath, keyPath, caPath string, err error)
- func WriteKeyStore(ks keystore.KeyStore, filename string, password []byte)
- func Zeroing(buf []byte)
- type CertificateResponse
- type CertificateSigningRequest
- type ResourceInfo
- type SSHSignRequest
- type SSHSignResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProxyHandshakeFailed = errors.New("failed to authenticate against Border0 proxy") ErrConnectorHandshakeFailed = errors.New("failed to authenticate against connector") )
View Source
var ( // ErrResourceNotFound is returned when a fetched resource is not found ErrResourceNotFound = errors.New("resource not found") )
Functions ¶
func AutocompleteHost ¶
func CertToKeyStore ¶
func CertToKeyStore(cert *x509.Certificate, key *rsa.PrivateKey) (ks keystore.KeyStore, pass []byte, err error)
func CheckIfTokenIsExpired ¶
func ClientTokenFile ¶
func EnterDBName ¶
func ExecCommand ¶
func FetchCertAndReturnPaths ¶
func FetchResource ¶
func FetchResource(token string, name string) (resource models.ClientResource, err error)
func FetchResources ¶
func FetchResources(token string, filteredTypes ...string) (resources models.ClientResources, err error)
func FindWindowsExecutable ¶
func GetClientToken ¶
func IsClientCertValid ¶
func MTLSTokenFile ¶
func MTLSTokenFile() string
func MonWinCh ¶
MonWinCh watches for the system to signal a window resize and requests a window-change from the server.
func OnInterruptDo ¶
func OnInterruptDo(action func())
func OrgIDFromToken ¶
func OrgIDFromToken() (orgID string)
func PickHost ¶
func PickHost(inputHost string, socketTypes ...string) (models.ClientResource, error)
func PickResourceTypes ¶
func ReadOrgCert ¶
func ReadOrgCert(orgID string) (cert *x509.Certificate, key *rsa.PrivateKey, caCert *x509.Certificate, crtPath string, keyPath, caPath string, err error)
func ReadTokenOrAskToLogIn ¶
func TermSize ¶
TermSize gets the current window size and returns it in a window-change friendly format.
func ValidateClientToken ¶
func WriteCertToFile ¶
func WriteCertToFile(cert *CertificateResponse, socketDNS string) (crtPath, keyPath, caPath string, err error)
func WriteKeyStore ¶
Types ¶
type CertificateResponse ¶
type CertificateResponse struct { PrivateKey string `json:"client_private_key,omitempty"` Certificate string `json:"client_certificate,omitempty"` CaCertificate string `json:"ca_certificate,omitempty"` }
func GetCert ¶
func GetCert(token string, email string) *CertificateResponse
type CertificateSigningRequest ¶
type CertificateSigningRequest struct {
Csr string `json:"csr"`
}
type ResourceInfo ¶
type ResourceInfo struct { Certficate *x509.Certificate PrivateKey *rsa.PrivateKey CaCertificate *x509.Certificate CertificatePath string PrivateKeyPath string CaCertificatePath string Port int ConnectorAuthenticationEnabled bool EndToEndEncryptionEnabled bool }
func GetResourceInfo ¶
func GetResourceInfo(logger *zap.Logger, hostname string) (info ResourceInfo, err error)
func (*ResourceInfo) SetupTLSCertificate ¶
func (info *ResourceInfo) SetupTLSCertificate() tls.Certificate
type SSHSignRequest ¶
type SSHSignRequest struct {
SSHPublicKey string `json:"ssh_public_key"`
}
type SSHSignResponse ¶
type SSHSignResponse struct {
SSHCertSigned string `json:"signed_ssh_cert"`
}
func GenSSHKey ¶
func GenSSHKey(token, orgID, hostname string) (*SSHSignResponse, error)
Click to show internal directories.
Click to hide internal directories.