server

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientPIDFromContext added in v1.2.0

func ClientPIDFromContext(ctx context.Context) int

ClientPIDFromContext returns the peer PID associated with the current HTTP request, or 0 if unavailable.

func ResolveEnvLines

func ResolveEnvLines(ctx context.Context, app *AppState, lines []string) ([]string, []error)

ResolveEnvLines processes KEY=VALUE lines and replaces values of the form keepass(vault|title) and user(title) with resolved passwords. Bracketed vaults may contain at most one nested expression. When a nested expression is present, its resolved value is passed to the upper-level KP resolver via the context (not by mutating the vault string).

func RunDaemon

func RunDaemon()

func RunTray

func RunTray(app *AppState)

Types

type AWSResolver

type AWSResolver interface {
	ResolveSecret(ctx context.Context, secretID, field string) (string, error)
	ResolveParameter(ctx context.Context, name, field string) (string, error)
	Evict(key string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
}

type AppState

type AppState struct {
	KP                KPResolver
	USER              UserResolver
	WINCRED           WincredResolver
	AWS               AWSResolver
	AZKV              AzureResolver
	GCPSM             GCPResolver
	KEYCHAIN          KeychainResolver
	VAULT             VaultResolver
	ONEPASSWORD       OnePasswordResolver
	UnlockTTL         utils.AtomicDuration
	ShouldExit        utils.AtomicBool
	RetrievalApproval utils.AtomicBool
	Approvals         *approval.Store
	Gate              *approval.Gate
	Audit             *audit.Logger

	Server *DaemonServer
}

func NewAppState

func NewAppState() *AppState

type AzureResolver added in v1.1.0

type AzureResolver interface {
	ResolveSecret(ctx context.Context, ref, field string) (string, error)
	Evict(key string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
}

type DaemonServer

type DaemonServer struct {
	App      *AppState
	Endpoint string
	// contains filtered or unexported fields
}

func NewDaemonServer

func NewDaemonServer(app *AppState, token string) (*DaemonServer, error)

func (*DaemonServer) Serve

func (ds *DaemonServer) Serve() error

func (*DaemonServer) Shutdown

func (ds *DaemonServer) Shutdown(ctx context.Context) error

type GCPResolver added in v1.1.0

type GCPResolver interface {
	ResolveSecret(ctx context.Context, ref, field string) (string, error)
	Evict(key string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
}

type KPResolver

type KPResolver interface {
	SetUnlockTTL(unlockTTL *utils.AtomicDuration)
	LoadAliases() error
	LoadKeyfiles() error
	ResolvePassword(ctx context.Context, vault, title string, master string, ttl time.Duration, resolve func(expr string) (string, error)) (string, error)
	EvictVault(key string)
	EvictAll()
	CachedVaults() []keepass.CachedVault
	IsVaultUnlocked(key string) bool
	Aliases() []keepass.AliasInfo
	SetAliases(list []keepass.AliasInfo) error
	Keyfiles() []keepass.KeyfileInfo
	SetKeyfiles(list []keepass.KeyfileInfo) error
}

type KeychainResolver added in v1.1.0

type KeychainResolver interface {
	Resolve(ctx context.Context, service, account string) (string, error)
}

type OnePasswordResolver added in v1.1.0

type OnePasswordResolver interface {
	ResolveSecret(ctx context.Context, ref, field string) (string, error)
	Evict(key string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
}

type UserResolver

type UserResolver interface {
	SetUnlockTTL(unlockTTL *utils.AtomicDuration)
	ResolvePassword(ctx context.Context, title string, ttl time.Duration) (string, error)
	Evict(title string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
	HasCached(title string) bool
}

type VaultResolver added in v1.1.0

type VaultResolver interface {
	ResolveSecret(ctx context.Context, path, field string) (string, error)
	Evict(key string)
	EvictAll()
	CachedKeys() []cacheinfo.Entry
}

type WincredResolver

type WincredResolver interface {
	Resolve(ctx context.Context, target, field string) (string, error)
}

Jump to

Keyboard shortcuts

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