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.12.tar.gz (94.5 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.12.tar.gz.

File metadata

File hashes

Hashes for nexocyber_networks_operator_surface-0.3.12.tar.gz
Algorithm Hash digest
SHA256 d71d7e1adf21b590f7c3097810a93242bd6ada7fc7c829fc3f3102cccce56389
MD5 168aea81d7b876473af537ab1dbc52fd
BLAKE2b-256 168b6ccabb51e7a2c8bfbf7b8c3a16a13d44026d132b3dccc01070effb2cd385

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexocyber_networks_operator_surface-0.3.12.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.12-py3-none-any.whl.

File metadata

File hashes

Hashes for nexocyber_networks_operator_surface-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 597b05b48ab302788f2fa12e9f8f6fc59b36588b88357b80fb16089289111c6a
MD5 fd071583bf52f74b5f6a6859adb648c6
BLAKE2b-256 2a67249a98da3178694e6233ba2dbb2f39d0e1074968436a3a56b61fb58797ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexocyber_networks_operator_surface-0.3.12-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