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

Uploaded Python 3

File details

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

File metadata

  • Download URL: elara_wrapper-0.0.13.tar.gz
  • Upload date:
  • Size: 3.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.13.tar.gz
Algorithm Hash digest
SHA256 36e235e67d293948904535c92f40cca2c4625b4b6f280c53663af4f4d323031e
MD5 8c239c736c0a3e51a7cf3e1aee87927b
BLAKE2b-256 d9cb7df317223bd7b736a5cef4690475e35bec6dba43e4960744c7c122e441ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: elara_wrapper-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a90bba816d0ff450133fee5bd88ecde2bdd89ebe79147b0889707cd5ceeded66
MD5 9b667cfa07dc2d1589f57450f5b06148
BLAKE2b-256 e8eb622855594a3e4c12982db645e9056e3876819c4edb72ab8fd28336ae51b9

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