Commit graph

3330 commits

Author SHA1 Message Date
Sebastien Awwad
b30fd6d4e2
Update urllib3 dependency from 1.24.1 to 1.24.2
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-19 15:35:09 -04:00
Sebastien Awwad
b005002fef
Merge pull request #853 from theupdateframework/readme_improvements
README: TUF spec version, reference implementation, and other adjustments
2019-04-10 11:05:38 -04:00
Sebastien Awwad
06cdb21efd
DOC: explain what this repo is: the reference implementation
at the very top of the README.

and:
- note that this implementation is intended to conform to version
  1.0 of the TUF specification
- draw some distinctions between the TUF design and this ref impl.
- turn the older blurb about TUF into an About-TUF section
- expand that blurb with a link to both an introduction in the repo
  and the TUF website
- make the documentation links a bit more explicit
- shuffle some graphical elements for better appeal
- minor changes like extending some link text

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-09 16:57:59 -04:00
Sebastien Awwad
7af42eaf97
Merge pull request #851 from theupdateframework/pyup-scheduled-update-2019-04-08
Scheduled weekly dependency update for week 14
2019-04-09 16:00:37 -04:00
pyup-bot
e55b20fd25
Update isort from 4.3.16 to 4.3.17
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-09 15:24:37 -04:00
Sebastien Awwad
4f01a31346
Merge pull request #849 from theupdateframework/clarify_role_of_cli
Reframe CLI, revise quickstart, and reorganize tutorials
2019-04-08 15:23:22 -04:00
Sebastien Awwad
67dd649680
DOC: cover possible environment requirements in QUICKSTART
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 15:21:52 -04:00
Sebastien Awwad
2af4d3f12e
DOC: simplify installation instructions in QUICKSTART
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 13:32:43 -04:00
Sebastien Awwad
ed6acd4ef1
minor DOC: label the advanced tutorial as such
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 11:56:45 -04:00
Sebastien Awwad
1f3e5b6483
DOC: collapse CLI_EXAMPLES.md into CLI.md
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 11:54:10 -04:00
Sebastien Awwad
5a94d5db3e
minor DOC: fix unfinished sentence, some punctuation
in the QUICKSTARD.md

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-08 11:49:25 -04:00
Sebastien Awwad
e82ce352b4
Merge pull request #850 from theupdateframework/pyup-initial-update
Dependency Updates (via pyup)
2019-04-05 17:04:31 -04:00
pyup-bot
b08b6da97e
Update dependencies:
Update astroid from 2.0.4 to 2.2.5
Update cffi from 1.11.5 to 1.12.2
Update cffi from 1.11.5 to 1.12.2
Update configparser from 3.5.0 to 3.7.4
Update cryptography from 2.4.2 to 2.6.1
Update cryptography from 2.4.2 to 2.6.1
Update isort from 4.3.4 to 4.3.16
Update pbr from 5.1.1 to 5.1.3
Update pluggy from 0.8.0 to 0.9.0
Update py from 1.7.0 to 1.8.0
Update pylint from 2.1.1 to 2.3.1
Update pyyaml from 4.2b1 to 5.1
Update stevedore from 1.30.0 to 1.30.1
Update tox from 3.5.3 to 3.8.6
Update virtualenv from 16.1.0 to 16.4.3
Update wrapt from 1.10.11 to 1.11.1
Update certifi from 2018.11.29 to 2019.3.9

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-05 13:53:44 -04:00
Sebastien Awwad
907186e6a4
DOC: revise quickstart and reorganize tutorials:
- correctly frame the CLI's current state as a tutorial toy.
- provide a friendlier quickstart that puts what it's doing into
  perspective and guides you to next steps.
- provide a better sense of what each tutorial/quickstart doc is
  for.
- make the getting started page slightly more friendly.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-05 13:44:07 -04:00
Sebastien Awwad
00f5279fca
minor: doc: typo fix
adjusted casing on TUF (TUf -> TUF)
2019-04-03 10:58:07 -04:00
Sebastien Awwad
254e0c4866
Merge pull request #836 from theupdateframework/destroy_unnecessary_classes_in_formats
Destroy unnecessary MetaFile classes in formats.py
2019-04-03 10:40:04 -04:00
Sebastien Awwad
25aa71d4c6
PR revision: test build_dict_conforming... arg for schema type
Raise an error if it's not a schema.Object instance (not just
if it's not a schema.Schema instance).

Also adds a test for this.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-03 10:30:42 -04:00
Sebastien Awwad
9aa22466c0
PR revision: minor bugfix in casing
May the Python gods forgive me for having three different
names with the same names and different casing on one line....

Perhaps I should address the import module as....

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-02 12:50:20 -04:00
Sebastien Awwad
188bc84f90
DOC: improve build_dict_conforming_to_schema docstring
- Expand on the arguments/kwargs
- Note that the function is particular to schema.Object objects.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-02 12:48:13 -04:00
Sebastien Awwad
915291ea85
PR revision: use type checking, minor readability edit
Edits prompted by Lukas's review.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-02 12:47:16 -04:00
Sebastien Awwad
40f4202b6f
minor DOC: typo fixes
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-04-02 12:46:37 -04:00
Sebastien Awwad
b52ff2d744
Beg pylint for forgiveness re. protected access of SCHEMAs
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 15:47:19 -04:00
Sebastien Awwad
3ac174f597
Use build_dict... instead of make_role_... in test_sig.py
since make_role_metadata is being replaced by
build_dict_conforming_to_schema

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 15:38:30 -04:00
Sebastien Awwad
7ecf522698
Automatically fill _type and spec_version in build_dict_c...
in tuf.formats.build_dict_conforming_to_schema

Populate _type with the expected value for the given schema, and
populate spec_version with tuf.SPECIFICATION_VERSION.  Do this only
when the values are not provided, and support overriding them.

Also adds testing for the above and takes advantage of the above
in repository_lib's _generate metadata functions.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 15:23:00 -04:00
Sebastien Awwad
491577c282
Perform deep copies in build_dict_conforming_to_schema
Make a copy of the provided fields so that the caller's provided values
do not change when the returned values are changed.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 15:22:22 -04:00
Sebastien Awwad
47e05f8b96
Kill another partially-used metadata writing func
tuf.formats.make_role_metadata concerned itself with exclusivity checks
for paths and path_hash_prefixes, but no code actually used it for
relevant data.  It's yet another custom metadata writer replaced by
build_dict_conforming_to_schema.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 15:22:22 -04:00
Sebastien Awwad
e7c822954b
Update testing following MetaFile(etc) class removals
Testing will now use (and test) build_dict_conforming_to_schema.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:37:31 -04:00
Sebastien Awwad
ce21d8d0a0
Destroy get_role_class in formats.py (not needed)
It pertains to now-deleted metadata classes.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:37:30 -04:00
Sebastien Awwad
fca27122ef
Add specification version to TIMESTAMP_SCHEMA
It was excluded from the Timestamp schema definition in error.

In the process of making metadata writing use the Timestamp schema
strictly, this bug was discovered.  Metadata previously written
included specification version, but the schema check did not.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:37:30 -04:00
Sebastien Awwad
b4d274f527
Indicate the TUF spec version we conform to, in a tuf variable
Add a tuf-level variable in tuf/__init__.py indicating the version
of the TUF specification that the code in this repository is
intended and expected to conform to.

This will be used when writing metadata.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:37:30 -04:00
Sebastien Awwad
b315aba018
Replace six classes with one function in formats.py
Kills classes MetaFile, RootFile, TargetsFile, MirrorsFile,
SnapshotFile, and TimestampFile.  They each had an unused
from_ method and a used make_ method.  They were all additional,
unnecessary representations of the same metadata, and it is
very important that metadata formats be defined once in the
reference implementation, in the schemas that are already used
more broadly, in foramts.py.

Replaces the classes, their methods, and some associated variables
with a single short function called build_dict_conforming_to_schema
that takes keyword arguments and builds a dictionary, then checks
to make sure that the result conforms to the given schema.

This commit shifts repository_lib from use of the old classes to
the new function.

In later commits, we should use this function more broadly, since it
can be of use in all schema construction.

There are several TODOs added to the code, mostly for post-#660
tasks.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:36:50 -04:00
Sebastien Awwad
3a4c6134fe
Merge pull request #844 from theupdateframework/improve_spec_version_handling_2
Specification version support code cleanup
2019-03-29 11:32:18 -04:00
Sebastien Awwad
d58bcf9c62
spec version support code cleanup
Specification version now only lives in tuf/__init__.py, and will only be
derived from there.

Specification version info is no longer in tuf.formats, where it was
previously moved from tuf.updater, since this was redundant.

Also finally corrects spec version testing in test_updater.py.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-29 11:08:43 -04:00
Sebastien Awwad
7a3b04cb89
Merge branch 'fix_try_except_else_in_tests' into develop
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-28 19:12:34 -04:00
Sebastien Awwad
2c1ca1e5c1
test: Patch some holes in testing due to bad try/except/else
syntax/understanding.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-28 19:03:46 -04:00
Sebastien Awwad
2d2e401ecd
Merge pull request #842 from theupdateframework/improve_spec_version_handling
Improve the way specification version is checked in metadata
2019-03-28 18:55:10 -04:00
Sebastien Awwad
18ef3b419d
Improve the way specification version is checked in metadata
and generate more friendly errors.  Prior to this, a test in
test_updater.py was written in such a way to not actually be
testing whether or not specification version checking was
working correctly -- the error updater.py raised if a specification
version number was not supported was the same as would be raised
if a role version was not the expected version, and, amusingly,
the test could not distinguish between these two scenarios and
was providing the wrong role version......

Specification version mismatch now raises a particular error:
UnsupportedSpecificationError.

The specification version supported by this code is now also all
in one place, tuf.formats rather than tuf.updater.

Related error messages and testing were improved (with some
edge cases closed).

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-28 18:30:03 -04:00
Sebastien Awwad
a4cf9c95c2
Merge pull request #833 from theupdateframework/roadmap_corrections
DOC: Update the outdated ROADMAP.md
2019-03-28 15:29:11 -04:00
Sebastien Awwad
58be640faf
Merge pull request #839 from theupdateframework/pylint_fix_exception_subscripting
Resolve pylint error: remove outdated exception subscript
2019-03-26 13:32:19 -04:00
Sebastien Awwad
a7cb2dd4ce
Resolve pylint error: remove outdated exception subscript
Python3 does not support exception subscripting:
  e.g. except ... as e:
         e[1]       # does not work in Python3

This line of code was presumably not covered by testing,
allowing it to persist.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-03-26 12:10:15 -04:00
Sebastien Awwad
24618a956b
DOC: Clarify repository_tool interface to delegated roles
Add note to make clear what was implicit: that once a delegated role is created,
it can be accessed (for the same purposes as you'd access the Targets role
using `repository.targets`) as: `repository.targets("<delegated rolename>")`.

Also add that specific note to the add_targets section of the tutorial.
2019-03-25 10:47:11 -04:00
Justin Cappos
37d5833760
Update README.md 2019-03-13 17:18:41 -04:00
Sebastien Awwad
e541d05f08
DOC: Note client dir creation in CLI instructions
Note that the `repo.py --init` call also sets up a client directory.

A student recently ran into some confusion on this point, and it's not properly documented here.
2019-03-11 10:31:24 -04:00
Sebastien Awwad
e97b0b091d
Merge pull request #824 from HavardLine/patch-1
Context to QUICKSTART.md
2019-02-26 12:51:11 -05:00
Sebastien Awwad
4847783001
DOC: Update the outdated ROADMAP.md
- refer to the authoritative sources for the latest releases
- include new packager information
- add tasks for upcoming releases
- generalize release schedule

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-02-26 11:22:47 -05:00
Justin Cappos
bcde77c85d
Merge pull request #832 from truongnh1992/fix-typo
Remove redundant words in comment
2019-02-26 10:10:07 -05:00
Nguyen Hai Truong
d36a4e5621 Remove redundant words in comment
Although it is spelling mistakes, it might make an affects
while reading.

Signed-off-by: Nguyen Hai Truong <truongnh@vn.fujitsu.com>
2019-02-26 14:35:30 +07:00
Justin Cappos
882f084ff1
Merge pull request #831 from tuanvcw/update_deprecated_links_docs
Update deprecated links in docs
2019-02-25 22:25:09 -05:00
Vu Cong Tuan
0d58fae3a8 Update deprecated links in docs
Signed-off-by: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
2019-02-26 08:58:59 +07:00
Justin Cappos
c23a083195
Merge pull request #830 from tuanvcw/fix_typos_doc
Fix some typos in docs
2019-02-25 13:38:40 -05:00