util

package
v0.0.0-...-575b356 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailPretty

func FailPretty(format string, args ...any)

FailPretty prints an error message

func GetAwsConfig

func GetAwsConfig(
	ctx context.Context,
	awsRegion string,
	creds *common.AwsCredentials,
) (*aws.Config, error)

GetAwsConfig builds an aws.Config given some options.

func GetEndToEndEncryptionCertificate

func GetEndToEndEncryptionCertificate(orgID, connectorID string) (*tls.Certificate, error)

GetEndToEndEncryptionCertificate returns the org-wide-ca-signed mTLS certificate for a given org or connector.

func GetFormattedHostname

func GetFormattedHostname() (string, error)

GetFormattedHostname gets a hostname with no special characters.

func GetSocketTLSCertificate

func GetSocketTLSCertificate(orgID, socketID string) (*tls.Certificate, error)

GetSocketTLSCertificate returns the org-wide-ca-signed TLS certificate for a given socket.

func GetUserHomeDir

func GetUserHomeDir() (string, error)

GetUserHomeDir returns the home directory of the current user If the process is run as sudo, it will return the home directory of the sudo user ie. the orginal user (not root), based on the SUDO_USER env var

func Hostkey

func Hostkey() (*ssh.Signer, error)

Hostkey returns the ssh signer for the connector host.

func RunningAsAdministrator

func RunningAsAdministrator() bool

RunningAsAdministrator returns true if the runtime has administrative privileges.

func StoreConnectorCertificate

func StoreConnectorCertificate(privateKey []byte, certificate []byte, orgID, connectorID string) error

StoreConnectorCertificate stores the org-wide-ca-signed mTLS certificate for a given org or connector.

func StoreConnectorSocketCertificate

func StoreConnectorSocketCertificate(privateKey []byte, certificate []byte, orgID, socketID string) error

StoreConnectorSocketCertificate stores the org-wide-ca-signed TLS certificate for a given socket.

func StoreHostkey

func StoreHostkey(key []byte, path, filename string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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