session

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package session provides the composition root for vault manager construction.

This package wires together the vault and agent packages, providing agent-backed session behavior for credential decryption. It serves as the dependency injection point that CLI commands use to obtain a configured vault manager.

Design Constraints

This package may import:

  • internal/vault (for manager construction)
  • internal/agent (for session operations)

This package must NOT import:

  • internal/ui (no terminal dependencies)
  • cobra or CLI packages
  • golang.org/x/term

This separation allows the session layer to be used in non-interactive contexts (e.g., the agent daemon itself).

Usage

Use NewVaultManager to create a vault manager with agent session support:

mgr, err := session.NewVaultManager(vault.Auto())
if err != nil {
    return err
}
if mgr.NeedsUnlock() {
    // Prompt user and call unlock
}

Agent Communication

The package provides agent-backed implementations of vault.SessionDeps:

  • Availability checks with fast timeouts
  • Decryption requests via Unix socket
  • Session locking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVaultManager

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

NewVaultManager creates a vault.Manager with agent-backed session behavior. This is the single composition root for vault manager construction.

Types

This section is empty.

Directories

Path Synopsis
Package mode provides canonical security mode identifiers.
Package mode provides canonical security mode identifiers.

Jump to

Keyboard shortcuts

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