session

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package session provides CLI session orchestration. This wraps internal/session with interactive prompting and TTY/env/FD policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureUnlocked

func EnsureUnlocked(mgr *vault.Manager) error

EnsureUnlocked ensures the vault is unlocked, prompting if needed. Returns error if unlock is needed but fails.

func Lock

func Lock(mgr *vault.Manager) error

Lock terminates the agent session. Delegates to vault.Manager.Lock() which uses injected SessionDeps.Lock.

func NewManager

func NewManager(mode vault.Mode, opts ...vault.Option) (*vault.Manager, error)

NewManager creates a vault.Manager via the session composition root. This is a convenience wrapper that adds no policy - just delegates.

func TryUnlockIfTTY

func TryUnlockIfTTY(mgr *vault.Manager) error

TryUnlockIfTTY attempts to unlock if TTY available and unlock needed. Returns nil on success or if no TTY (caller continues without credentials). Returns error only on unlock failure with TTY present.

func Unlock

func Unlock(mgr *vault.Manager, useStdin bool) error

Unlock spawns an agent and unlocks the vault. Handles mode detection, passphrase/PIN collection, and agent spawning. If useStdin is true, reads passphrase from stdin (for automation).

Types

This section is empty.

Jump to

Keyboard shortcuts

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