New package @magpie-community/middleware-privacy-gate 0.1.0 (siml1169): a
gateway middleware that refuses image, file and audio parts, encoded blobs
and models outside an allowlist before a request leaves magpie, or in
binaryPolicy "guide" replaces each binary part with a short text note. A
typo in any option falls back to the stricter side; a malformed allowModels
refuses every request.
Reviewed at 2a998b73b4ae5f6ae072f12ea9ef27008692c892 (earlier rounds at
ab8c0ebe and before):
- mote, HOME=$(mktemp -d), Bun 1.4.2, merged onto origin/main 6549b633:
bun test packages/privacy-gate 62 pass; bun scripts/check.mjs ok.
- Broken by hand: the allowModels check off (2 red), guide mode's blob scan
removed (3 red), the mime check removed (1 red).
- magpie's own middleware engine (origin/main 3cbb7e042) with this file:
~90 cases across binaryPolicy typos, guide mode bounds, signatures and
allowModels typos, all as wanted apart from the documented value cap.
Not tried: a real vendor or DSH, streaming bodies, Windows and Linux.
45 lines
1.2 KiB
JSON
45 lines
1.2 KiB
JSON
{
|
|
"name": "@magpie-community/middleware-privacy-gate",
|
|
"version": "0.1.0",
|
|
"description": "Structural egress gate for Magpie's gateway: rejects image, file and audio parts, encoded blobs and models outside the allowlist when Magpie cannot mask them locally; does not mask text. Companion to the ShyPie DSH bundle for DeepSeek Harness.",
|
|
"type": "module",
|
|
"files": [
|
|
"privacy-gate.middleware.js",
|
|
"README.md"
|
|
],
|
|
"keywords": [
|
|
"magpie",
|
|
"magpie-middleware",
|
|
"gateway-middleware",
|
|
"privacy",
|
|
"pii",
|
|
"dlp",
|
|
"security",
|
|
"shypie"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/privacy-gate"
|
|
},
|
|
"magpie": {
|
|
"middleware": "./privacy-gate.middleware.js",
|
|
"options": {
|
|
"allowModels": [],
|
|
"localModels": [],
|
|
"localProviders": [],
|
|
"binaryPolicy": "fail",
|
|
"guideTools": [],
|
|
"allowUnknownProtocol": false,
|
|
"blobBase64Chars": 400,
|
|
"blobHexChars": 400,
|
|
"scanChars": 200000,
|
|
"maxNodes": 40000,
|
|
"maxDepth": 40,
|
|
"logMaxLines": 40,
|
|
"logEveryRows": 50
|
|
}
|
|
}
|
|
}
|