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.3.tar.gz (1.9 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.3-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: elara_wrapper-0.0.3.tar.gz
  • Upload date:
  • Size: 1.9 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.3.tar.gz
Algorithm Hash digest
SHA256 3d91d8de220925cd3579b62557946266f9872d9ba2e12d0fdf15c6ccb1a519d7
MD5 53dca74b8a991a40f2d09cded9c4bd3b
BLAKE2b-256 550a3e4b4e894c3cabb963f9676923755bbe3dbd60516adff75519bc42d72823

See more details on using hashes here.

File details

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

File metadata

  • Download URL: elara_wrapper-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 2.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b662e1820e3825b1108ec56dcdb0c4b0618b176fbb1137ca1f1b6459bf6afaeb
MD5 18d229b7cbb8acf2d937ecd42da1b3be
BLAKE2b-256 dc7bc161aedce5b0f5daf5ca4ec97b8fe17f18b8f419158d4d2dfc6a6d2ea461

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