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)
| File | Size | Uploaded | |
|---|---|---|---|
| eep_gates-0.1.0.tar.gz | 23.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|