Skip to main content

Rare platform integration kit for Python services

Project description

rare-platform-sdk

Python toolkit for platforms integrating Rare with adoption-first defaults.

Integration Modes

  • public-only / quickstart: start here
  • full-mode / production: add platform registration, durable stores, full attestation, and event ingest

Quickstart reduces first integration to:

  • one required env: PLATFORM_AUD
  • two auth endpoints
  • one session dependency or helper

Quickstart

pip install rare-platform-sdk
from rare_platform_sdk import (
    InMemoryChallengeStore,
    InMemoryReplayStore,
    InMemorySessionStore,
    create_rare_platform_kit_from_env,
)

challenge_store = InMemoryChallengeStore()
replay_store = InMemoryReplayStore()
session_store = InMemorySessionStore()

kit = create_rare_platform_kit_from_env(
    challenge_store=challenge_store,
    replay_store=replay_store,
    session_store=session_store,
)

Defaults:

  • RARE_BASE_URL=https://api.rareid.cc
  • RARE_SIGNER_PUBLIC_KEY_B64 auto-discovered from Rare JWKS when omitted
  • PLATFORM_ID derived from PLATFORM_AUD for full-mode workflows

FastAPI

from fastapi import Depends, FastAPI
from rare_platform_sdk import (
    create_fastapi_rare_router_from_env,
    create_fastapi_session_dependency,
)

app = FastAPI()
app.include_router(
    create_fastapi_rare_router_from_env(
        challenge_store=challenge_store,
        replay_store=replay_store,
        session_store=session_store,
        prefix="/rare",
    )
)

require_rare_session = create_fastapi_session_dependency(session_store)

FastAPI is the preferred Python integration path.

Security Notes

Quickstart still enforces:

  • challenge nonce one-time use
  • delegation replay protection
  • identity/delegation triad consistency
  • local attestation verification
  • public-mode governance cap to L1

Production Notes

  • Replace in-memory stores before production
  • Move to full-mode only when platform registration or full attestation is required
  • Keep bearer-token session transport supported even if you add cookie convenience helpers

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.2.0.tar.gz (14.8 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.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rare_platform_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 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.2.0.tar.gz
Algorithm Hash digest
SHA256 18e458c561eb4c0953ff2731e35529abdc5302cbf55b92e154b82d5acebe8fa7
MD5 2d6611405caaab28536eb758049844ef
BLAKE2b-256 a73190a5e3ec1a8df01768d3ab142c4d3d278063af4a59bdae19c09b7cda0dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_platform_sdk-0.2.0.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rare_platform_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 628a43d45cc92ec8fc702d7f3bc283dc39346c149f3f9bc4312e3e188aadca32
MD5 b9267bad9a6df285414428c0ce9e2d47
BLAKE2b-256 b31d5706740b2ea67713390c6826cbe95ca67548347e19a29154244a840b79b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for rare_platform_sdk-0.2.0-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