Skip to main content

cc.me trampoline and encrypted webhook queue client + CLI

Project description

cc-me

Python client for cc.me. The library builds trampoline and inbox URLs and decrypts deliveries; the CLI forwards Safe inbox deliveries to a local endpoint. Mirrors the canonical JavaScript client.

Requires Python 3.10+ and PyNaCl.

pip install cc-me

Forward an inbox to a local endpoint:

cc-me http://example.local:8080/webhook

The CLI prints the inbox URL to register with the provider. It uses ~/.cc-me.key by default, creating it if needed and reusing it later. The key is an Ed25519 seed; the URL shows the derived Ed25519 public key. Use --key to choose a specific path:

cc-me --key ~/hooks.key http://example.local:8080/webhook

You can also set CC_ME_KEY, CC_ME_URL, and CC_ME_LIMIT.

from cc_me import CcMeClient, create_alias, private_key

alias = create_alias("http://example.local/auth/callback")
print(f"OAuth callback URL: {alias.url}")

key = private_key("~/.cc-me.key".replace("~", __import__("os").path.expanduser("~")))
cc = CcMeClient(private_key=key)

print(f"Webhook URL: {cc.inbox_url()}")
print(f"Webmention URL: {cc.webmention_url()}")
print(f"WebSub URL: {cc.websub_url()}")
print(f"Slack URL: {cc.slack_url()}")
print(f"Pingback URL: {cc.pingback_url()}")
print(f"Meta URL: {cc.meta_url('shared-verify-token')}")
print(f"CloudEvents URL: {cc.cloudevents_url()}")
print(f"Discord URL: {cc.discord_url('discord-app-public-key')}")

result = cc.claim(limit=10, poll=True)

handled = []
for request in result.requests:
    print(request.method, request.path, request.text())
    handled.append(request.id)
cc.ack(handled)

create_alias is idempotent: calling it again with the same target returns the same URL.

Protocol URL helpers return provider-ready receiver URLs. Webmention, WebSub, Slack Events API, Pingback, Meta-style webhooks, CloudEvents, and Discord Interactions deliveries arrive in the same Safe inbox and are read with peek or claim.

meta_url(token) adds an optional verify token for Meta-style handshakes. cloudevents_url() accepts binary, structured, and batched JSON CloudEvents. discord_url(app_public_key) verifies Discord signatures and answers interaction PINGs before storing non-PING interactions.

limit is optional. Omit it to use the service default:

result = cc.claim(poll=True)

peek returns a cursor for live inspectors and dashboards:

page = cc.peek(poll=True)
nxt = cc.peek(cursor=page.cursor, poll=True)

Call private_key() with no argument to create an in-memory key, or pass your own stored base64url seed string to CcMeClient(private_key=...). private_key(path) creates and reuses a key file, keeping it private to the user (mode 0600) on Unix-like systems.

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

cc_me-0.1.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

cc_me-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file cc_me-0.1.0.tar.gz.

File metadata

  • Download URL: cc_me-0.1.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_me-0.1.0.tar.gz
Algorithm Hash digest
SHA256 925743d14b1bd21c1e1c379bc0c81604bc4d2019a3974ba15a2d60c96af69a5a
MD5 b4a241f47cae5c28a58505b75b60dcc6
BLAKE2b-256 f607d7e05ac8785182cb1a2524e78987c63c21ded271aeb135bccef07d3b8245

See more details on using hashes here.

File details

Details for the file cc_me-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cc_me-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.11","id":"zokor","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cc_me-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0b580690450284965c07da5e1981511501f5e0e3453b33d4e970c7d4dbbf310
MD5 c6fc998c947c7efd3ee3697fdde0e2cf
BLAKE2b-256 0e81a18589c9c2c4a29686967c6df951ece6de3b95c1e35fc629c43bebf72e0a

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