Note
Secrets Manager SDK implements the Secrets Manager API facilitating the tasks of storing, managing and revoking secrets/certificates.
Important
The Go library documentation is available at go.dev.
go get github.com/selectel/secretsmanager-go
To work with Selectel API:
- You're gonna need a Selectel account.
- Keystone Token
Important
At the moment you need to pass a Valid Keystone Token to use it.
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)
// ...
}