feat(gateway): introduce gateway enforcement layer and bump to v1.1.3 - #35
Merged
Merged
Conversation
- Implemented BaseGateway, GitHubGateway, and QdrantGateway - Enforced single boundary enforcement for API credentials - Added GatewayError exception wrapper - ContractEnforcer.gate() supports read action type - Bump version to 1.1.3 across package and CHANGELOG
…l deps, and add CI test dependencies
…nner environments
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR introduces the Gateway Enforcement Layer for Scyvera and bumps the package release to v1.1.3.
Previously, runtime gating relied on decorating individual call sites with
@enforcer.gate(...). While effective, it could not physically prevent agent code from bypassing decorators and directly calling third-party SDK clients (Threat T4).The new Gateway Architecture (
BaseGateway,GitHubGateway,QdrantGateway) establishes a single enforcement boundary:PyGithub,qdrant-client) are held privately inside the gateway instances and never exposed.@enforcer.gate(...)using default-deny semantics.GatewayErrorfor deterministic fault isolation.scyvera[github],scyvera[qdrant],scyvera[all]) keep the core Scyvera package lightweight and zero-dependency beyond schema validators.Key Highlights
src/scyvera/gateway.py):BaseGateway: Abstract base class with dependency-injectedContractEnforcer.GitHubGateway: Gated GitHub API interactions (post_comment,close_issue,merge_pr,create_label,read_issue,list_issues,read_pr_files).QdrantGateway: Gated Qdrant operations (search,upsert,delete).src/scyvera/exceptions.py): AddedGatewayErrorto wrap third-party API exceptions.implementations/langgraph/duplicate-issue-detector): Updated nodes to route all external GitHub operations strictly throughGitHubGateway.[project.optional-dependencies]inpyproject.toml(github,qdrant,all,dev)..github/workflows/lint-gateway.ymlto prevent raw API imports outsidegateway.py.publish-pypi.ymlandvalidate-contracts.ymltest environments.tests/test_gateway.py(73 total tests passing).README.mdandCHANGELOG.mdwith gateway documentation.Verification
python -m pytest tests/ -vpasses (73/73 tests).scyvera validate implementations/langgraph/duplicate-issue-detector/contract.yamlpasses.scyvera lint implementations/langgraph/duplicate-issue-detector/contract.yamlpasses (0 warnings).python -m build&twine check dist/*passed with clean distributions.