Skip to content

Commit

Permalink
Revert "chore: support report in vexination walker"
Browse files Browse the repository at this point in the history
This reverts commit c883ec7.
  • Loading branch information
ctron committed Feb 22, 2024
1 parent d4299b3 commit 7add62e
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 217 deletions.
22 changes: 12 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,3 @@ cyclonedx-bom = { git = "https://github.com/carlosthe19916/cyclonedx-rust-cargo"

#cve = { git = "https://github.com/ctron/cve", rev = "77341768d893098f1f8b1397364fecfb16b4d776" } # FIXME: awaiting release
#hide = { git = "https://github.com/ctron/hide", rev = "109059cce66fd85dbe40f59ad40b7dab47b70fe1" } # FIXME: awaiting release

csaf-walker = { git = "https://github.com/ctron/csaf-walker", rev ="dff3991f7a31601a9521f423ab2e49aeffc025ae" } # FIXME: awaiting release
walker-common = { git = "https://github.com/ctron/csaf-walker", rev ="dff3991f7a31601a9521f423ab2e49aeffc025ae" } # FIXME: awaiting release
walker-extras = { git = "https://github.com/ctron/csaf-walker", rev ="dff3991f7a31601a9521f423ab2e49aeffc025ae" } # FIXME: awaiting release
sbom-walker = { git = "https://github.com/ctron/csaf-walker", rev ="dff3991f7a31601a9521f423ab2e49aeffc025ae" } # FIXME: awaiting release
2 changes: 1 addition & 1 deletion bombastic/index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.68"
env_logger = "0.10"
sbom-walker = { version = "=0.6.0-alpha.7", default-features = false, features = ["spdx-rs", "cyclonedx-bom", "crypto-openssl"] }
sbom-walker = { version = "=0.6.0-alpha.6", default-features = false, features = ["spdx-rs", "cyclonedx-bom", "crypto-openssl"] }
6 changes: 3 additions & 3 deletions bombastic/walker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ bzip2 = "0.4"
clap = "4.3.3"
humantime = "2.1.0"
log = "0.4"
sbom-walker = { version = "=0.6.0-alpha.7", features = ["crypto-openssl", "spdx-rs", "cyclonedx-bom"], default-features = false }
sbom-walker = { version = "=0.6.0-alpha.6", features = ["crypto-openssl", "spdx-rs", "cyclonedx-bom"], default-features = false }
serde_json = "1"
spdx-expression = "0.5"
time = "0.3.21"
tokio = "1.28.2"
tracing = "0.1"
url = "2.4.0"
walker-common = "=0.6.0-alpha.7"
walker-extras = "=0.6.0-alpha.7"
walker-common = "=0.6.0-alpha.6"
walker-extras = "=0.6.0-alpha.6"

trustification-auth = { path = "../../auth" }
trustification-infrastructure = { path = "../../infrastructure" }
35 changes: 21 additions & 14 deletions bombastic/walker/src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing::{instrument, log};
use url::Url;
use walker_common::{
fetcher::{Fetcher, FetcherOptions},
sender::{self, provider::TokenProvider, HttpSenderOptions},
sender::{self, provider::TokenProvider},
since::Since,
validate::ValidationOptions,
};
Expand Down Expand Up @@ -55,35 +55,42 @@ impl Scanner {
pub async fn run_once(&self) -> anyhow::Result<()> {
let since = Since::new(None::<SystemTime>, self.options.since_file.clone(), Default::default())?;
let source: DispatchSource = match Url::parse(&self.options.source) {
Ok(url) => {
HttpSource::new(
url,
Fetcher::new(FetcherOptions::default()).await?,
HttpOptions::new().since(*since).keys(self.options.keys.clone()),
)
Ok(url) => HttpSource {
url,
fetcher: Fetcher::new(FetcherOptions::default()).await?,
options: HttpOptions {
keys: self.options.keys.clone(),
since: *since,
},
}
.into(),
Err(_) => FileSource::new(&self.options.source, None)?.into(),
};

let sender = sender::HttpSender::new(
self.options.provider.clone(),
HttpSenderOptions::default()
.additional_root_certificates(self.options.additional_root_certificates.clone()),
sender::Options {
additional_root_certificates: self.options.additional_root_certificates.clone(),
..sender::Options::default()
},
)
.await?;

let storage = walker_extras::visitors::SendVisitor::new(self.options.target.clone(), sender)
.retries(self.options.retries)
.retry_delay(self.options.retry_delay.unwrap_or_default());
let storage = walker_extras::visitors::SendVisitor {
url: self.options.target.clone(),
sender,
retries: self.options.retries,
retry_delay: self.options.retry_delay,
};

let process = ProcessVisitor {
enabled: self.options.fix_licenses,
next: storage,
};

let validation = ValidationVisitor::new(process)
.with_options(ValidationOptions::new().validation_date(self.options.validation_date));
let validation = ValidationVisitor::new(process).with_options(ValidationOptions {
validation_date: self.options.validation_date,
});

let walker = Walker::new(source.clone());
walker.walk(RetrievingVisitor::new(source.clone(), validation)).await?;
Expand Down
4 changes: 2 additions & 2 deletions vexination/walker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ trustification-auth = { path = "../../auth" }
clap = { version = "4", features = ["derive"] }
anyhow = "1"
csaf = "0.5.0"
csaf-walker = { version = "=0.6.0-alpha.7", default-features = false, features = ["crypto-openssl", "csaf"] }
walker-common = { version = "=0.6.0-alpha.7", features = [] }
csaf-walker = { version = "=0.6.0-alpha.6", default-features = false, features = ["crypto-openssl"] }
walker-common = { version = "=0.6.0-alpha.6", features = [] }
url = { version = "2.3.1", features = ["serde"] }
time = "0.3.21"
humantime = "2.1.0"
Expand Down
12 changes: 1 addition & 11 deletions vexination/walker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ pub struct Run {
/// Only upload if a document's name has any of these prefixes.
#[arg(long = "require-prefix")]
pub required_prefixes: Vec<String>,

/// Path of the HTML output file
#[arg(long, default_value = "report.html")]
pub output: PathBuf,

/// Make links relative to this URL.
#[arg(short = 'B', long)]
pub base_url: Option<Url>,
}

impl Run {
Expand All @@ -88,16 +80,14 @@ impl Run {

log::debug!("Policy date: {validation_date:?}");

let options = ValidationOptions::new().validation_date(validation_date);
let options = ValidationOptions { validation_date };

server::run(
self.workers,
self.source,
self.sink,
provider,
options,
self.output,
self.base_url,
self.ignore_distributions,
self.since_file,
self.additional_root_certificates,
Expand Down
Loading

0 comments on commit 7add62e

Please sign in to comment.