Skip to main content

High-trust OpenPGP keyserver APIs built on the Tigrbl application engine.

Project description

Tigrbl Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - tigrbl_api_hpks


Tigrbl API HPKS 🔐

High-trust OpenPGP keyserver APIs that embrace the HPKS v2 specification while preserving legacy HKP compatibility, powered by the Tigrbl application engine.

✨ Features

  • 🔄 Dual-protocol support – serves both legacy /pks/lookup flows and HPKS v2 JSON/binary routes with consistent persistence.
  • 🧩 Merge-aware storage – idempotent upserts normalize fingerprints, union metadata, and track revocation state without losing history.
  • 📦 Single source of truth – admin CRUD and public HPKS endpoints share the same openpgp_keys table and Tigrbl handlers.
  • 🛡️ Spec-aligned responses – machine-readable index output, binary bundle delivery, and required CORS headers baked in.
  • ⚙️ Composable operations@op_ctx powered helpers expose reusable alias handlers for /pks workflows.

📦 Installation

Using uv

uv add tigrbl_api_hpks

Using pip

pip install tigrbl_api_hpks

🚀 Quick Start

import asyncio
from httpx import ASGITransport, AsyncClient

from tigrbl_api_hpks import app


async def bootstrap():
    await app.initialize()  # create in-memory tables

    # Submit an ASCII-armored key bundle via the legacy endpoint
    armored_blob = """-----BEGIN PGP PUBLIC KEY BLOCK-----\n...\n-----END PGP PUBLIC KEY BLOCK-----"""
    async with AsyncClient(transport=ASGITransport(app=app), base_url="http://testserver") as client:
        resp = await client.post(
            "/pks/add",
            data={"keytext": armored_blob},
            headers={"Content-Type": "application/x-www-form-urlencoded"},
        )
        resp.raise_for_status()

        # Lookup via HPKS v2 JSON index
        lookup = await client.get("/pks/v2/index/example.com")
        print(lookup.json())


asyncio.run(bootstrap())

🧪 Testing

Run the package test suite in isolation:

uv run --package tigrbl_api_hpks --directory pkgs/community/tigrbl_api_hpks pytest

📄 License

This project is licensed under the terms of the Apache 2.0 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

tigrbl_api_hpks-0.1.2.dev13.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tigrbl_api_hpks-0.1.2.dev13-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file tigrbl_api_hpks-0.1.2.dev13.tar.gz.

File metadata

  • Download URL: tigrbl_api_hpks-0.1.2.dev13.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tigrbl_api_hpks-0.1.2.dev13.tar.gz
Algorithm Hash digest
SHA256 2e79ac21d1459985b582618bf0c4a248d38daa8700031e3a4071a7b00687d305
MD5 2148994fe5f122292ec0981eebec53c2
BLAKE2b-256 ca095e8ea696d24f4ee6a589fc90d7ec49b2bac9572772135b0744405e7fafd7

See more details on using hashes here.

File details

Details for the file tigrbl_api_hpks-0.1.2.dev13-py3-none-any.whl.

File metadata

  • Download URL: tigrbl_api_hpks-0.1.2.dev13-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tigrbl_api_hpks-0.1.2.dev13-py3-none-any.whl
Algorithm Hash digest
SHA256 cd3faa6f05f0f5bc6e0c9517abf09f4506bb7d07c99cbf31d429f65c9f1eb556
MD5 6fcb10dd92fc49fe70ccf4648e6e88a2
BLAKE2b-256 21d0d800adb7f0af68f9ca905bcdc3b4f00582d71cccf2024187d383a20047d3

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