https://github.com/ovotech/cloud-key-client
A Golang client to interact with Cloud Providers' Service Account keys
https://github.com/ovotech/cloud-key-client
company-kaluza
Last synced: over 1 year ago
JSON representation
A Golang client to interact with Cloud Providers' Service Account keys
- Host: GitHub
- URL: https://github.com/ovotech/cloud-key-client
- Owner: ovotech
- License: mit
- Created: 2018-08-16T09:21:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-18T23:22:57.000Z (over 2 years ago)
- Last Synced: 2024-06-21T18:06:03.533Z (about 2 years ago)
- Topics: company-kaluza
- Language: Go
- Homepage:
- Size: 387 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloud-Key-Client
[](https://circleci.com/gh/ovotech/cloud-key-client)
Cloud-Key-Client is a Golang client that connects up to cloud providers either
to collect details of Service Account keys, or manipulate them.
## Install as a Go Dependency
```go
go get -u github.com/ovotech/cloud-key-client
```
## Getting Started
```go
package main
import (
"fmt"
keys "github.com/ovotech/cloud-key-client"
)
func main() {
providers := []keys.Provider{}
// create a GCP provider
gcpProvider := keys.Provider{
GcpProject: "my-gcp-project-id",
Provider: "gcp",
}
// create an AWS provider
awsProvider := keys.Provider{
// no need to specify any account ID here
Provider: "aws",
}
// create an Aiven provider
aivenProvider := keys.Provider{
Provider: "aiven",
Token: "my-aiven-api-token"
}
// add both providers to the slice
providers = append(providers, gcpProvider)
providers = append(providers, awsProvider)
providers = append(providers, aivenProvider)
// use the cloud-key-client
keys, err := keys.Keys(providers, true)
if err != nil {
fmt.Print(err)
return
}
for _, key := range keys {
fmt.Printf("%s, ID: ****%s, Age: %dd, Status: %s\n",
key.Account,
key.ID[len(key.ID)-4:],
int(key.Age/1440),
key.Status)
}
}
```
## Purpose
This client could be useful for obtaining key metadata, such as age, and
performing create and delete operations for key rotation. Multiple providers
can be accessed through a single interface.
## Integrations
The following cloud providers have been integrated:
- AWS
- Aiven
- GCP
No config is required, you simply need to pass a slice of `Provider` structs to
the `keys()` func.
Authentication is handled by the Default Credential Provider Chains for both
[GCP](https://cloud.google.com/docs/authentication/production#auth-cloud-implicit-go)
and [AWS](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default).