Monkey patch for the InstallRequirement.install method It collects the package information and sends it to aura for security audit User then has a choice to proceed or abort the installation process based on audit results
(
self, # type: InstallRequirement
*args,
**kwargs
)
| 89 | |
| 90 | |
| 91 | def mp_install_requirement( |
| 92 | self, # type: InstallRequirement |
| 93 | *args, |
| 94 | **kwargs |
| 95 | ): |
| 96 | """ |
| 97 | Monkey patch for the InstallRequirement.install method |
| 98 | It collects the package information and sends it to aura for security audit |
| 99 | User then has a choice to proceed or abort the installation process based on audit results |
| 100 | """ |
| 101 | data = { |
| 102 | "format": "0.1", |
| 103 | "cmd": sys.argv, |
| 104 | "name": self.name, |
| 105 | "path": self.source_dir or self.local_file_path, |
| 106 | "wheel": self.is_wheel, |
| 107 | "is_pinned": self.is_pinned, |
| 108 | "editable": self.editable, |
| 109 | "update": getattr(self, "update", False), |
| 110 | "hash": self.link.hash, |
| 111 | "filename": self.link.filename, |
| 112 | "url": self.link.url, |
| 113 | "dependency_chain": get_dependency_chain(self), |
| 114 | } |
| 115 | check_package(data) |
| 116 | InstallRequirement._orig_install(self, *args, **kwargs) |
| 117 | |
| 118 | |
| 119 | def monkey_patch(): |
nothing calls this directly
no test coverage detected