Commit graph

340 commits

Author SHA1 Message Date
Vladimir Diaz
1d0f863ef3
Edit README in tuf/client/
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-12 13:59:45 -04:00
Vladimir Diaz
9604224a5d
Remove all_targets() example used in docstring
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-12 13:07:23 -04:00
Vladimir Diaz
c7a57ec65d
Remove the remaining references to all_targets() and targets_of_role()
Note: The update example in the docstring must be revised to use get_one_valid_targetinfo()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-12 12:00:58 -04:00
Vladimir Diaz
28e5fe6564
Add deprecation warning to all_targets() and targets_of_role()
Also remove references to them from a couple docstrings

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-12 11:53:32 -04:00
Vladimir Diaz
f49316177f
Wrap the refresh() line that sets consistent snapshot
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 10:32:06 -04:00
Vladimir Diaz
9b6c91a015
Refresh delegated metadata to fix test_mix_and_match_attack.py failure
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 10:27:22 -04:00
Vladimir Diaz
e92680f850
Fix test_multiple_repositories_integration and edit whitespace in updater.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 10:02:11 -04:00
Vladimir Diaz
43efa42489
Document new refresh() change in its docstring
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 09:56:09 -04:00
Vladimir Diaz
18a5aa4809
Make slight revision to comment about always refreshing top-level metadata in refresh()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-11 09:42:15 -04:00
Vladimir Diaz
47dbdbaf5c
Discuss the special case where metadata is marked obselete and deleted
Also document the assumption that the metadata store is the latest and exists in _update_metadata()

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-06-08 10:20:34 -04:00
Sebastien Awwad
e18d3db1db
Fix 736: Rebuild roledb in refresh() even if root unchanged
In order to avoid freezes if role info is deleted due to prior
validation failures, make sure that roledb is rebuilt during
client tuf.client.updater.refresh(), even if root did not need
to be updated.

See Issue 736 for more details.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2018-05-30 16:24:39 -04:00
Vladimir Diaz
ff183fc053
Convert any backward slashes from path given by client
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-23 11:04:50 -04:00
Vladimir Diaz
903ff0a280
Add comment to affected modules...
explaining why locally generated keyids use the hashing algorithms specified in metadata's 'keyid_hash_algorithms' field.

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-12 11:43:03 -04:00
Vladimir Diaz
55d368d9d4
Make sure the locally generated keyids match metadata's: updater.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-12 11:31:00 -04:00
Vladimir Diaz
2260d773d0
Refactor _get_target_from_targets_role()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-06 16:54:02 -04:00
Vladimir Diaz
fe5d335555
Modify modules to remove/expect no leading path separators
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-06 13:16:41 -04:00
Vladimir Diaz
77cd6325d2
Ensure, e.g., that 'foo.tgz' matches delegation '/foo*'
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-03-02 11:35:32 -05:00
Vladimir Diaz
3660776f80
Add 'ecdsa-sha2-nistp256' to supported delegated key types
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-02-12 16:25:01 -05:00
Vladimir Diaz
8f65fa4154
Rename license files in modules
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-02-05 11:31:19 -05:00
Vladimir Diaz
70b3d4702c
Fix typo in exception message: 'The given target path ...'
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-01-31 13:23:05 -05:00
Vladimir Diaz
e088bdb6cf
Edit outdated setting used in client documentation
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-01-17 17:44:48 -05:00
Vladimir Diaz
576ad2fca6
Add comment explaining which threshold of targetinfo are returned
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-21 16:34:04 -05:00
Vladimir Diaz
f2de8985e8
Add option to exclude custom field when matching targetinfo
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-21 15:54:06 -05:00
Vladimir Diaz
4d3cc84e90
Rename and refactor get_one_valid_targetinfo()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-20 16:44:24 -05:00
Vladimir Diaz
304f0d40c6
Remove unnessary check for empty targetinfo
Also reorder an if-else case to minimize code between the else and opening if clause

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-18 14:30:51 -05:00
Vladimir Diaz
7c77392568
Set repository_names_to_mirrors as a MultiRepoUpdater attribute
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-18 11:58:34 -05:00
Vladimir Diaz
e230d95960
Revise __init__ comment on exceptions raised
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-14 16:25:28 -05:00
Vladimir Diaz
9d9f73df83
Add 'threshold of repositories' to TAP 4 comment
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-14 16:17:46 -05:00
Vladimir Diaz
72d099e5cc
Ensure the map file is properly formatted in __init__
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-14 15:42:44 -05:00
Vladimir Diaz
f40a6d58b7
Add missing continue to targetsinfo loop
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 15:50:50 -05:00
Vladimir Diaz
b6216ac264
Remove bare excepts
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 15:36:38 -05:00
Vladimir Diaz
371380a2bc
Relocate mirror = {} to else clause - in get_updater()
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 13:36:44 -05:00
Vladimir Diaz
69d2da927e
Rename method _paths_match_target -> target_matches_path_pattern
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 13:25:47 -05:00
Vladimir Diaz
2418df49e9
Prepend underscore to paths_match_target (internal method)
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 12:58:40 -05:00
Vladimir Diaz
9c9877c75e
Edits to fix whitespace and line lengths
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 12:02:15 -05:00
Vladimir Diaz
9d7b07a101
Relocate comment and log statement
Relocate the comment intended for the loop that iterates targetinfos looking for a threshold of matching targetinfo.

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-13 11:42:55 -05:00
Vladimir Diaz
7fb6b17fec
Add comment for loop that verifies required local dirs
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-12 14:25:33 -05:00
Vladimir Diaz
08b2a9e3ac
Remove 'self.map_file = {}'
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-12 14:17:27 -05:00
Vladimir Diaz
4fdf9840ca
Resolve Pylint warning for bare-except
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-11 15:08:24 -05:00
Vladimir Diaz
d01b45131f
Resolve merge conflicts
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-11 14:22:13 -05:00
Vladimir Diaz
65a9a7c267
Resolve conflicts
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-11 13:24:19 -05:00
Vladimir Diaz
ec95a0d30f
Resolve conflicts
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:53:57 -05:00
Vladimir Diaz
ede35184f0
Remove obsolete comment about not refreshing metadata 2017-12-08 16:32:53 -05:00
Vladimir Diaz
ff0d221796
Fix stale metadata bug, and improve comments + log messages
Retrieving updater objects after consulting the map file did not guarantee fresh metadata.  This fix makes it so that an updater.refresh() is issued after each updater object is retrieved.
2017-12-08 16:32:53 -05:00
Vladimir Diaz
ba0644abc9
Fix the mapping schema and a few comments
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:45 -05:00
Vladimir Diaz
f5174f2b9b
Add docstring to get_updater() and minor edits to for loops
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:41 -05:00
Vladimir Diaz
49b5377d17
Fix more bugs in MultiRepoUpdater
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:26 -05:00
Vladimir Diaz
15d29db299
Fix bug where terminating attribute of intermediate mappings was not checked
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:18 -05:00
Vladimir Diaz
c9d9c721c0
Raise an exception if no target is found via the map file
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:10 -05:00
Vladimir Diaz
26b92473b4
Remove print statements from updater.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-12-08 16:32:01 -05:00