Skip to main content

Client and manager helpers for CyberLicensing

Project description

CyberLicensing Python SDK

Utilities for integrating with the CyberLicensing service.

Installation

For now, install directly from the project root:

pip install cyberlicensing

Client-side usage

from cyberlicensing import LicenseClient

client = LicenseClient(
    base_url="https://licensing.showdown.boo",
    project_id=1,
)
result = client.validate_with_environment("LICENSE-KEY-1234")
print(result)

validate_with_environment automatically gathers HWID/IP metadata and sends it along with the required project_id. Use validate_license if you want to provide your own context.

The request body sent to the public endpoint /api/validate_license is compatible with the API contract:

{
  "project_id": 1,
  "key": "LICENSE-KEY-1234",
  "hwid": "unique-hardware-id",
  "metadata": {
    "plan": "enterprise",
    "seats": 10
  }
}

Manager-side usage

from cyberlicensing import ManagerClient

manager = ManagerClient(base_url="https://licensing.showdown.boo")
manager.authenticate("admin", "password")
projects = manager.list_projects()
project_id = projects[0]["id"]
license_data = manager.create_license(
    project_id,
    days_valid=30,
    metadata={"plan": "pro"},
)

# Update or revoke a license
manager.update_license(
    license_id=license_data["id"],
    is_active=False,
    metadata={"plan": "revoked", "notes": "Chargeback"},
)

Additional helpers:

  • list_licenses(project_id) – list all licenses (keys + live metadata and usage counters) for a project
  • create_license(project_id, days_valid=None, metadata=None) – generate a new license key
  • update_license(license_id, is_active=None, expires_at=None, reset_hwid=False, metadata=None) – ban/disable, move expiration, reset HWID, or overwrite metadata
  • extend_license(project_id, license_id, days) – convenience method to push expiration forward
  • delete_license(license_id) – hard-delete a key

Environment helpers

from cyberlicensing import collect_environment_metadata

print(collect_environment_metadata())

Returns HWID, hostname, LAN IP, and (if available) public IP.

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

cyberlicensing-0.2.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

cyberlicensing-0.2.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cyberlicensing-0.2.2.tar.gz.

File metadata

  • Download URL: cyberlicensing-0.2.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cyberlicensing-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c51641f442edd3488c46ff58481764db215877157bbba367ee2e318fd7736d20
MD5 7b85a1d82fc08e8bf604a7b676b488d4
BLAKE2b-256 4fc536e944010dd5514dcd13807c76d3c7b10edbeabb883e27d9cab699274126

See more details on using hashes here.

File details

Details for the file cyberlicensing-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: cyberlicensing-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for cyberlicensing-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 962a9ed506c1ebb3e644d9e255f45444ad99ed88015e6a6c6347775d07d8781a
MD5 27e09f765fb68f8234f4bd4d7cad12c5
BLAKE2b-256 b57b03274b3a378747951533506a5350b0c62abdac959ed0c6512b1a4fc6ec99

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