-
Notifications
You must be signed in to change notification settings - Fork 275
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
ngclient updater: API functions argument validation #1594
Comments
I will document some of my thoughts:
|
let's leave this on back burner until #1580 is resolved: arguments (and how they are used) is likely to change slightly
|
I have updated the issue description addressing the new changes merged in #1604.
|
What do you think @jku? Am I correct in my assumptions? Then, the only one left is |
WRT validating TargetFile arguments, I guess the potential check would be "is this really a TargetFile instance?" but considering that A) we support static type checking (well almost anyway: #1633) and B) there is never any need to modify the targetfile in application code C) it will fail pretty gracefully anyway, I don't think that check is needed...
I think this currently ends up complaining that repository_dir/root.json does not exist -- which seems like an accurate description of the problem: the updater isn't interested in just the directory, it needs a directory with a root.json. So potentially we don't need to do anything here: I'm fine with that |
@jku I assume you agree with my thoughts about the rest of the attributes? I agree with your thoughts about |
Yep, I think we agree here, let's close |
Description of issue or feature request:
In the
tuf/ngclient/updater.py
module we are providing a couple API functions with arguments:Updater.__init__
,get_one_valid_targetinfo
,updated_targets
anddownload_targets
.It seems to me it's a good idea to decide which arguments in those functions require validation and if there should be any what it should be.
Current behavior:
No validation is done for:
repository_dir
inUpdater.__init__()
target_path
inUpdater.get_targetinfo()
targetinfo
inUpdater.download_target()
target_base_url
inUpdater.download_target()
Expected behavior:
Decide if we want to add validation and if there is any what it should be:
repository_dir
inUpdater.__init__()
target_path
inUpdater.get_targetinfo()
targetinfo
inUpdater.download_target()
target_base_url
inUpdater.download_target()
The text was updated successfully, but these errors were encountered: