Commit graph

3391 commits

Author SHA1 Message Date
lukpueh
fdc0bc12a5
Merge pull request #876 from lixuefeng2/develop
Fix code style: add missing whitespace after operators
2019-09-17 12:57:48 +02:00
lukpueh
f6bd090960
Merge pull request #912 from joshuagl/joshuagl/sslcompat
Use TUF specific formats as they have been removed from securesystemslib
2019-09-17 12:20:26 +02:00
lukpueh
824e7dbbaa
Merge pull request #916 from theupdateframework/pyup-scheduled-update-2019-09-16
Scheduled weekly dependency update for week 37
2019-09-17 12:12:49 +02:00
pyup-bot
089afa724f Update bandit from 1.5.1 to 1.6.2
Update cffi from 1.12.2 to 1.12.3

Update cffi from 1.12.2 to 1.12.3

Update configparser from 3.7.4 to 4.0.2

Update cryptography from 2.6.1 to 2.7

Update cryptography from 2.6.1 to 2.7

Update gitpython from 2.1.11 to 3.0.2

Update isort from 4.3.17 to 4.3.21

Update lazy-object-proxy from 1.3.1 to 1.4.2

Update pbr from 5.1.3 to 5.4.3

Update pluggy from 0.9.0 to 0.13.0

Update pyyaml from 5.1 to 5.1.2

Update requests from 2.21.0 to 2.22.0

Update requests from 2.21.0 to 2.22.0

Update stevedore from 1.30.1 to 1.31.0

Update tox from 3.8.6 to 3.14.0

Update virtualenv from 16.4.3 to 16.7.5

Update wrapt from 1.11.1 to 1.11.2

Update certifi from 2019.3.9 to 2019.9.11

Update urllib3 from 1.24.2 to 1.25.3

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-17 12:01:19 +02:00
lukpueh
6a145d027e
Merge pull request #855 from theupdateframework/adjust_to_removals_from_securesystemslib
Adjust to removals from securesystemslib
2019-09-17 11:31:12 +02:00
Joshua Lock
ecb6d26206 Remove deprecated securesystemslib.formats schemas
TUF specific schemas have moved to tuf.formats, ensure they are used
throughout and remove stray references to no longer supported schemas
in securesystemslib.format

Signed-off-by: Joshua Lock <jlock@vmware.com>
2019-09-17 10:28:10 +01:00
Sebastien Awwad
a9d7053d78 Use TUF exceptions instead of SSL exceptions where appropriate
Removal of securesystemslib exceptions that are TUF-specific
occurs in securesystemslib PR #165
https://github.com/secure-systems-lab/securesystemslib/pull/165

This commit adapts to those changes.  Exceptions that are specific
to TUF should be in TUF and not in securesystemslib.  This commit
uses those already-existing TUF exceptions instead of pointing to
securesystemslib exceptions that will be removed.

For example, securesystemslib has no notion of repositories, so
it's ridiculous to have a RepositoryError in securesystemslib and
ridiculous for TUF to use
securesystemslib.exceptions.RepositoryError.

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2019-09-17 11:19:04 +02:00
Justin Cappos
c4be348b63
Merge pull request #914 from lukpueh/adopt-spec-semver
Adopt mandatory semantic versioning for TUF specification version
2019-09-16 11:18:48 -04:00
Lukas Puehringer
b1365843dd Mandate semver for SPECIFICATION_VERSION_SCHEMA
Mandates Semantic Versioning format with
tuf.formats.SPECIFICATION_VERSION_SCHEMA using the regex referenced
on the official semver website. See:
https://semver.org/spec/v2.0.0.html#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
https://regex101.com/r/Ly7O1x/3/

Adopts tests accordingly:
 - removes tests that now fail earlier due to stricter format
 - adds tests to check exemplary valid and invalid version schemas

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-16 15:43:39 +02:00
Lukas Puehringer
2e21950c74 Re-generate projects test metadata
Re-generate metadata to adopt spec version format change, using
`generate_project_data.py`:

```
cd tests/repository_data && rm -rf project
python generate_project_data.py
```

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-16 15:43:39 +02:00
Lukas Puehringer
af1a21b05a Re-generate repository and client test metadata
Re-generate metadata to adopt spec version format change, using
`generate.py` plus some working around (see script below):

```
 # QUICKFIX: Patch add_target to pass file paths relative to targets dir
git apply - <<EOF
diff --git a/tests/repository_data/generate.py b/tests/repository_data/generate.py
index 6c263575..699ed00f 100755
--- a/tests/repository_data/generate.py
+++ b/tests/repository_data/generate.py
@@ -119,12 +119,11 @@ if not options.dry_run:
 # about the target (i.e., file permissions in octal format.)
 octal_file_permissions = oct(os.stat(target1_filepath).st_mode)[4:]
 file_permissions = {'file_permissions': octal_file_permissions}
-repository.targets.add_target(target1_filepath, file_permissions)
-repository.targets.add_target(target2_filepath)
+repository.targets.add_target('file1.txt', file_permissions)
+repository.targets.add_target('file2.txt')

-repository.targets.delegate('role1', [delegation_public],
-    [os.path.basename(target3_filepath)])
-repository.targets('role1').add_target(target3_filepath)
+repository.targets.delegate('role1', [delegation_public], ['file3.txt'])
+repository.targets('role1').add_target('file3.txt')
 repository.targets('role1').load_signing_key(delegation_private)

 repository.targets('role1').delegate('role2', [delegation_public], [])
EOF

 # Remove repository and client data
cd repository_data && rm -rf repository client
 # Generate metadata
python generate.py
 # Duplicate metadata files
cp -r client/test_repository1 client/test_repository2
 # Recover non-signed file
git checkout client/map.json
```

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-16 15:43:39 +02:00
Lukas Puehringer
9d201d1657 Update SPEC_VERSION to semver-compliant 1.0.0
Updates SPEC_VERSION definition in tuf/__init__.py, test files and
docstring in formats.build_dict_conforming_to_schema.

Test metadata will be updated in separate commits.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-16 15:43:39 +02:00
Lukas Puehringer
94d1c51611 Update link to historical tuf-spec.0.9.txt
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-16 15:43:39 +02:00
lukpueh
4fb4cb280e
Merge pull request #890 from lukpueh/fix-coveralls
Fix publishing of coverage results to coveralls.io (+ misc test config updates)
2019-09-11 11:41:58 +02:00
Lukas Puehringer
098769b5f6 Fix typo in .travis.yml
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-11 09:21:22 +02:00
lukpueh
bafebeee6c
Merge pull request #909 from lukpueh/add-target-hash-function
Move repository_lib.get_taget_hash back from sslib to tuf
2019-09-05 16:09:07 +02:00
lukpueh
011a08c99e
Merge pull request #910 from lukpueh/add-schemas-from-sslib
Add TUF-specific schemas removed in sslib
2019-09-05 16:08:49 +02:00
Lukas Puehringer
e42dffd464 Add TUF-specific schemas removed in sslib
Add schemas KEYDB_SCHEMA, SIGNATURESTATUS_SCHEMA and
VERSIONINFO_SCHEMA, removed in
secure-systems-lab/securesystemslib#165 as TUF specific, and adopt
usage accordingly.

NOTE: The usefulness of these schemas may be assessed in a
different PR.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-05 15:16:05 +02:00
Lukas Puehringer
71866253ed Move repository_lib.get_taget_hash from sslib
The function used to last be implemented in securesystemslib
and repository_lib.get_taget_hash only served as wrapper.

secure-systems-lab/securesystemslib#165 drops the function as
TUF-specific.

The used constant `securesystemslib.util.HASH_FUNCTION`
is replaced with `tuf.settings.DEFAULT_HASH_ALGORITHM`, both of
which default to 'sha256'.

NOTE: repository_lib.get_taget_hash might be removed altogether in
the future (see corresponding code comment).

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-09-05 12:08:48 +02:00
lukpueh
d24c37fdc5
Merge pull request #908 from tanjunchen/fix-up-tuf-typo
fix-up tuf/ typo
2019-09-04 18:18:49 +02:00
chentanjun
2c149a8bf9 fix-up tuf/ typo
Signed-off-by: chentanjun <2799194073@qq.com>
2019-09-05 00:01:21 +08:00
lukpueh
0dc1b0dbd8
Merge pull request #906 from tanjunchen/fix-up-spelling-mistake
fix-up the the -> the
2019-09-02 12:20:12 +02:00
chentanjun
efbe0a3489 fix-up the the -> the
Signed-off-by: chentanjun <2799194073@qq.com>
2019-09-01 22:53:02 +08:00
Justin Cappos
8b615698ea
Merge pull request #905 from tanjunchen/fix-up-grammar
Fix up grammar
2019-08-30 11:18:47 -04:00
chentanjun
8677b435ea fix-up tests package word spelling mistake
Signed-off-by: chentanjun <2799194073@qq.com>
2019-08-30 22:31:00 +08:00
chentanjun
d46f151d3e Merge remote-tracking branch 'upstream/develop' into develop 2019-08-28 09:39:52 +08:00
Justin Cappos
a876d36557
Merge pull request #904 from tanjunchen/fix-up-tuf-doc-mistake
fix-up the document spelling mistake
2019-08-27 10:09:11 -04:00
chentanjun
560d45dca2 fix-up the document spelling mistake
Signed-off-by: chentanjun <2799194073@qq.com>
2019-08-27 14:41:24 +08:00
chentanjun
a2a7faee92 fix-up the document spelling mistake 2019-08-27 14:38:03 +08:00
Justin Cappos
a66bd5f5b6
Merge pull request #902 from ethan-daocloud/typo-terminator
Cleanup: fix some typos in code comment
2019-08-22 11:23:26 -04:00
Guangming Wang
7ec9308a07 Cleanup: fix some typos in code comment
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-22 22:49:23 +08:00
Justin Cappos
ea8a7e20be
Merge pull request #900 from ethan-daocloud/patch-2
cleanup code message words by fix typos
2019-08-16 16:46:26 -04:00
Guangming Wang
990d2f8c0c
cleanup code message words by fix typos
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-17 00:14:02 +08:00
Justin Cappos
dc01989fcc
Merge pull request #899 from ethan-daocloud/patch-1
cleanup: fix docs words in repository_tool.py
2019-08-15 14:38:50 -04:00
Guangming Wang
643cb3916c
cleanup: fix docs words in repository_tool.py
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-15 21:55:33 +08:00
lukpueh
cf1171c5ac
Merge pull request #893 from lukpueh/update-maintainers
Update docs/MAINTAINERS.txt
2019-07-19 09:49:00 +02:00
Lukas Puehringer
a799a69494 Update docs/MAINTAINERS.txt
- Remove alumni @vladimir-v-diaz
- Add @SantiagoTorres and Marina (@@mnm678)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-07-16 12:00:18 +02:00
Lukas Puehringer
478fcf7032 Move omit to run section in .coveragerc
Coverage used to be configured to omit certain directories while
reporting.

This commit slightly optimizes coverage to already omit those
directories while measuring coverage.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-07-11 14:32:49 +02:00
Lukas Puehringer
e8420483e2 Install TUF in editable mode in tox builds
This commit partially reverts the workaround introduced by
157167e0cc. Instead of patching the
path, we configure tox to install TUF in editable mode, which makes
the tests run against the same files as if the path were patched.
This makes it so that coverage records paths that it can then
normalize when sending them to coveralls.io (see .travis.yml).

See af22701140
for detailed background information.

As a consequence we can now skip building of sdist and installing it
into a virtual env directory in tox.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-07-11 14:32:49 +02:00
Lukas Puehringer
157167e0cc Fix coverage file paths by patching sys.path
This replicates behavior of unittest's `discover` method, and
allows `coverage` and the tool that posts coverage reports to
coveralls.io, i.e. `coveralls`, to record the correct paths and
left-strip the parts leading to the project directory.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-06-26 18:22:46 +02:00
Lukas Puehringer
af18ead473 Pin coverage dependency for coveralls
We install coverage inside tox builds to generate test coverage
reports. These reports need to be created with a version supported
by coveralls, which we use (outside of tox) to publish coverage
reports to coveralls.io.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-06-26 11:56:27 +02:00
Lukas Puehringer
bd418968e5 Update travis to xenial and misc updates
- Add a build matrix to run each tox env in a corresponding
  travis env as per travis/tox best practices.
  https://docs.travis-ci.com/user/languages/python/#using-tox-as-the-build-script
- Add Python 3.5 tests
- Remove only build on certain branch restrictions
- Use "install" instead of "before_script"  to install dependencies.
  Explicitly listing "install" prevents Travis from automatically
  running `pip install -r requirements.txt`, which is not necessary
  because most of those requirements are installed again in each
  tox environment.
- Move pylint and bandit calls to tox (pylint requires
  dependencies) to be installed.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-06-25 17:17:33 +02:00
Lukas Puehringer
85129cb8d7 Instruct travis to install coveralls
Coveralls is used to publish coverage results online via
coveralls.io.

Travis is already configured to run it "after_success", but this
has failed for a while, because it was not installed.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2019-06-25 17:17:33 +02:00
lukpueh
65e5ee118b
Merge pull request #854 from mnm678/version_management
Version Management
2019-06-19 13:44:29 +02:00
Justin Cappos
49e75ffe5a
Update README.md 2019-06-18 14:54:36 -04:00
marinamoore
149d5bdaf9 removed trailing whitespace
Signed-off-by: marinamoore <mmoore32@calpoly.edu>
2019-06-10 10:18:17 -04:00
marinamoore
e7a49a8fa3 minor spec-version comparison now checks for any difference in minor versions
Signed-off-by: marinamoore <mmoore32@calpoly.edu>
2019-06-10 10:18:17 -04:00
marinamoore
9d5eef1e48 removed trailing whitespace
Signed-off-by: marinamoore <mmoore32@calpoly.edu>
2019-06-10 10:18:16 -04:00
marinamoore
819a5ddacc removed unused import
Signed-off-by: marinamoore <mmoore32@calpoly.edu>
2019-06-10 10:18:16 -04:00
marinamoore
45aa0b52b7 Updated the spec-version check to only parse the version once
Signed-off-by: marinamoore <mmoore32@calpoly.edu>
2019-06-10 10:18:16 -04:00