Documentation
¶
Overview ¶
Package keycache keeps an unlocked vault root key in a short-lived background process, so commands run shortly after one another do not ask for the password again (like sudo's timestamp). The key lives only in that process's memory; it is handed out over a Unix socket in a private per-user directory, to peers running as the same user.
Index ¶
- Constants
- Variables
- func Get(dbID string) ([]byte, error)
- func Lock(dbID string) error
- func RunDaemon(in io.Reader, out io.Writer) error
- func Serve(l net.Listener, dbID string, root []byte, idle time.Duration) error
- func SocketPath(dbID string) (string, error)
- func Start(exe string, args []string, dbID string, root []byte, idle time.Duration) error
- func Status(dbID string) (time.Time, error)
Constants ¶
const Supported = true
Supported reports whether this platform has an unlock cache.
Variables ¶
var ErrNotCached = errors.New("vault is not cached")
ErrNotCached means no cache process holds the key for this vault.
Functions ¶
func RunDaemon ¶
RunDaemon is the body of the cache process: it reads the payload from in, reports "ready" (or an error) on out, then serves until the idle timeout passes or it is locked.
func Serve ¶
Serve answers cache requests on l until idle passes without a successful get, or a lock request arrives.
func SocketPath ¶
SocketPath returns the socket of the cache for vault dbID.
Types ¶
This section is empty.