Packages
Search packages... ⌘K
Go Package
vault
1Password vault adapter — credential retrieval, caching, op:// URI resolution
Go Ready SI
Credential Retrieval
$ v, _ := vault.NewVault(cfg)
[vault] 1Password CLI: v2.24.0
[vault] session: authenticated
$ secret, _ := v.Read(ctx, "op://Infrastructure/postgres-sbx/password")
[vault] resolving: op://Infrastructure/postgres-sbx/password
[vault] resolved — cached for 5m
$ refs, _ := v.Resolve(ctx, envRefs)
[vault] batch resolve: 4 references
[vault] op://Infrastructure/postgres-sbx/password — hit (cached)
[vault] op://Infrastructure/r2-shredbx/access_key — miss (fetched)
[vault] op://Infrastructure/r2-shredbx/secret_key — miss (fetched)
[vault] op://Infrastructure/redis-sbx/password — miss (fetched)
[vault] 4/4 resolved — 1 cached, 3 fetched
About
Integrates with 1Password CLI for credential management. Resolves op:// URIs to secret values, caches retrieved credentials in memory with TTL, and provides a unified interface for all secret access across the workspace.
Public API
| Name | Kind | Signature |
|---|---|---|
| Vault | type | type Vault struct |
| NewVault | func | func NewVault(cfg Config) (*Vault, error) |
| Read | func | func (v *Vault) Read(ctx context.Context, uri string) (string, error) |
| Resolve | func | func (v *Vault) Resolve(ctx context.Context, refs map[string]string) (map[string]string, error) |
| Cache | type | type Cache struct |
Dependencies
Imports (2)
config Go Ready
YAML configuration reader — typed config loading with environment overlay
yamlconfigurationenvironmenttyped-config
4 exports 4 deps
external Go Ready
External process runner — exec.Command wrapper with timeout, output capture, error handling
execprocess-runnertimeoutoutput-capture
5 exports 7 deps
Imported By (2)
Related Packages
database Go Ready
PostgreSQL adapter — connection pooling, schema isolation, health checks
postgresqlpgxpoolingschema-isolation
4 exports 5 deps
storage Go Ready
R2-compatible object storage — upload, download, presigned URLs
r2s3-compatibleobject-storagepresigned-urls
5 exports 3 deps
external Go Ready
External process runner — exec.Command wrapper with timeout, output capture, error handling
execprocess-runnertimeoutoutput-capture
5 exports 7 deps
Source
github.com/shredbx/sbx-core/pkg/vault
1passwordsecretscredentialsop-uri