client

package
v0.0.0-...-4ceb61e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutocompleteHost

func AutocompleteHost(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func CertToKeyStore

func CertToKeyStore(cert *x509.Certificate, key *rsa.PrivateKey) (ks keystore.KeyStore, pass []byte, err error)

func ClientTokenFile

func ClientTokenFile(homedir string) string

func EnterDBName

func EnterDBName(inputDBName, suggestedDBname string) (enteredDBName string, err error)

func ExecCommand

func ExecCommand(name string, arg ...string) error

func FetchCertAndReturnPaths

func FetchCertAndReturnPaths(hostname string) (crtPath, keyPath string, socketPort int, err error)

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 GetClientToken

func GetClientToken(homeDir string) (string, error)

func GetOrgCert

func GetOrgCert(hostname string) (*x509.Certificate, *rsa.PrivateKey, string, string, int, error)

func GetSocketPort

func GetSocketPort(name string, token string) (socketPort int, err error)

func IsClientCertValid

func IsClientCertValid() (crtPath, keyPath string, valid bool)

func IsExistingClientTokenValid

func IsExistingClientTokenValid(homeDir string) (valid bool, token, email string, err error)

func Launch

func Launch(url string, listener net.Listener) string

func Login

func Login(orgID string) (token string, claims jwt.MapClaims, err error)

func MTLSLogin

func MTLSLogin(hostname string) (string, jwt.MapClaims, error)

func MTLSTokenFile

func MTLSTokenFile() string

func MonWinCh

func MonWinCh(session *ssh.Session, fd uintptr)

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 PickResourceTypes(inputFilter string) (pickedTypes []string, err error)

func ReadOrgCert

func ReadOrgCert(orgID string) (cert *x509.Certificate, key *rsa.PrivateKey, crtPath string, keyPath string, err error)

func ReadTokenOrAskToLogIn

func ReadTokenOrAskToLogIn() (token string, err error)

func TermSize

func TermSize(fd uintptr) []byte

TermSize gets the current window size and returns it in a window-change friendly format.

func ValidateClientToken

func ValidateClientToken(token string) (email string, claims jwt.MapClaims, err error)

func WriteCertToFile

func WriteCertToFile(cert *CertificateResponse, socketDNS string) (crtPath, keyPath string, err error)

func WriteKeyStore

func WriteKeyStore(ks keystore.KeyStore, filename string, password []byte)

func Zeroing

func Zeroing(buf []byte)

Types

type CertificateResponse

type CertificateResponse struct {
	PrivateKey  string `json:"client_private_key,omitempty"`
	Certificate string `json:"client_certificate,omitempty"`
}

func GetCert

func GetCert(token string, email string) *CertificateResponse

type CertificateSigningRequest

type CertificateSigningRequest struct {
	Csr string `json:"csr"`
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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