feat: add firewall-wrapped pkgmgr commands for npm, pip, maven, and dotnet - #66
Merged
Conversation
…otnet Wraps native install/restore commands with 403 detection and bulk firewall evaluation of the full dependency graph. Also fixes configure_maven's mirrorOf:"*" breaking core plugin resolution, and a .npmrc duplication bug.
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
Adds five
execute artifact:*commands that wrap native package managercommands with Harness firewall protection:
npm_install,npm_ci,pip_install,mvn_install,dotnet_restore.Each wrapper runs the native tool as-is. On a 403/forbidden failure, it
resolves the full dependency graph (including transitive deps) and submits
it for bulk Harness firewall evaluation, printing BLOCKED/WARN/ALLOWED
results.
What's included
pkgmgr_orchestrator.go— shared flow: detect registry → resolve UUID →run native command → on 403, resolve deps + firewall evaluation.
pkgmgr_client.go+ one file per client (npm/pip/maven/nuget).configure_*.go— each now persists registry info to~/.harness/<client>-pkgmgr.jsonfor the wrappers to read.Bug fixes bundled in
configure_maven.go: replacedmirrorOf: "*"with an additive<repositories>/<pluginRepositories>profile — the mirror wasintercepting Maven's own core plugin lookups too, breaking
mvn installon every registry tested.configure_npm.go: fixed.npmrcduplicatingregistry=/always-authlines on repeatedconfigure registryruns.Testing
mvn installandexecute artifact:mvn_installvalidated end-to-endagainst two live registries (hosted + upstream-proxy).
.npmrcdedup fix verified across repeated runs.