Repository navigation
refactor(privacy): extract the secret detector into the uteke-privacy crate - #1737
Merged
Merged
Conversation
… crate Move the pure detector (rules, entropy checks, allowlist, idempotent redaction) from uteke-core into crates/uteke-privacy (regex only, no IO). uteke-core depends on it and re-exports it from uteke_core::privacy, so callers and behaviour are unchanged. Release workflow publishes uteke-privacy first. Refs #1732
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 13, 2026
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.
What
crates/uteke-privacy(regex only, no IO, no uteke-core dependency) holding the pure secret detector: AWS, GitHub, npm, Slack, Google keys, bearer, JWT, URL passwords,NAME=valuewith entropy checks, the allowlist, idempotent redaction and the masked shapes.redact(&str, &Policy) -> Redacted { text, counts },Policy(allowlist,from_patterns),PolicyError,RedactionCount,compile_allowlist,redact_with_allowlist. An optionalserdefeature (off by default) derives Serialize/Deserialize forRedactionCount; uteke-core turns it on.uteke-coredepends on it and re-exports it fromuteke_core::privacy(redact(&str, &[Regex]),Redactionalias,RedactionCount,compile_allowlist,PrivacyConfig,PrivacyMode,load_config, ...). The config, modes,Preparedand flag helpers stay in core. No source change in cli, server or mcp.docs/privacy-filter-cases.jsontest now runs in the new crate. Added aPolicytest and a README doctest.release.ymlpublishesuteke-privacyfirst and waits for it before uteke-core, mcp, cli and server; the crates.io verify loop includes it. AGENTS.md (crate list, version rule, release steps, mutation gate diff now coverscrates/uteke-privacy), AGENT.md, CONTRIBUTING.md, docs/architecture.md, docs/mutation-testing.md,.cargo/mutants.tomland CHANGELOG updated. CI jobs and dependabot already use workspace-wide scope.Why
tole needs the same unknown-secret detection on its egress paths, and a published crate cannot depend on unpublished or heavy code; uteke-core pulls SQLite, reqwest and tokio. One ruleset for both projects (owner decision in #1732). No new rules and no behaviour change.
Conservative choices: the old
redact(&str, &[Regex])signature is kept in core for compatibility, andRedactionCountserde is behind an optional feature so the default dependency set staysregexonly. The cases test readsdocs/privacy-filter-cases.jsonfrom the repo, so it only runs in a checkout, not from the published tarball.Refs #1732. Remaining: the crates.io publish is the owner's action (the release workflow will publish it on the next tag).
Testing
cargo fmt --all -- --checkcleancargo clippy --workspace --all-targets -- -D warningscleancargo test --workspace: 1738 passed, 0 failed (uteke-privacy: 17 unit + 2 doctests; uteke-core privacy tests: 26)cargo package -p uteke-privacy --listandcargo publish --dry-run -p uteke-privacy --allow-dirtysucceed (dry run only)