NebulAuth Python SDK Repo
This repository contains the Python package source and test suite for NebulAuth.
Structure
nebulauth_sdk/— package sourcetests/— unit tests + env-gated live testspyproject.toml— package/build metadata
Install (local)
cd "NebulAuth SDKs/Python"
pip install -e .
Quick start
from nebulauth_sdk import NebulAuthClient
client = NebulAuthClient(
bearer_token="mk_at_...",
signing_secret="mk_sig_...",
service_slug="your-service",
replay_protection="strict", # "none" | "nonce" | "strict"
)
# Verify key
verify = client.verify_key(
key="mk_live_...",
request_id="req-123",
hwid="WIN-DEVICE-12345",
)
print(verify.status_code, verify.data)
# Redeem
redeem = client.redeem_key(
key="mk_live_...",
discord_id="123456789012345678",
)
print(redeem.status_code, redeem.data)
# Reset HWID
reset = client.reset_hwid(
discord_id="123456789012345678",
key="mk_live_...",
)
print(reset.status_code, reset.data)
PoP flow support
When you mint PoP credentials from /auth/verify, you can call endpoints with those values:
pop_bootstrap = client.auth_verify(key="mk_live_...", hwid="WIN-DEVICE-12345")
if pop_bootstrap.data.get("valid"):
access_token = pop_bootstrap.data["accessToken"]
pop_key = pop_bootstrap.data["popKey"]
verify_with_pop = client.verify_key(
key="mk_live_...",
use_pop=True,
access_token=access_token,
pop_key=pop_key,
)
Dashboard API usage
from nebulauth_sdk import NebulAuthDashboardClient
dashboard = NebulAuthDashboardClient(
auth={"mode": "bearer", "bearer_token": "mk_at_..."},
)
me = dashboard.me()
users = dashboard.list_users()
session_users = dashboard.list_users(
{
"auth": {"mode": "session", "session_cookie": "session-cookie-value"}
}
)
Notes
- Canonical signing string matches your bot implementation:
METHOD\nPATH\nTIMESTAMP\nNONCE\nBODY_SHA256
- Canonical path strips the base URL path prefix (e.g.
/api/v1) before signing. - NebulAuth may return HTTP 200 with logical denials (e.g.
{"valid": false, "reason": "NOT_FOUND"}). - SDK returns
NebulAuthResponsewith:status_codeokdataheaders
Tests
- Unit/contract tests (mocked HTTP):
python -m unittest discover -s tests -v
- Live integration tests (real API calls, optional):
NEBULAUTH_LIVE_TEST=1 \
NEBULAUTH_BEARER_TOKEN=mk_at_... \
NEBULAUTH_SIGNING_SECRET=mk_sig_... \
NEBULAUTH_TEST_KEY=mk_live_... \
python -m unittest tests.test_live_client -v
Live test env vars:
- Required to enable live tests:
NEBULAUTH_LIVE_TEST=1
- Required for runtime live tests:
NEBULAUTH_BEARER_TOKENNEBULAUTH_SIGNING_SECRETNEBULAUTH_TEST_KEY
- Required for dashboard live test:
NEBULAUTH_DASHBOARD_BEARER_TOKEN
- Optional:
NEBULAUTH_TEST_HWID
Metadata
Release files for nebulauth-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nebulauth_sdk-0.2.0.tar.gz | 13.1 kB | Without provenance | Details for nebulauth_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nebulauth_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for nebulauth_sdk-0.2.0-py3-none-any.whl |
Total release size: 24.5 kB
Release files / nebulauth_sdk-0.2.0.tar.gz
| Download URL | nebulauth_sdk-0.2.0.tar.gz |
|---|---|
| Size | 13.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a79674965f01d90d39cdbfb7309132030ca91a9f7f521fba827ae95723a69b8e
|
|
BLAKE2b-256 checksum How to use checksums |
56727985f396ea1d7ead6a61aa1a2bb37c2e814880b0b8d4240e844a93751e7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / nebulauth_sdk-0.2.0-py3-none-any.whl
| Download URL | nebulauth_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
285e484948b105a2cef5ae542a210660a58121601cb96e70b115000464330114
|
|
BLAKE2b-256 checksum How to use checksums |
80ad82d733c5229fc14d3aa2d7592cf64594c106752ba1492e20448e46cba7f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for nebulauth-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.