fix: /api/scan returns scan_only flag + -S flag handling in client
- server.py: /api/scan now includes scan_only in response - client: -S <pkg> flag properly stripped (was treated as package name) - client: detects scan_only from scan response to decide local vs repo
This commit is contained in:
@@ -103,6 +103,7 @@ async def scan_package(package: str) -> dict[str, Any]:
|
|||||||
"version": source.package.version,
|
"version": source.package.version,
|
||||||
"ioc_matches": result.ioc_matches,
|
"ioc_matches": result.ioc_matches,
|
||||||
"typosquat_matches": result.typosquat_matches,
|
"typosquat_matches": result.typosquat_matches,
|
||||||
|
"scan_only": cfg.server.scan_only,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -298,6 +298,13 @@ for ioc in d.get('ioc_matches',[]):
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# -S <pkg>: Install mode (same as default, but skip flags)
|
||||||
|
INSTALL_MODE=false
|
||||||
|
if [ "$1" = "-S" ]; then
|
||||||
|
INSTALL_MODE=true
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
# --noinstall mode (scan only, don't build/install)
|
# --noinstall mode (scan only, don't build/install)
|
||||||
NOINSTALL=false
|
NOINSTALL=false
|
||||||
if [ "$1" = "--noinstall" ] || [ "$1" = "--scan-only" ]; then
|
if [ "$1" = "--noinstall" ] || [ "$1" = "--scan-only" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user