Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sealr

Sealr is a Go library for building encrypted secret management workflows. It provides a hexagonal, testable core with pluggable adapters for SOPS, filesystem, git, and time.

Features

  • SOPS-backed encryption/decryption for dotenv and binary files.
  • Vault layout management and metadata indexing.
  • Services for secrets, files, recipients, and sync workflows.
  • Pluggable ports for storage, encryption, git, and clock.

Install

go get github.com/aatuh/sealr

Quick start

package main

import (
  "context"
  "fmt"

  "github.com/aatuh/sealr"
  "github.com/aatuh/sealr/services"
)

func main() {
  ctx := context.Background()
  system := sealr.NewDefaultSystem()

  err := system.InitService.Init(ctx, services.InitOptions{
    Root:       "./vault",
    Name:       "my-vault",
    Recipients: []string{"age1example..."},
    InitGit:    true,
  })
  if err != nil {
    panic(err)
  }

  if err := system.SecretService.Set(ctx, "./vault", "myapp", "dev", "API_KEY", "abc123"); err != nil {
    panic(err)
  }

  data, err := system.SecretService.ExportEnv(ctx, "./vault", "myapp", "dev")
  if err != nil {
    panic(err)
  }
  fmt.Println(string(data))
}

Architecture

Sealr follows a hexagonal layout:

  • domain: value types and parsing helpers
  • ports: interfaces for side effects
  • services: application use cases
  • infra: default OS adapters (SOPS, git, filesystem, clock)

Custom adapters

Use NewSystem to wire your own ports for tests or alternate backends:

system, err := sealr.NewSystem(sealr.Dependencies{
  FS:        myFileSystem,
  Encrypter: myEncrypter,
  Git:       myGit,
  Clock:     myClock,
})
if err != nil {
  panic(err)
}

Requirements

  • Go 1.25.1+
  • sops and age on PATH when using the default encrypter

License

MIT. See LICENSE.

About

Encrypted secrets workflows for Go. SOPS/age-backed vault for .env + files, with a hexagonal core and pluggable git/fs/clock adapters.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages