Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/1Password/connect-sdk-go

Go SDK for 1Password Connect
https://github.com/1Password/connect-sdk-go

1password 1password-connect connect-sdk go golang secrets-management

Last synced: 5 days ago
JSON representation

Go SDK for 1Password Connect

Awesome Lists containing this project

README

        


1Password Connect SDK for Go


Access your 1Password items in your Go applications through your self-hosted 1Password Connect server.



Get started

---

The 1Password Connect Go SDK provides access to the [1Password Connect](https://developer.1password.com/docs/connect) API, to facilitate communication with the Connect server hosted on your infrastructure and 1Password. The library is intended to be used by your applications, pipelines, and other automations to simplify accessing items stored in your 1Password vaults.

## ✨ Quickstart

1. Download and install the 1Password Connect Go SDK:

```sh
go get github.com/1Password/connect-sdk-go
```

2. Export the `OP_CONNECT_HOST` and `OP_CONNECT_TOKEN` environment variables:

```sh
export OP_CONNECT_HOST= && \
export OP_CONNECT_TOKEN=
```

3. Use it in your code

- Read a secret:

```go
import "github.com/1Password/connect-sdk-go/connect"

func main () {
client := connect.NewClientFromEnvironment()
item, err := client.GetItem("", "")
if err != nil {
log.Fatal(err)
}
}
```

- Write a secret:

```go
import (
"github.com/1Password/connect-sdk-go/connect"
"github.com/1Password/connect-sdk-go/onepassword"
)

func main () {
client := connect.NewClientFromEnvironment()
item := &onepassword.Item{
Title: "Secret String",
Category: onepassword.Login,
Fields: []*onepassword.ItemField{{
Value: "mysecret",
Type: "STRING",
}},
}

postedItem, err := client.CreateItem(item, "")
if err != nil {
log.Fatal(err)
}
}
```

For more examples, check out [USAGE.md](USAGE.md).

## 💙 Community & Support

- File an [issue](https://github.com/1Password/connect-sdk-go/issues) for bugs and feature requests.
- Join the [Developer Slack workspace](https://join.slack.com/t/1password-devs/shared_invite/zt-1halo11ps-6o9pEv96xZ3LtX_VE0fJQA).
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/).

## 🔐 Security

1Password requests you practice responsible disclosure if you discover a vulnerability.

Please file requests via [**BugCrowd**](https://bugcrowd.com/agilebits).

For information about security practices, please visit the [1Password Bug Bounty Program](https://bugcrowd.com/agilebits).