replica

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package replica is the fill host's local cache. One sealed box. Names, URIs, logins, and material all live inside the AEAD. The wrapping key is never a file next to the box. Agents who copy replica.box get ciphertext they cannot grind (random 256-bit key, not a password). 1Password/Bitwarden encrypt the whole local vault the same way; they do not leave a device.key beside plaintext sqlite metadata.

Index

Constants

View Source
const (
	FileName = "replica.box"
	Version  = 1
)

Variables

View Source
var ErrNotFound = errors.New("replica: key not found")

Functions

func Path

func Path(dir string) string

func Unlock

func Unlock(ks KeyStore) ([]byte, error)

Types

type KeyStore

type KeyStore interface {
	Get() ([]byte, error)
	Put([]byte) error
}

KeyStore holds the 256-bit replica key off the filesystem. Mac: Keychain, this-device, fill host only. Not device.key.

func Mem

func Mem() KeyStore

func Platform

func Platform() KeyStore

type Row

type Row struct {
	Item     protocol.Item `json:"item"`
	Material string        `json:"material"`
}

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

func Attach

func Attach(dir string) *Vault

Attach opens the replica vault for dir under the platform keystore. A volatile keystore (VEIL_REPLICA_KEYSTORE=mem) gets an in-memory vault that never reads or writes replica.box — its key dies with the process, so any box it sealed would be unreadable next boot. On disk, a box that fails to open (stale key, corrupt bytes) is removed and re-created; origin is truth and the next pull repopulates.

func Open

func Open(path string, key []byte) (*Vault, error)

func (*Vault) Close

func (v *Vault) Close()

func (*Vault) Items

func (v *Vault) Items() []protocol.Item

func (*Vault) Len

func (v *Vault) Len() int

func (*Vault) Material

func (v *Vault) Material(id string) string

func (*Vault) Put

func (v *Vault) Put(item protocol.Item, material []byte) error

Jump to

Keyboard shortcuts

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