Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/1Password/connect-sdk-go
- Owner: 1Password
- License: mit
- Created: 2020-11-30T20:03:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T17:27:24.000Z (6 months ago)
- Last Synced: 2024-11-06T08:03:37.016Z (7 days ago)
- Topics: 1password, 1password-connect, connect-sdk, go, golang, secrets-management
- Language: Go
- Homepage: https://developer.1password.com/docs/connect
- Size: 252 KB
- Stars: 159
- Watchers: 15
- Forks: 20
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.
---
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).