-
Notifications
You must be signed in to change notification settings - Fork 278
Split Updater into logical components: redesign mirrors.py and download.py #1307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Temporary disable (inline) undefined-loop-variable pylint checks until the download functionality is revised (theupdateframework#1307) Signed-off-by: Teodora Sechkova <[email protected]>
Temporary disable (inline) undefined-loop-variable pylint checks until the download functionality is revised (theupdateframework#1307) Signed-off-by: Teodora Sechkova <[email protected]>
Temporary disable (inline) undefined-loop-variable pylint checks until the download functionality is revised (theupdateframework#1307) Signed-off-by: Teodora Sechkova <[email protected]>
Temporary disable (inline) undefined-loop-variable pylint checks in the new Updater code until the download functionality is revised (theupdateframework#1307). Signed-off-by: Teodora Sechkova <[email protected]>
There is an ongoing work addressing this issue #1331 |
Starting with a reminder of what we want to achieve in a reference implementation: What is the outcome of the efforts on improving the mirrors download code so far, summarised well by @jku in this comment and curated a bit by me:
Given the complications that such logic brings to a clean reference implementation, we suggest dropping the mirrors support for metadata. Going even further, fully drop the mirrors configuration and add the base URL as an optional argument to the This proposal assumes the following scenario. Metadata for a repository is retrieved from a single host address (mirroring by CDNs, for example, is hidden from the client's point of view). TUF client resolves metadata file names to URLs with this single host URL. Target files may be downloaded from any URL provided by the user but the same host URL used for metadata can serve as a default value. |
Thanks. I do agree that this seems like a direction worth exploring (thanks @trishankatdatadog for prodding into this direction). I think a hypothetical API that tries to look as much as it can like the current one would look like this: class Updater:
def __init__(
repository_path: str,
metadata_url: str,
default_target_url: str = None,
fetcher: FetcherInterface = None)
# ... skip refresh et al, they're not interesting here ...
def download_target(
target_name: str,
destination_dir: str,
url: str = None) All As Teodora says, "metadata mirroring" is explicitly not supported here. However, I believe this proposal does not prevent a client from building a setup that functions like current "mirrors configuration" with regards to targets. |
Uh oh!
There was an error while loading. Please reload this page.
Description of issue or feature request:
A clear separation between file download logic and metadata verification in Updater. Design and implement appropriate class, part of the client internals, that performs all metadata/target files download operations.
This should happen together with a redesign of the
mirrors
anddownload
modules and considering the recent addition offetcher
andrequests_fetcher
.Some issues of the current implementation:
the existing functions inClient refactor: code reformatting #1341download.py
make the call stack deeper than necessaryClient refactor: code reformatting #1341safe_download
andunsafe_download
only differ by one boolean flagmirrors.py
contains only a single function parsing the mirror config, sync with mirror_conig design client/updater design: mirror config redesign #1143See related comments: #1291 (comment), #1291 (comment)
The text was updated successfully, but these errors were encountered: