https://github.com/selectel/secretsmanager-go
https://github.com/selectel/secretsmanager-go
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/selectel/secretsmanager-go
- Owner: selectel
- License: apache-2.0
- Created: 2024-02-12T09:15:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T08:47:42.000Z (about 2 years ago)
- Last Synced: 2024-12-26T17:13:07.369Z (over 1 year ago)
- Language: Go
- Size: 29.3 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# secretsmanager-go: Go SDK for Secrets Manager API
[](https://pkg.go.dev/github.com/selectel/secretsmanager-go/)
[](https://goreportcard.com/report/github.com/selectel/secretsmanager-go/)
[](https://codecov.io/gh/selectel/secretsmanager-go)
> [!NOTE]
> Secrets Manager SDK implements the Secrets Manager API facilitating the tasks of storing, managing and revoking secrets/certificates.
## Documentation
> [!IMPORTANT]
> The Go library documentation is available at [go.dev](https://pkg.go.dev/github.com/selectel/secretsmanager-go/).
## Getting started
### Install
```sh
go get github.com/selectel/secretsmanager-go
```
## Authentication
To work with Selectel API:
- You're gonna need a Selectel account.
- [Keystone Token](https://developers.selectel.com/docs/control-panel/authorization/#keystone-token)
## Usage
> [!IMPORTANT]
> At the moment you need to pass a **Valid** Keystone Token to use it.
```go
package main
import (
"context"
"log"
"fmt"
"github.com/selectel/secretsmanager-go"
)
// Setting Up your project KeystoneToken
const KeystoneToken = "gAAAAAB..."
func main() {
// Setting Up Client
cl, err := secretsmanager.New(
secretsmanager.WithAuthOpts(&secretsmanager.AuthOpts{KeystoneToken: KeystoneToken}),
)
if err != nil {
log.Fatal(err)
}
// Prepare an empty context, for future requests.
ctx := context.Background()
sc, err := cl.Secrets.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Retrived secrets: %+v\n", sc)
// ...
}
```
## Additional info
> [!NOTE]
>
> More examples available in [📁 examples](./examples) section.
>
> For advanced topics and guides [📁 docs](./docs) section.