Skip to main content

eep-gates (Python)

Python port of @eep-dev/gates — access control, commerce negotiation, and service discovery for the Entity Engagement Protocol.

Install

pip install -e .

Usage

from eep_gates import (
    parse_gate_config,
    resolve_access,
    build_402_response,
    ProofVerifier,
    ProofVerifierRegistry,
)

# Parse gate config
config = parse_gate_config({
    "default_tier": "public",
    "tiers": {
        "public": {"requirements": [], "access": ["events.*"]},
        "premium": {
            "requirements": [{"type": "payment", "amount": 10, "currency": "usd", "per": "month"}],
            "access": ["*"],
        },
    },
})

# Resolve access
class PaymentVerifier(ProofVerifier):
    @property
    def supported_types(self):
        return ["payment"]

    async def verify(self, proof, requirement):
        return proof.get("type") == "payment" and bool(proof.get("token"))


registry = ProofVerifierRegistry()
registry.register(PaymentVerifier())
result = await resolve_access(proofs, config, "content.papers", verifier_registry=registry)

if not result.granted:
    resp = await build_402_response(config, "content.papers", proofs)
    return JSONResponse(resp, status_code=402)

Modules

Module Description
models Pydantic data models (requirements, proofs, tiers, commerce)
gate_config Parse, validate, and serialize gate configurations
resource_matcher Wildcard pattern matching for access control
access_resolver Determine tier access from proofs
proof_validator Structural validation + verifier registry
http_402 Build spec-compliant 402 responses
commerce Negotiation state machine + pricing validation
service_listing Service catalog and review validation

Tests

pip install -e ".[dev]"
pytest

License

Apache-2.0

Metadata

Release files for eep-gates 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eep-gates 0.1.0
File Size Uploaded
eep_gates-0.1.0.tar.gz 23.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for eep-gates 0.1.0
File Interpreter ABI Platform
eep_gates-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.7 kB

Release files / eep_gates-0.1.0.tar.gz

Download URL eep_gates-0.1.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
841c40bf9dc9ff80650acde0cc72f128e6383d70cdf04750001ebfa55cc3a740
BLAKE2b-256 checksum
How to use checksums
33cd9b727f7278b942641f68719aac1f3c372cb94dd7ae81c5ac3c5a66cbce15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / eep_gates-0.1.0-py3-none-any.whl

Download URL eep_gates-0.1.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52ae909da024831cdea5e2d01a18026b7ead0082c71a0559eb0ad86d0fd8a448
BLAKE2b-256 checksum
How to use checksums
21607ec3313eb1549ad59a526726de73c33daa477fdc8e1150ea70cd5bc12c74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page