Skip to main content

SDK that every SkyDefended-coupled App must integrate to expose its operational plane to NCN operators via outbound-only telemetry and command polling.

Project description

@nexocyber-networks/operator-surface — Python runtime

Python port of the TypeScript SDK. Same model, same TTLs, same wire formats — different language idiom (async/await, pydantic v2, contextmanagers).

Status: v0.2.0 — partial parity with TS v0.3.x. 5 modules shipped (bootstrap, bundle sync, credential refresh, infra audit push, app token introspect). Signed envelope App→Engine lands in v0.3.0 (next milestone). See CHANGELOG.md.

Install

pip install nexocyber-networks-operator-surface

(Or with uv add, poetry add, etc.)

Why it exists

If your App is a Python service (FastAPI, Flask, Django, plain asyncio) that gets coupled to a SkyDefended deployment, this SDK is not optional. It encodes the operator-surface contract: outbound-only push, signed envelopes, replay-protected JWTs, audit queue with retry, policy bundle verification.

Reimplementing those locally is anti-pattern Doc 19 §3 — drift between runtimes silently breaks the trust model.

Quick start (bootstrap)

import asyncio
import os
from skydefended_operator_surface import bootstrap_app

async def main() -> None:
    creds = await bootstrap_app(
        control_api_url=os.environ["CONTROL_API_URL"],
        app_slug=os.environ["APP_SLUG"],
        bootstrap_token=os.environ["BOOTSTRAP_TOKEN"],
        node_id=os.environ.get("NODE_ID"),
    )
    # `creds` now has:
    #   appSlug, appId, serviceCredential, credentialVersion,
    #   privateKeyPem, publicKeyPem, kid
    # Persist them (Vault, file, etc.) and pass into the rest of the SDK.
    print(f"bootstrapped {creds.app_slug} kid={creds.kid}")

asyncio.run(main())

See docs/ for the per-module guides.

API parity with TS

TS export Python export
bootstrapApp() skydefended_operator_surface.bootstrap_app
createEngineSigner() skydefended_operator_surface.create_engine_signer
createPolicyBundleSync() skydefended_operator_surface.create_policy_bundle_sync
createCredentialRefresher() skydefended_operator_surface.create_credential_refresher
createInfraAuditQueue() skydefended_operator_surface.create_infra_audit_queue
createAppTokenIntrospector() skydefended_operator_surface.create_app_token_introspector

TTLs (wrapper 60s, bundle 5min poll / 24h TTL / 7d grace, introspect positive 30s, credential refresh at 80%, jti dedup 60s) are constants exported from the top-level namespace — exactly the same values as the TS runtime. CI runs shared fixtures against both runtimes.

Versioning

Lock-step with the TS SDK at the minor level. When TS ships 0.3.x, Python ships 0.3.x in parallel with the same change set. Patch-level fixes can diverge.

License

UNLICENSED — internal NCN SDK.

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

nexocyber_networks_operator_surface-0.3.11.tar.gz (92.2 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file nexocyber_networks_operator_surface-0.3.11.tar.gz.

File metadata

File hashes

Hashes for nexocyber_networks_operator_surface-0.3.11.tar.gz
Algorithm Hash digest
SHA256 5d5e11966b60408a7f0f76677f94a2947303104f6eae277f5b26340817268c5a
MD5 78f40fda373af03414272e8b7cc0794e
BLAKE2b-256 f3962e9ed8b16ff016f17562579f845c129121e8bb8ba499106ddf36b3b3df8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexocyber_networks_operator_surface-0.3.11.tar.gz:

Publisher: publish.yml on NexoCyber-Networks/skydefended-app-operator-surface-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexocyber_networks_operator_surface-0.3.11-py3-none-any.whl.

File metadata

File hashes

Hashes for nexocyber_networks_operator_surface-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 d7c0d7bd73f249f880c6660d3e03e157863907caa8be49c1f028411dbca7f214
MD5 6e633b555b09402751357f091d782403
BLAKE2b-256 f3514f385ad43931d87cb34fd48a35527896a5c11d78f06ca1f35413017ede15

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexocyber_networks_operator_surface-0.3.11-py3-none-any.whl:

Publisher: publish.yml on NexoCyber-Networks/skydefended-app-operator-surface-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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