go-pbolt
Fast, robust Go SDK and client library compatible with Passbolt.
β‘ Overview
go-pbolt is a Go client SDK to interact with Passbolt, an open-source password manager for teams. Both Passbolt Community and Pro server editions are supported.
There is also a companion CLI tool: go-pbolt-cli.
This module is divided into two primary packages:
api: Low-level client providing direct access to the Passbolt REST API endpoints.
helper: High-level convenience functions executing multi-step cryptographic and administrative workflows (e.g. creating/decrypting resources, sharing passwords with users/groups, resolving folders).
π API Compatibility
The Go module is designed to work with current Passbolt API versions.
[!IMPORTANT]
Compatibility is continuously tested against Passbolt API 5.6.1 and later.
π» Installation
go get github.com/pbolt-dev/go-pbolt
π‘ Quick Example
package main
import (
"context"
"fmt"
"github.com/pbolt-dev/go-pbolt/api"
"github.com/pbolt-dev/go-pbolt/helper"
)
const (
address = "https://passbolt.example.com"
userPassword = "yourStrongPassword"
userPrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----
...
-----END PGP PRIVATE KEY BLOCK-----`
)
func main() {
ctx := context.TODO()
client, err := api.NewClient(nil, "", address, userPrivateKey, userPassword)
if err != nil {
panic(err)
}
if err := client.Login(ctx); err != nil {
panic(err)
}
defer client.Logout(ctx)
fmt.Println("Successfully authenticated with Passbolt server!")
// Create a new password resource
resourceID, err := helper.CreateResource(
ctx,
client,
"", // Folder ID (empty for root)
"Database Server", // Name
"dbuser", // Username
"https://db.local", // URI
"s3cur3P@ssw0rd", // Password
"Production primary database credentials",
)
if err != nil {
panic(err)
}
fmt.Printf("Created resource ID: %s\n", resourceID)
}
βοΈ Trademark Notice
Passbolt is a registered trademark of Passbolt SA. pbolt is an independent community project and is not affiliated with, endorsed by, or sponsored by Passbolt SA.
π License
This project is licensed under the MIT License.