Skip to main content

FastAPI server scaffolding for the ARP Standard (v1).

Project description

ARP Standard Python Server (arp-standard-server)

FastAPI server scaffolding for implementing ARP components with spec-aligned request/response types.

Install

python3 -m pip install arp-standard-server

Usage

from arp_standard_server.run_gateway import BaseRunGatewayServer
from arp_standard_server import AuthSettings
from arp_standard_model import (
    Health,
    Run,
    RunGatewayCancelRunRequest,
    RunGatewayGetRunRequest,
    RunGatewayHealthRequest,
    RunGatewayStartRunRequest,
    RunGatewayStreamRunEventsRequest,
    RunGatewayVersionRequest,
    VersionInfo,
)

class MyRunGateway(BaseRunGatewayServer):
    async def cancel_run(self, request: RunGatewayCancelRunRequest) -> Run:
        return ...

    async def get_run(self, request: RunGatewayGetRunRequest) -> Run:
        return ...

    async def health(self, request: RunGatewayHealthRequest) -> Health:
        return ...

    async def start_run(self, request: RunGatewayStartRunRequest) -> Run:
        body = request.body
        # business logic here
        return ...

    async def stream_run_events(self, request: RunGatewayStreamRunEventsRequest) -> str:
        return ""

    async def version(self, request: RunGatewayVersionRequest) -> VersionInfo:
        return ...

app = MyRunGateway().create_app(auth_settings=AuthSettings(mode="disabled"))

Service base classes

  • BaseRunGatewayServer
  • BaseRunCoordinatorServer
  • BaseAtomicExecutorServer
  • BaseCompositeExecutorServer
  • BaseNodeRegistryServer
  • BaseSelectionServer
  • BasePdpServer

Request objects

All server methods accept a single request object from arp_standard_model:

  • *Params for path/query parameters
  • *RequestBody for JSON bodies
  • *Request wrappers with params and/or body

Response payloads

Server methods return the spec-defined payload objects directly (for example: Run, Health, VersionInfo) rather than service-specific *Response wrappers. For forward-compatible additions, use extensions (and metadata where available); arbitrary top-level fields are not allowed by the schemas (additionalProperties: false).

Abstract method enforcement

Base server classes use ABC + @abstractmethod. Instantiating a class that does not implement all required endpoints raises a TypeError before the app is created.

Authentication (JWT Bearer)

app = MyRunGateway().create_app(
    auth_settings=AuthSettings(
        mode="required",
        issuer="https://issuer.example.com/realms/arp",
        audience="arp-run-gateway",
    )
)

See also: docs/security-profiles.md for the standard auth configuration profiles (Dev-Insecure, Dev-Secure-Keycloak, Enterprise).

Streaming (NDJSON)

NDJSON endpoints currently use plain text payloads. Streaming helpers are planned but not implemented yet.

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

arp_standard_server-0.3.3.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

arp_standard_server-0.3.3-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file arp_standard_server-0.3.3.tar.gz.

File metadata

  • Download URL: arp_standard_server-0.3.3.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arp_standard_server-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ef1b4db72e8f3824e6e37d026322d39c514d24534e7967b02bf6d11cccc5da7e
MD5 b6d161a8fa4955eb2c528158254cbc98
BLAKE2b-256 c1f958fba7d7e5d85b02a7a1da179e3cf2742d4750f36c8043f6ccaebcaa9063

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_standard_server-0.3.3.tar.gz:

Publisher: release.yml on AgentRuntimeProtocol/ARP_Standard

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

File details

Details for the file arp_standard_server-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for arp_standard_server-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 be714d05178cecab144c640f6066af50ae8ad7a6a6ae4575b13316309a836d10
MD5 25297e7310cc07e58c778ac6c73c6c60
BLAKE2b-256 17361c8ca0d82cd16a6070269dbfef0475b2a85aab11f1feaf5f55958bc3072d

See more details on using hashes here.

Provenance

The following attestation bundles were made for arp_standard_server-0.3.3-py3-none-any.whl:

Publisher: release.yml on AgentRuntimeProtocol/ARP_Standard

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