Skip to main content

Rare platform integration kit for Python services

Project description

rare-platform-sdk

Python toolkit for third-party platforms integrating Rare with local verification-first defaults.

What It Is

rare-platform-sdk helps Python services issue Rare auth challenges, complete login, verify delegated signed actions, manage platform sessions, and optionally ingest signed negative-event signals back into Rare.

Who It Is For

  • Python and FastAPI platforms adding Rare login
  • Backend teams that want local identity/delegation verification
  • Integrators that need Redis-backed replay protection and session storage

Quick Start

pip install rare-platform-sdk
from rare_platform_sdk import (
    InMemoryChallengeStore,
    InMemoryReplayStore,
    InMemorySessionStore,
    RareApiClient,
    RarePlatformKitConfig,
    create_rare_platform_kit,
)

rare = RareApiClient(rare_base_url="https://api.rareid.cc")
kit = create_rare_platform_kit(
    RarePlatformKitConfig(
        aud="platform",
        rare_api_client=rare,
        challenge_store=InMemoryChallengeStore(),
        replay_store=InMemoryReplayStore(),
        session_store=InMemorySessionStore(),
    )
)

FastAPI integration:

from fastapi import FastAPI
from rare_platform_sdk import create_fastapi_rare_router

app = FastAPI()
app.include_router(create_fastapi_rare_router(kit, prefix="/rare"))

Production Notes

  • Challenge nonces must be one-time use.
  • Delegation replay protection must be atomic.
  • Full identity mode requires payload.aud == expected_aud.
  • Identity triad must match: auth_complete.agent_id == delegation.agent_id == attestation.sub
  • Public identity mode is capped to L1 effective governance.

Development

pip install -r requirements-test.lock
pip install -e .[test] --no-deps
pytest -q
python -m build

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

rare_platform_sdk-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

rare_platform_sdk-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file rare_platform_sdk-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for rare_platform_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ddb8cef32756d7fe0fe90cca3e0b60a536e94fb3c7522c1ad002ed3afc8b586d
MD5 ebab7f455695f6ce9820b3dbddf2ce22
BLAKE2b-256 435ec70288178607cdfe2895fc12665eef6f6d44b8f5e88a659d5410e547a2a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_platform_sdk-0.1.1.tar.gz:

Publisher: publish-python-packages.yml on Rare-ID/Rare

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

File details

Details for the file rare_platform_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rare_platform_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83f8ad3ef90af1e8d3dbf0fd89e433acef688928cd093f9a96fadb4c4af31f63
MD5 7aa3bfbec83c725876cbe2fbb5b41b59
BLAKE2b-256 7e8b8da71d9e3504c6384b922dea73b564d2041b1b318d8c455796a19fb7f6c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_platform_sdk-0.1.1-py3-none-any.whl:

Publisher: publish-python-packages.yml on Rare-ID/Rare

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