Support fetching intermediates - #103
Conversation
72868f8 to
d299fac
Compare
d299fac to
43acafd
Compare
43acafd to
c9a5dc8
Compare
|
(periodic rebase, nothing to see here) |
c9a5dc8 to
e116a42
Compare
e116a42 to
f9070ba
Compare
not doing this as there doesn't appear to be a way to give openssl an X509_LOOKUP for untrusted certs |
f9070ba to
816722c
Compare
| remote_url: &str, | ||
| local: &Path, | ||
| ) -> Result<Self, Error> { | ||
| pub(crate) fn construct(manifest: &Manifest, ctx: &FetchContext<'_>) -> Result<Self, Error> { |
There was a problem hiding this comment.
Nit: I think the idiomatic abbrevation for "context" in Rust is cx.
| fn should_clean_up_file_name(&self, name: &str) -> bool { | ||
| match self.typ { | ||
| FetchType::Revocation => name.ends_with(".filter") || name.ends_with(".delta"), | ||
| } | ||
| } | ||
|
|
||
| fn requires_revocation_index(&self) -> bool { |
There was a problem hiding this comment.
Feels like these could/should be methods on FetchType?
Also I'm inclined to say that this could/should be a trait instead, so that we can decentralize this setup (that is, collect revocation parameters for fetching in revocation and other stuff elsewhere), rather than centralizing it in fetch.
| use serde::{Deserialize, Serialize}; | ||
| use tracing::info; | ||
|
|
||
| use crate::revocation::Error; |
| pub files: Vec<ManifestFile>, | ||
| } | ||
| #[derive(Debug, Clone, Serialize, Deserialize)] | ||
| pub struct Manifest(data::Manifest); |
There was a problem hiding this comment.
I'm not sure this type still makes sense? The remainder of from_config() seems like it could be generic to data::Manifest and verify() could be a free function?
| pub mod revocation; | ||
|
|
||
| /// Common data storage formats. | ||
| pub mod data; |
There was a problem hiding this comment.
I think the revocation mod declaration and the import from it should be kept together.
| fetch-url = "" | ||
|
|
||
| [intermediates] | ||
| enabled = false |
There was a problem hiding this comment.
Instead of enabled, I think we should make intermediates (and revocation) Option in the top-level Config?
| config_write: impl FnOnce(&TempDir, &str), | ||
| ) -> (TempDir, PathBuf, SettingsBindDropGuard) { | ||
| let temp = TempDir::new().unwrap(); | ||
| write_config(&temp, fetch_url); | ||
| config_write(&temp, fetch_url); |
There was a problem hiding this comment.
The difference between config_write and write_config seems too subtle to be both useful and not confusing.
This is currently behind a config flag. So existing uses won't change.