Skip to content

refactor: take the scanners out of the proxy, and drop a vendored rule file - #105

Merged
CharmingGroot merged 1 commit into
mainfrom
refactor/separable-adapters
Sep 1, 2026
Merged

CharmingGroot merged 1 commit into
mainfrom
refactor/separable-adapters

Conversation

@CharmingGroot

Copy link
Copy Markdown
Owner

Three things were welded together that should not have been, and one file did not belong in the repository.

The proxy compiled scanners nobody asked for

pasu-proxy depended on both scanner crates unconditionally. A deployment wanting neither compiled both; one wanting a scanner this repository has never heard of had to remove these first.

They are optional features now, and the proxy builds and runs with no scanner at all:

cargo build -p pasu-proxy --no-default-features

CI builds that combination and each feature alone. A use added outside a cfg compiles fine with defaults on and breaks only for the person building without them — who is exactly the person least able to report it.

The adapter was trapped in the proxy

The pii-kr adapter lived in pasu-proxy, which made the proxy the only thing able to use it.

It could not simply move into pasu-pii-kr either: that crate depends on no pasu crate, and that is precisely what lets a gateway which has never heard of pasu use the scanner. So the adapter is its own crate, and both sides stay free — the scanner dependency-free, the adapter available to any host.

The policy was proxy-local

redact::Policy is now in pasu-core. What a finding means — refuse, or replace — is the same question wherever an inspector runs, and a second host answering it separately is the drift a security tool cannot afford.

A vendored rule file

tests/fixtures/ held example_recognizers.yaml copied verbatim out of another project. Reading a published format is reference; carrying another project's file is not, and a test fixture is not an exception to that.

Replaced by one written here, chosen for the cases the importer has to survive rather than for realism — a weak pattern, a deny list and an ordinary pattern in one document, where a partial failure has somewhere to hide.

docs/adapting.md

A structure nobody can find their way into is not adaptable. It maps the seams, says which trait to implement for what, and states the two non-negotiable rules for an inspector: every occurrence rather than the first, and a Finding that never carries the matched value.

🤖 Generated with Claude Code

…e file

Three things were welded together that should not have been.

The proxy depended on both scanner crates unconditionally. A deployment wanting
neither compiled both, and one wanting a scanner this repository has never heard
of had to remove these first. They are optional features now, and the proxy
builds and runs with no scanner at all — CI builds that combination and each
feature alone, because a `use` added outside a cfg compiles fine with defaults on
and breaks only for the person building without them, who is exactly the person
least able to report it.

The pii-kr adapter lived inside the proxy. That made the proxy the only thing
able to use it. It could not move into pasu-pii-kr either, because that crate
depends on no pasu crate and that is precisely what lets a gateway which has
never heard of pasu use the scanner. So it is its own crate, and both sides stay
free: the scanner dependency-free, the adapter available to any host.

redact::Policy was proxy-local. What a finding means — refuse, or replace — is
the same question wherever an inspector runs, and a second host answering it
separately is the drift a security tool cannot afford. It is in pasu-core.

Separately: tests/fixtures held example_recognizers.yaml copied verbatim out of
another project. Reading a published format is reference; carrying another
project's file is not, and a test fixture is not an exception to that. It is
replaced by one written here, chosen for the cases the importer has to survive
rather than for realism — a weak pattern, a deny list, an ordinary pattern in one
document, where a partial failure has somewhere to hide.

docs/adapting.md says what the seams are and what to implement on each, since a
structure nobody can find their way into is not adaptable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CharmingGroot
CharmingGroot merged commit f68fd19 into main Sep 1, 2026
5 checks passed
@CharmingGroot
CharmingGroot deleted the refactor/separable-adapters branch September 1, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant