Repository navigation
feat: add Python PyO3 bindings (Phase 3) - #8
Merged
Merged
Conversation
Native extension via PyO3/maturin exposing the full ressrf-core API: - CorePolicy, CorePolicyBuilder, CoreUriValidator in Rust - Pythonic Policy wrapper with preset factories and fluent builder - AuditSink Protocol (PEP 544) + AuditFunc callback adapter - RessrfBlockedError with structured .reason dict - Protocol modules: tcp, http (httpx/requests), ssh (paramiko) - Optional extras: ressrf[httpx], ressrf[requests], ressrf[ssh] - Cross-language conformance tests against shared JSON vectors - Type stubs (_core.pyi) and py.typed marker for PEP 561 - Tooling: ruff (format+lint), ty (type checking), uv (env)
gonzaloserrano
added a commit
that referenced
this pull request
May 27, 2026
A 601-line hand-styled HTML comparison page that lived in
go-native/ressrf/docs/ as porting-decision rationale during the
native-port standalone repo's life. It was imported as-is when the
port moved into this monorepo.
Two problems with keeping it:
- It's in the package's docs/ directory, so pkg.go.dev and any
repo browser sees a 601-line page about an unrelated upstream
PR alongside the legitimate how-it-works walkthrough.
- "PR #25" will close or merge; after that the comparison becomes
orphan-context nobody will know is safe to delete.
The comparison's purpose was to justify the port. The port has
happened (merged into timescale/ressrf as the go-native binding);
future readers wanting "why a native port?" can read the
integration PR's description rather than a 601-line HTML page in
docs/. git history preserves the file for anyone who needs it.
No inbound references confirmed via grep across *.md / *.go / *.html
/ *.yml.
Addresses td-code-review finding #8.
gonzaloserrano
added a commit
that referenced
this pull request
May 27, 2026
A 601-line hand-styled HTML comparison page that lived in
go-native/ressrf/docs/ as porting-decision rationale during the
native-port standalone repo's life. It was imported as-is when the
port moved into this monorepo.
Two problems with keeping it:
- It's in the package's docs/ directory, so pkg.go.dev and any
repo browser sees a 601-line page about an unrelated upstream
PR alongside the legitimate how-it-works walkthrough.
- "PR #25" will close or merge; after that the comparison becomes
orphan-context nobody will know is safe to delete.
The comparison's purpose was to justify the port. The port has
happened (merged into timescale/ressrf as the go-native binding);
future readers wanting "why a native port?" can read the
integration PR's description rather than a 601-line HTML page in
docs/. git history preserves the file for anyone who needs it.
No inbound references confirmed via grep across *.md / *.go / *.html
/ *.yml.
Addresses td-code-review finding #8.
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
ressrf-coreAPI (Policy, PolicyBuilder, CIDR, UriValidator, CloudProvider)Policy.external_only(cloud=["aws"]), fluentPolicyBuilder,RessrfBlockedErrorwith structured.reasondictsafe_getaddrinfo,create_connection), HTTP (httpxSafeTransport, requestsSafeAdapter), SSH (safe_ssh_connectvia paramiko)AuditSinkProtocol (PEP 544),AuditFunccallback adapter,MultiSink,DiscardSink(no built-in logger implementations)ressrf[httpx],ressrf[requests],ressrf[ssh],ressrf[all]tests/vectors/*.json(same vectors as Rust and Go)Test plan
maturin developbuilds the native extension successfullypytestpasses 40 tests (6 skipped for optional protocol deps)ruff format --checkandruff checkreport zero issuesty checkpasses with zero diagnostics