Commit graph

3909 commits

Author SHA1 Message Date
dependabot-preview[bot]
d2f51d6cde
build(deps): bump urllib3 from 1.25.11 to 1.26.2
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.11 to 1.26.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/master/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.25.11...1.26.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-13 10:23:47 +00:00
lukpueh
af18e75413
Merge pull request #1208 from lukpueh/migrate-travis
Update Travis CI build badge/docs after migration
2020-11-12 15:57:00 +01:00
Lukas Puehringer
d46ebd016e Update Travis CI build badge/docs after migration
Update badge URL in readme after migrating from travis-ci.org to
travis-ci.com, due to brownout on the former.

Migration was performed via Travis Web UI:
https://docs.travis-ci.com/user/migrate/open-source-repository-migration

NOTE: This is a quick fix to speed up Travis builds until we switch
to GitHub Actions (#1195)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-11-12 10:07:53 +01:00
lukpueh
11e2f4ca48
Merge pull request #1191 from lukpueh/adopt-sslib-interface-changes
Adopt sslib keygen interface encryption changes
2020-11-11 11:31:35 +01:00
Lukas Puehringer
dc20fdbffd Update securesystemslib dependency to 0.18.0
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-11-11 10:28:05 +01:00
Lukas Puehringer
ff8819577b Adopt sslib keygen interface encryption changes
secure-systems-lab/securesystemslib#288 changes the key generation
interface functions in such a way that it is clear if a call opens
a blocking prompt, or writes the key unencrypted. To do this two
functions are added per key type:
 - `generate_and_write_*_keypair_with_prompt`
 - `generate_and_write_unencrypted_*_keypair`

The default `generate_and_write_*_keypair` function now only allows
encrypted keys and only using a passed password. This respects the
principle of secure defaults and least surprise.

sslib#288 furthermore adds a protected
`_generate_and_write_*_keypair`, which is not exposed publicly
because it does not encrypt by default, but is more flexible and
thus convenient e.g. to consume all arguments from a key generation
command line tool such as 'repo.py'.

This commit adds the new public functions to the tuf namespace and
adopts their usage accordingly.

NOTE regarding repo.py:
This commit does not fix any problematic password behavior of
'repo.py' like default passwords, etc. (see #881). It only adopts
the sslib#288 changes to maintain the current behvior, plus
removing one glaringly obsolete password prompt.

NOTE regarding key import:
The securesystemslib private key import functions were also changed
to no longer auto-prompt for decryption passwords , TUF, however,
only exposes custom wrappers (see repository_lib) that do
auto-prompt. sslib#288 changes to the prompt texts are nevertheless
propagated to tuf and reflected in this commit.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-11-11 10:27:56 +01:00
lukpueh
201e07ddca
Merge pull request #1200 from MVrachev/add-python3.9
Add support for python 3.9
2020-11-09 09:44:43 +01:00
Martin Vrachev
d055c4216d Add support for python 3.9
Python 3.9 is released on October 5-th 2020 and it seems
logical to add support for it.

For reference read:
https://docs.python.org/3/whatsnew/3.9.html

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2020-11-05 19:47:13 +02:00
Joshua Lock
a88a5bd69e
Merge pull request #1187 from MVrachev/change-aggregate-test
Simplify aggregate_tests.py
2020-11-02 21:22:44 +00:00
lukpueh
6cb9d4565d
Merge pull request #1194 from jku/speedup-indefinite-freeze-tests
Speedup indefinite freeze tests
2020-11-02 11:43:58 +01:00
Martin Vrachev
fa899cca20 Simplify aggregate_tests.py
There is a simpler way to skip modules or particular tests
built-in into the unittest module.
That's why it doesn't make sense for us to manually filter
modules based on the python version we are running.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2020-10-30 17:16:39 +02:00
lukpueh
cab9738e3c
Merge pull request #1190 from theupdateframework/dependabot/pip/cryptography-3.2.1
build(deps): bump cryptography from 3.2 to 3.2.1
2020-10-30 12:49:48 +01:00
Jussi Kukkonen
05cf09071b tests: Use version specific import for mock
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2020-10-30 13:10:06 +02:00
Jussi Kukkonen
ca048a2744 tests: Remove sleeps from indefinite freeze tests
Instead of sleeping, mock time.time() so Updater thinks it lives in the
future.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2020-10-29 20:43:36 +02:00
Jussi Kukkonen
e7ce873f12 updater: Add missing Exception documentation
Added ExpiredMetadataError to function documentation where it seems to
be missing.

Corrected the refresh() documentation: ExpiredMetadataError can only
happen when top level metadata does not need to be updated but is
expired. If the metadata gets updated and is expired, the result will
be a NoWorkingMirror with ExpiredMetadata inside it.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2020-10-29 20:36:33 +02:00
dependabot-preview[bot]
2f039b6f13
build(deps): bump cryptography from 3.2 to 3.2.1
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.2 to 3.2.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.2...3.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 10:20:32 +00:00
lukpueh
9908f8eedd
Merge pull request #1182 from joshuagl/joshuagl/adrs
Start to keep Architectural Decision Records (ADRs) for tuf reference implementation
2020-10-27 12:28:58 +01:00
Joshua Lock
1b3f580dc9 ADR0001: clarify when/where Python 3.6+ is expected
Provide additional context to clarify where we expect Python 3.6+ to be used
exclusively (new modules) and link to other discussions around the future of
Python 2.7 supporting code.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-27 11:25:42 +00:00
Joshua Lock
e34e4b647b
Merge pull request #1189 from theupdateframework/dependabot/pip/cryptography-3.2
build(deps): bump cryptography from 3.1.1 to 3.2
2020-10-26 20:47:08 +00:00
Joshua Lock
71de3f64ef ADR: only use Python 3.6+
Document the decision drop support for EOL Python versions, most notable
Python 2.7

Fixes #1125

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-26 16:26:52 +00:00
Joshua Lock
19b9356598 Teach git to ignore Emacs backup files
Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-26 16:26:52 +00:00
Joshua Lock
e3d84391b4 docs/adr: start to keep ADRs in MADR format
In order to make decisions about the code and the design explicit and easier
to reference in future we want to record significant architectural decisions.

This commit introduces docs/adr with a template Architectural Decision Record
and index using the [MADR](https://adr.github.io/madr/) format.

It also adds ADR 0000 to document the decisions to use MADR.

Fixes #1141

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-26 16:26:52 +00:00
dependabot-preview[bot]
2be339f3a7
build(deps): bump cryptography from 3.1.1 to 3.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.1.1 to 3.2.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.1.1...3.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-26 10:22:23 +00:00
lukpueh
39341521bf
Merge pull request #1183 from joshuagl/joshuagl/tuf-0.15.0
Prepare 0.15.0 release
2020-10-23 14:53:31 +02:00
Lukas Puehringer
10b9db1e40 Prepare 0.15.0 release (II)
Update docs/CHANGELOG.md to include missing items.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2020-10-22 15:27:46 +02:00
lukpueh
c67fbb66d2
Merge pull request #1185 from jku/workaround-with-sslib-master-double-dependency
tox: Workaround double dep in with-sslib-master
2020-10-22 12:03:50 +02:00
Jussi Kukkonen
5db7e2d8ca tox: Workaround double dep in with-sslib-master
Commit eb00d14 modified requirements-pinned.txt so that sslib specifiers
are now "[crypto,pynacl]". This happens to match the exact specifiers
used for the sslib git master dependency in tox.ini. This triggers pip
to say:
  ERROR: Double requirement given: securesystemslib[crypto,pynacl]==0.16.0
  (from -r /home/jku/src/tuf/requirements-pinned.txt (line 12)) (already
  in securesystemslib[crypto,pynacl] from
  git+http://github.com/secure-systems-lab/securesystemslib.git@master#egg=securesystemslib[crypto,pynacl],
  name='securesystemslib')

Avoid this by not setting any specifiers for the sslib git master
dependency in tox.ini: This makes pip happy and we get the git master
version installed. pynacl and crypto are still installed because they
are in requirements-pinned.txt.

Fixes #1184.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2020-10-22 12:50:41 +03:00
Joshua Lock
d992e8b128 Add python-dateutil to test requirements
tests/test_api.py uses python-dateutil, therefore ensure it is installed
for Travis and AppVeyor.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-21 18:39:25 +01:00
Joshua Lock
33ac374184 Bump securesystemslib from 0.16.0 to 0.17.0
We just released securesystemslib 0.17.0 and it would be better if tuf did
not pin the prior version.

https://pypi.org/project/securesystemslib/0.17.0/
https://github.com/secure-systems-lab/securesystemslib/releases/tag/v0.17.0

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-21 18:39:25 +01:00
Joshua Lock
8169b00745 Prepare 0.15.0 release
Update docs/CHANGELOG.md and bump version number for a 0.15.0 release

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-21 11:42:21 +01:00
Joshua Lock
bbcff077e4
Merge pull request #1179 from theupdateframework/dependabot/pip/urllib3-1.25.11
build(deps): bump urllib3 from 1.25.10 to 1.25.11
2020-10-21 11:06:31 +01:00
Joshua Lock
b570723d63
Merge pull request #1180 from joshuagl/joshuagl/nocolour
Make colorama dependency optional
2020-10-21 11:06:00 +01:00
Joshua Lock
eb00d14346 Remove colorama from requirements
The repo script was the only user and can now do the right thing when
colorama isn't available in the environment.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-20 15:23:39 +01:00
Joshua Lock
d4705502fc repo: make colorama a soft dependency
Instead of using colorama directly for terminal colours, use the
constants in securesystemslib.interface which map to colorama colours
IFF colorama is installed.

This change results in a red password prompt when colorama is installed
and a standard terminal output coloured prompt when colorama is not
installed.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-20 15:23:39 +01:00
Joshua Lock
f2366d5608
Merge pull request #1166 from MVrachev/confined-targets-optional
Make confined_target_dirs optional field
2020-10-20 11:44:08 +01:00
dependabot-preview[bot]
73241f4376
build(deps): bump urllib3 from 1.25.10 to 1.25.11
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.25.10 to 1.25.11.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/master/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.25.10...1.25.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-20 10:24:11 +00:00
Martin Vrachev
3c4bc77cd7 Add test if confined_target_dirs is ['']
Even though we don't want to promote the usage of [''] as a value
for confined_target_dirs, it's good to test against because we
don't want to introduce a breaking change for our users.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2020-10-16 16:10:05 +03:00
Martin Vrachev
946d11bca4 Make confined_target_dirs optional field
The field confined_target_dirs from the MIRROR_SCHEMA  is
a list of strings. Those strings define the accessible target
paths for that mirror. For one target to be available for that mirror,
its path should have as a prefix at least one of the strings defined
in confined_target_dirs.

That's why when confined_target_dirs is a list with one element empty
string (e.g. ['']) this means all targets files on that mirror are
available and if confined_target_dirs is empty list (e.g. []) this
would be interpreted as none of the target files is available.

This is a confusing API that could easily lead to mistakes.
That's why it's better we promote to not set confined_target_dirs
at all if a user wants targets to be available.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2020-10-16 15:35:24 +03:00
lukpueh
a64a334cd4
Merge pull request #1177 from joshuagl/ww/tuf-api-package
tuf/api: Expose tuf.api as a package (take 2)
2020-10-15 17:55:00 +02:00
Lukas Puehringer
54963c43fc ci: skip fossa and coverage for lint jobs
Authored-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 15:50:12 +01:00
Joshua Lock
a4d851de14 Switch sslib master env to Python 3.8
Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
d36d3194a7 Move linting to a separate tox env
We don't need to lint the code with every version of Python, instead add
an extra tox env which lints once with the latest supported Python version

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
a53d4ec475 Disable an instance of too-many-arguments error
The Targets constructor takes seven arguments, which violates pylints
default value of five for max-arguments:

R0913: Too many arguments (7/5) (too-many-arguments)

As this feels like a coding style decision that should be made and
documented disable that test for only the Targets constructor until
a coding style decision has been made and documented as a decision
record.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
f205e98851 Remove else after raise usage in api.metadata
Using an else after a raise results in a refactor message from pylint:

R1720: Unnecessary "elif" after "raise" (no-else-raise)

This is because the raise will exit the block, and pylint suggests that
explicit if's, rather than an if-elif-else, are clearer style. Update the
style of Metadata.verify() to match pylint expectations.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
fea52b54ee Remove use of single letter variable
A single letter variable name of 'f' causes pylint to throw a coding style
convention warning:

C0103: Variable name "f" doesn't conform to snake_case naming style
(invalid-name)

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
3877667ff4 Remove unused import from tuf.api.metadata
The logging module is not used in metadata, therefore remove it

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
f91ce395e5 Add minimal pylintrc for new code in tuf/api
Add a minimal pylintrc to lint for new code being developed in tuf/api and
update the tox configuration to ignore tuf/api with the default pylintrc
and run an extra invocation of pylint for just the modules in tuf/api.

Signed-off-by: Joshua Lock <jlock@vmware.com>
2020-10-15 14:35:14 +01:00
William Woodruff
05b1609786 tuf/api: Expose tuf.api as a package
Signed-off-by: William Woodruff <william@trailofbits.com>
2020-10-15 14:35:14 +01:00
Joshua Lock
ba7c6922c0
Merge pull request #1152 from MVrachev/fix-pr-template
Fix automatic issue closing
2020-10-15 10:39:04 +01:00
Joshua Lock
f4520317b1
Merge pull request #1163 from joshuagl/joshuagl/nits
Update release process and mark unit tests as executable
2020-10-15 10:38:26 +01:00