securitybunker/databunkerpro-php

PHP client library for DatabunkerPro API

Maintainers

Package info

github.com/securitybunker/databunkerpro-php

pkg:composer/securitybunker/databunkerpro-php

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.1.1 2026-08-11 16:39 UTC

This package is auto-updated.

Last update: 2026-08-11 16:41:27 UTC


README

Latest Version Total Downloads Build Status License

Official PHP client library for the DatabunkerPro API.

Requirements

  • PHP 7.3 or higher
  • JSON extension
  • cURL extension

Installation

Install the package using Composer:

composer require securitybunker/databunkerpro-php

Usage

<?php

require 'vendor/autoload.php';

use DatabunkerPro\DatabunkerproApi;

// Initialize the client
$api = new DatabunkerproApi(
    'https://your-databunker-instance.com',
    'your-x-bunker-token',
    'your-tenant-id'
);

// Create a user
$result = $api->createUser([
    'email' => 'user@example.com',
    'name' => 'John Doe'
]);

// Get user information
$user = $api->getUser('email', 'user@example.com');

// Update user
$api->updateUser('email', 'user@example.com', [
    'name' => 'John Smith'
]);

File storage

Files are attached to a user and can carry tags for later lookup:

// Store a file against a user, tagged for later retrieval
$api->createFile('email', 'user@example.com', 'passport.pdf', base64_encode($bytes), [
    'mimetype' => 'application/pdf',
    'tags' => ['identity-docs']
]);

// List that user's files, optionally filtered by tag
$files = $api->listUserFiles('email', 'user@example.com', 'identity-docs');

// Fetch one back by name or uuid
$file = $api->getFile('email', 'user@example.com', ['filename' => 'passport.pdf']);

TLS certificate verification

By default the client verifies the server's TLS certificate on every request. This is the secure default and should be left on in production. If you run a self-hosted Databunker instance with a self-signed certificate in a trusted/development network, you can opt out by passing false as the fourth constructor argument:

// Verify TLS certificates (default, recommended)
$api = new DatabunkerproApi($baseURL, $token, $tenant);

// Disable verification — only for self-signed certs on a trusted network
$api = new DatabunkerproApi($baseURL, $token, $tenant, false);

Disabling verification exposes your traffic (access token and personal data) to man-in-the-middle interception, so avoid it against any public endpoint.

Available Methods

The library provides methods for all DatabunkerPro API endpoints:

  • User Management
  • User Request Management
  • App Data Management
  • File Storage
  • Legal Basis Management
  • Agreement Management
  • Processing Activity Management
  • Group Management
  • Token Management
  • Audit Management
  • Tenant Management
  • Role Management
  • Policy Management
  • Session Management

For detailed API documentation, please refer to the DatabunkerPro API Documentation.

Testing

composer test

Code Quality

Check code style:

composer cs-check

Fix code style issues:

composer cs-fix

Security

This library is scanned on every push and pull request, with a weekly scheduled sweep to catch drift:

  • SAST (Semgrep): static analysis using the p/php, p/secrets, p/security-audit, and p/owasp-top-ten rulesets. A finding fails the check, and results are published to the repository's Code Scanning tab. See .github/workflows/semgrep.yml.
  • Supply-chain hardening: every GitHub Action is pinned to a full commit SHA, so a mutable tag (@v4) cannot be silently repointed to malicious code.
  • TLS on by default: the client verifies server certificates unless you explicitly opt out (see TLS certificate verification).

Reproduce the SAST scan locally:

pip install semgrep
semgrep scan \
    --config p/php \
    --config p/secrets \
    --config p/security-audit \
    --config p/owasp-top-ten

To report a security vulnerability, please email hello@databunker.org rather than opening a public issue.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support, please contact hello@databunker.org or open an issue in the GitHub repository.