askpass

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RP_ECHO           = 1 << iota /* echo stuff or something 8 */
	RP_ALLOW_STDIN                /* Allow stdin and not askpass */
	RP_ALLOW_EOF                  /* not used */
	RP_USE_ASKPASS                /* Use SSH_ASKPASS */
	RP_ASK_PERMISSION             /* Ask for permission, yes/no prompt */
	RP_NEWLINE                    /* Print newline after answer. */
	RPP_ECHO_OFF                  /* Turn off echo (default). */
	RPP_ECHO_ON                   /* Leave echo on. */
	RPP_REQUIRE_TTY               /* Fail if there is no tty. */
	RPP_FORCELOWER                /* Force input to lower case. */
	RPP_FORCEUPPER                /* Force input to upper case. */
	RPP_SEVENBIT                  /* Strip the high bit from input. */
	RPP_STDIN                     /* Read from stdin, not /dev/tty */
)

Variables

View Source
var (
	ErrNoAskpass = errors.New("system does not have an askpass program")

	// Default ASKPASS programs
	SSH_ASKPASS_DEFAULTS = []string{
		"/usr/lib/ssh/x11-ssh-askpass",
		"/usr/lib/ssh/gnome-ssh-askpass3",
		"/usr/lib/ssh/gnome-ssh-askpass",
		"/usr/libexec/openssh/gnome-ssh-askpass",
		"/usr/bin/ksshaskpass",
	}
)

Functions

func AskPermission

func AskPermission() (bool, error)

AskPremission runs SSH_ASKPASS in with SSH_ASKPASS_PROMPT=confirm set as env it will expect exit code 0 or !0 and return 'yes' and 'no' respectively.

func ReadPassphrase

func ReadPassphrase(prompt string, flags ReadPassFlags) ([]byte, error)

func SshAskPass

func SshAskPass(prompt, hint string) ([]byte, error)

Types

type ReadPassFlags

type ReadPassFlags uint8

State for the ReadPassphrase function

Jump to

Keyboard shortcuts

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