https://github.com/rsjethani/secret
Prevent your secrets from leaking into logs, std* etc.
https://github.com/rsjethani/secret
go secrets
Last synced: 7 months ago
JSON representation
Prevent your secrets from leaking into logs, std* etc.
- Host: GitHub
- URL: https://github.com/rsjethani/secret
- Owner: rsjethani
- License: mit
- Created: 2022-01-10T12:54:39.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-16T14:20:32.000Z (about 1 year ago)
- Last Synced: 2024-08-17T15:22:58.802Z (about 1 year ago)
- Topics: go, secrets
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 28
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - secret - Prevent your secrets from leaking into logs, std\* etc. (Security / HTTP Clients)
- zero-alloc-awesome-go - secret - Prevent your secrets from leaking into logs, std\* etc. (Security / HTTP Clients)
- awesome-go-extra - secret - 01-10T12:54:39Z|2022-08-13T19:51:02Z| (Security / HTTP Clients)
- awesome-go - rsjethani/secret
- awesome-go - rsjethani/secret
README
[](https://pkg.go.dev/github.com/rsjethani/secret/v3)
[](https://github.com/rsjethani/secret/actions)
[](https://goreportcard.com/report/github.com/rsjethani/secret)
# Installation
```
go get github.com/rsjethani/secret/v3
```
# What secret is?
It provides simple Go types like `Text` to securely store secrets. For example:
```go
type Login struct {
User string
Password secret.Text
}
```
The encapsulated secret remains inaccessible to operations like printing, logging, JSON serialization etc. A (customizable) redact hint like `*****` is returned instead. The only way to access the actual secret value is by asking explicitly via the `.Secret()` method. See package documentation more reference and examples.
# What secret is not?
- It is not a secret management service or your local password manager.
- It is not a Go client to facilitate communication with secret managers like Hashicorp Vault, AWS secret Manager etc. Checkout [teller](https://github.com/spectralops/teller) if that is what you are looking for.
# Versions
### v3
Current version, same functionality as v2 but much cleaner API.
### v2
Perfectly usable but no longer maintained.
### v1
Deprecated.