Skip to main content

A FastAPI middleware package to validate requests to Elara agents based on the permissions set in their ENS name.

Project description

Elara Wrapper

A FastAPI middleware package to validate requests to Elara agents based on the permissions set in their ENS name.

Installation

pip install elara-wrapper

Usage

Basic Usage

import os
from fastapi import FastAPI
from elara_wrapper import add_elara_middleware

app = FastAPI()

# Add the Elara middleware with the agent name automatically injected in Oasis ROFL
middleware = add_elara_middleware(app, os.getenv("ELARA_AGENT_ENS_NAME"))


@app.get("/")
async def root():
    return {"message": "Hello World"}

Development

This package uses Poetry for dependency management:

poetry install
poetry run python example_usage.py

License

MIT License

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

elara_wrapper-0.0.8.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

elara_wrapper-0.0.8-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file elara_wrapper-0.0.8.tar.gz.

File metadata

  • Download URL: elara_wrapper-0.0.8.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.5.0

File hashes

Hashes for elara_wrapper-0.0.8.tar.gz
Algorithm Hash digest
SHA256 0088302b5d1b001bf72226d573645c5eb19a749134269984bf0ec739edc1e8e2
MD5 81be1165ed0e9e3f8047f5cc03fe66fc
BLAKE2b-256 4e94c2a4415413b2bf7c16c6e2a7b672198eabcd5be983117b14f3643eada961

See more details on using hashes here.

File details

Details for the file elara_wrapper-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: elara_wrapper-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.5.0

File hashes

Hashes for elara_wrapper-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4f76de89fc5d502062708d1021825518fe831965bd04dc760afc207e2a827505
MD5 18bfbc80f4533cd5917ca87cc1dca308
BLAKE2b-256 7d254c0ffcf559ba595dcfe2b838243d28c2e0e405e518855ef7e7c9de9c6426

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