An open API service indexing awesome lists of open source software.

https://github.com/mackee/envsecrets

envsecrets is a meta framework for environment variable loader.
https://github.com/mackee/envsecrets

Last synced: about 1 year ago
JSON representation

envsecrets is a meta framework for environment variable loader.

Awesome Lists containing this project

README

          

# envsecrets

"envsecrets" is a meta framework for environment variable loader. It is designed to load environment variables from various sources.

## Installation

```bash
$ go get github.com/mackee/envsecrets
```

## Usage

### Environment variable format

If you want set from AWS Secrets Manager, you should set environment variable like below.

```bash
export =secretfrom:aws_secretsmanager:
```

If set a json value to the secret, you can access the value by specifying the key.

```bash
export =secretfrom:aws_secretsmanager:.
```

### Load environment variables

```go
import (
"github.com/mackee/envsecrets/dist/aws"
)

func main() {
ctx := context.Background()
if err := awsenvsecrets.Load(ctx); err != nil {
log.Fatalf("failed to load environment variables: %v", err)
}
}
```

## Supported sources

✅: Implemented

🔍: Not implemented yet

| Source | Type | Description | Format | Status |
| --- | --- | --- | --- | --- |
| AWS Secrets Manager | `aws_secretsmanager` | Load secret from AWS Secrets Manager | `secretfrom:aws_secretsmanager:[.]` | ✅ |
| AWS Systems Manager ParameterStore | `aws_ssm` | Load secret from AWS Systems Manager ParameterStore | `secretfrom:aws_ssm:[.]` | ✅ |
| Amazon S3 | `aws_s3` | Load secret from Amazon S3 | `secretfrom:aws_s3:s3:///[.]` | ✅ |
| Google Cloud Secret Manager | `google_secretmanager` | Load secret from Google Cloud Secret Manager | `secretfrom:google_secretmanager:projects//secrets//versions/[.]` | ✅ |
| 1Password | `onepassword` | Load secret from 1Password | | 🔍 |

## License

Copyright (c) 2024- [mackee](https://github.com/mackee)

Licensed under MIT License.