Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request greenbone#1717 from greenbone/single-crate
Change rust project structure to a main crate. Most of the previous crates are now modules of the main crate. This PR doesn't make any functional changes. Here is how the workspace structure changed: src crates/ smoketest nasl-c-lib nasl-function-proc-macro The three crates are separate for the following reasons: smoketest has a custom makefile. I don't know why this is necessary, but didn't want to make any functional changes, so I left it as a subcrate nasl-c-lib has a custom build.rs. This could be ported to be a submodule too, but since I don't know whether it will stay around, I left it as a subcrate. nasl-function-proc-macro needs to be a subcrate, since proc macros can not be part of the main code base. The main crate is now called scannerlib (happy for any input on how to name it instead). This name is only used inside of the binaries (scannerctl/openvasd) to import items from the library. The src folder looks like: nasl syntax interpreter utils builtin host string misc ... storage file json redis scanner scheduling feed feed_verifier models notus openvas openvasd osp plugin_scheduler scannerctl There are some minor cosmetic changes besides the crate structure: Added a NASL prelude. This makes it easy to include the necessary items to begin writing nasl functions: use crate::nasl::prelude::*;. This automatically imports things such as NaslValue, NaslResult, Context, Register, FromNaslValue, ToNaslResult, nasl_function and function_set!. Added a NASL test prelude. Can be used in tests and automatically imports the TestBuilder and utility functions via use crate::nasl::test_prelude::* Added allow(unused) to plugin_scheduler. This wasn't previously needed but the new structure makes it apparent that this isn't currently used. Added allow(unused) to osp::ScanCommand::Get and removed osp::connection::get_scan which was unused. Moved dep_graph into plugin_scheduler module. For now, I moved most readme.md into their respective module and included them as a docstring for the module. We can change this in the future if we want. Currently, there are two crates that need two different versions simultaneously: rustls-pemfile and generic-array. I added two separate versions explicitly. We should open a ticket to update the code that requires the old one to a newer version.
- Loading branch information