Skip to main content

Python library for Passbolt

Project description

Passbolt API Client

Description

This project is a Python client implementation for interacting with the Passbolt API, an open-source password manager for teams.

Features

  • Authentication with a GPG key
  • Retrieve users and groups
  • Create groups and manage users
  • Encrypt and decrypt messages using GPG
  • Retrieve and manage Passbolt resources

Prerequisites

  • Python 3.x
  • Passbolt installed and accessible via API
  • A valid GPG key

Installation

pip install passbolt-py

Configuration

Configuration can be loaded from a dictionary or environment variables:

export PASSBOLT_GPG_BINARY=gpg
export PASSBOLT_GPG_LIBRARY=PGPy
export PASSBOLT_BASE_URL=https://your-passbolt-instance.com
export PASSBOLT_PRIVATE_KEY='your-private-key'
export PASSBOLT_PASSPHRASE='your-passphrase'
export PASSBOLT_FINGERPRINT='your-key-fingerprint'
export PASSBOLT_VERIFY=True
export PASSBOLT_TIMEOUT=5.0

Usage

Initializing the client

from passbolt import PassboltAPI

# Initialization with configuration
config = {
    "gpg_binary": "gpg",
    "gpg_library": "PGPy",
    "base_url": "https://your-passbolt-instance.com",
    "private_key": "your-private-key",
    "passphrase": "your-passphrase",
    "fingerprint": "your-key-fingerprint",
    "verify": True,
    "timeout": 5.0,
}

client = PassboltAPI(dict_config=config)

Retrieving users

users = client.get_users()
print(users)

Retrieving a user by email

user = client.get_user_by_email("user@example.com")
print(user)

Creating a group

response = client.create_group("My Group")
print(response)

Encrypting a message

encrypted_message = client.encrypt("my secret password", public_key)
print(encrypted_message)

Decrypting a message

decrypted_message = client.decrypt(encrypted_message)
print(decrypted_message)

Contributions

Contributions are welcome. Please follow best development practices and submit a pull request with your changes.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passbolt_py-0.0.3.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file passbolt_py-0.0.3.tar.gz.

File metadata

  • Download URL: passbolt_py-0.0.3.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for passbolt_py-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0aa5c8ca7a67b1461c1cbf7a7c1080b03e7be4ea79b3ea281fe048be8db56977
MD5 c5fb0f4c30ddf5b97ed94e874a62e7e0
BLAKE2b-256 8191491747a3c2b0409b0db25866a3ddea310bc5733db3da1972191b879589e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page