Skip to main content

SDK for integrating services with the Unio agent network

Project description

unio-provider

SDK for integrating your service with the Unio agent network.

Quick Start (10 lines)

from unio_provider import ManifestBuilder, UnioProvider

# Build manifest from your OpenAPI spec
manifest = (ManifestBuilder.from_openapi("openapi.json")
    .service(category="email", tags=["email", "smtp"])
    .security(min_trust_level_required=0, reputation_threshold=0)
    .signup_endpoint("https://api.yourservice.com/unio/signup")
    .build())

# Create provider with auto-validation
provider = UnioProvider(manifest=manifest)

# Register your signup handler
@provider.signup_handler
async def create_agent_account(agent_id, public_key_b64, contact_email,
                                trust_level, reputation_score, delegation_parent=None):
    # Gate access by trust_level / reputation_score
    if trust_level < 1:
        raise UnioSignupRejected("Trust level too low")
    api_key = create_account(agent_id, contact_email)
    return {"credential": api_key, "credential_type": "api_key", "account_id": agent_id}

# Mount on your FastAPI app
from fastapi import FastAPI
app = FastAPI()
app.include_router(provider.router)

Your service now serves /.well-known/unio.json and handles POST /unio/signup with automatic token verification.

Installation

pip install unio-provider

Features

  • ManifestBuilder.from_openapi() — Generate unio.json from any OpenAPI 3.x spec
  • Token verification — Every signup request is verified against Unio Auth
  • Trust & reputation gating — Providers receive trust_level and reputation_score in the signup handler
  • Schema validation — Generated manifests are validated against the Unio JSON Schema

License

Apache-2.0

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

unio_provider-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

unio_provider-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unio_provider-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for unio_provider-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dde4e4285201bc280a9d37766cf1ac61147be824b403837fd44caa920d1a3c02
MD5 8d45c0809dba95ac088932766e5c80fe
BLAKE2b-256 a6dac5cc6202b40629a40774f1745db2dfad820d0ce1bc662bb62313cd745586

See more details on using hashes here.

File details

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

File metadata

  • Download URL: unio_provider-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for unio_provider-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 277cf0cbb218c5d680eeac5df97993c90a75aef3e62db38124cc15e3c8e4be00
MD5 4b7439979c30739ab1c47ff244c869d3
BLAKE2b-256 0d73ff264767f4fcefa5aaa933a61a0bedb20703b7948728ab32ce89850082cd

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