Commit graph

4950 commits

Author SHA1 Message Date
Lukas Pühringer
84486191fe
Merge pull request #1887 from jku/remove-blog-header-links
docs: Clean up blog header
2022-03-01 09:47:24 +01:00
Jussi Kukkonen
a74f7a1762
Merge pull request #1775 from MVrachev/validation-during-serialization
Add  a "validate" argument option to JSONSerializer.

The argument defaults to false: by default serialization works exactly as before.
2022-02-28 15:57:43 +02:00
Martin Vrachev
6ea5372edb Take order into account for certain cases
After we have dropped OrderedDict in e3b267e2e0
we are relying on python3.7+ default behavior to preserve the insertion
order, but there is one caveat.
When comparing dictionaries the order is still irrelevant compared to
OrderedDict. For example:
>>> OrderedDict([(1,1), (2,2)]) == OrderedDict([(2,2), (1,1)])
False
>>> dict([(1,1), (2,2)]) == dict([(2,2), (1,1)])
True

There are two special attributes, defined in the specification, where
the order makes a difference when comparing two objects:
- Metadata.signatures
- Targets.delegations.roles.
We want to make sure that the order in those two cases makes a
difference when comparing two objects and that's why those changes
are required inside two __eq__ implementations.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-28 14:42:06 +02:00
Martin Vrachev
a17ceda4e5 Add "validation" arg in JSONSerializer
If the "validation" argument is set then when
serializing the metadata object will be validated.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-28 14:42:06 +02:00
Martin Vrachev
5d24956ded Test __eq__ implementation for all classes
Test the "__eq__" implementation for all classes defined in
tuf/api/metadata.py
The tests are many but simple. The idea is to test each of the metadata
classes one by one and with this to make sure there are no possible
cases missed.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-28 14:42:06 +02:00
Martin Vrachev
30a707c297 Add __eq__ to classes in Metadata API
By adding __eq__ we can compare that two objects are equal.
That will be useful when adding validation API call.

One bug I have found during testing is that I don't check if the type
of "other" in the __eq__ implementations are the expected ones.
I assumed that when comparing "root == obj" if "obj" is None that
automatically the result will be false.
Later after a mypy warning, I realized we should implement the __eq__
methods to accept "Any" type as other and we should check manually
that "other" is the expected type.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-28 14:42:04 +02:00
Jussi Kukkonen
45e8898d4a docs: Clean up blog header
Minima theme by default adds all files in blog root (docs/) as links in
the header. This looks ridiculous in our case: let's just have a link to
blog front page.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-28 12:01:06 +02:00
Lukas Pühringer
a75abe36f0
Merge pull request #1886 from jku/add-development-blog
Add development blog
2022-02-28 10:39:36 +01:00
Jussi Kukkonen
5ee575ef33 docs: Add a new 200px icon
Also rename the existing icon so differences are obvious.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-25 10:54:08 +02:00
Jussi Kukkonen
e78ffc18f9 docs: Add a blog post
This is https://ssl.engineering.nyu.edu/blog/2022-02-21-tuf-1_0_0
only slightly modified (the logo would break the excerpts in the index
page so I moved it a bit).

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-24 16:12:34 +02:00
Jussi Kukkonen
92c7721d02 docs: Add blog configuration
Add config for GitHub Pages so that we can use it as a project blog.
* _config.yml is jekyll configuration
* index.md contains description and title for the blog main page.
* Any files matching "_posts/YYYY-MM-DD-TITLE.md" are considered posts

The Github Pages configuration only allows "/" or "/docs/" as the Jekyll
root directory: The clutter in docs/ is annoying but otherwise this is a
very easy setup.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-24 16:07:18 +02:00
Lukas Pühringer
84c632ee8d
Merge pull request #1867 from lukpueh/update-req-pinned
build: pin test requirements for deterministic CI
2022-02-22 11:04:02 +01:00
Jussi Kukkonen
03d023219b
Merge pull request #1873 from jku/1.0.0-release
1.0.0 release
2022-02-21 12:41:44 +02:00
Jussi Kukkonen
46f5bb7470 python-tuf version 1.0.0 \o/
* Update Changelog
* Update version numbers

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-18 15:24:33 +02:00
Jussi Kukkonen
70466ae234 __init__.py: Remove unused constant
Metadata API defines a specification version it supports already,
and that one is updated to the actual specification version we
produce.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-18 15:24:33 +02:00
Lukas Puehringer
b678de8c8b doc: reword announcement about upcoming 1.0.0
Change docs in preparation of close v1.0.0 release.

- Remove important notice about upcoming 1.0.0 release from README
- Reword 1.0.0-ANNOUNCEMENT.md to not sound outdated after release

Co-authored-by: Joshua Lock <jlock@vmware.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-18 15:23:37 +02:00
Lukas Pühringer
fc9b42fa5d
Merge pull request #1871 from lukpueh/rm-authors-txt
doc: update acknowledgements and rm AUHTORS.txt
2022-02-16 13:29:09 +01:00
Lukas Pühringer
217a508b35
Merge pull request #1870 from jku/github-script-v6
github: Update github-script to 6.0.0
2022-02-16 11:40:02 +01:00
Lukas Puehringer
c5e787c328 CI: remind to update contributor acknowledgement
Add optional task to  maintainer permission review reminder
checklist that suggests to also update the list of significant
contributors in README.md#acknowledgements.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-16 11:09:25 +01:00
Lukas Puehringer
5845c8992c doc: update acknowledgements and rm AUHTORS.txt
Update README.md#Acknowledgements
- Reword to acknowledge maintainer contributions as well
- Remove names that are mentioned in maintainers document
- Remove duplicate Konstantin Andrianov
  Santiago Torres-Arias, Sebastien Awwad, Trishank Kuppusamy,
  Vladimir Diaz)
- Add new significant contributors
  (Ivana Atanasova, Kairo de Araujo, Martin Vrachev)

Remove unmaintained AUTHORS.txt, which lists many individuals and
organisations that are/were not affiliated with 'python-tuf', but
other projects in the TUF ecosystem (Thandy, Notary, etc.) and
thus is not suited for this repository.
-> theupdateframework.io#38

Caveats:
- Significant contributors means  top ~20 committers sorted by
  commit count (`git shortlog -s`).
- The Acknowledgements section might miss significant contributors,
  if they contributed by other means than git commits in this repo.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-16 11:01:18 +01:00
Jussi Kukkonen
d806b62e03 github: Update github-script to 6.0.0
The big change is runtime update from nodejs 12 to nodejs 16: does not
seem to affect us.

Dependabot got confused so this update is done manually to v6.0.0
release commit:
https://github.com/actions/github-script/releases/tag/v6.0.0

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2022-02-16 10:13:41 +02:00
Lukas Pühringer
0b64056ca4
Merge pull request #1868 from lukpueh/minor-doc-updates
doc: minor updates in readme and reference docs
2022-02-15 14:55:52 +01:00
Lukas Puehringer
7a13933af6 doc: remove note about unstable API in RTD docs
The API is no longer unstable.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-15 13:46:19 +01:00
Lukas Puehringer
24561bc4bb doc: minor readme updates
- Add generic opening sentence that says what TUF actually does.
- Add link to #tuf channel on CNCF slack to contact section

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-15 13:46:12 +01:00
Lukas Puehringer
5643cecf68 build: pin test requirements for deterministic CI
Configures tox to use a pinned requirements file for deterministic
CI builds, i.e. our CI shouldn't start failing because of an
incompatible upstream release of any of our testing tools:

NOTE: pinned tuf runtime requirements were already were already
used for test builds before (included via `-r
requirements-pinned.txt` in 'requirements-test.txt'). Now they are
explicitly listed in 'requirements-test-pinnned.txt'.

'requirements-test-pinnned.txt' was generated semi-automatically by
running pip-compile over 'requirements-test.txt' for each
supported/tested Python version (see snippet below) and manually
merging the resulting per-Python version requirements files into
one, adding environment markers as needed.

```
for ver in 3.7.12 3.8.12 3.9.9 3.10.0; do
  pyenv virtualenv ${ver} tuf-env-${ver}
  pyenv activate tuf-env-${ver}
  python3 -m pip install -U pip pip-tools
  pip-compile --no-header --annotation-style line \
      -o requirements-test-pinned-${ver}.txt \
      requirements-test.txt
  pyenv deactivate
  pyenv uninstall -f tuf-env-${ver}
done
```

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-15 12:27:49 +01:00
Jussi Kukkonen
7dc057adab
Merge pull request #1865 from lukpueh/update-req-pinned
dep: update pinned requirements
2022-02-14 14:12:26 +02:00
Jussi Kukkonen
899b762119
Merge pull request #1853 from lukpueh/update-install-docs
doc: update installation documentation
2022-02-14 14:10:37 +02:00
Lukas Puehringer
8ec45dc9d4 dep: update pinned requirements
As described in #1249 requirements-pinned.txt is automatically
updated by Dependabot on version updates, but not if transitive
dependencies are added or removed.

This patch removes the no longer required transient dependency six,
following a run of pip-compile for all supported Python versions.

No other dependency changes were detected, nor were there different
dependencies in different Python versions, requiring env markers
in the requirements file.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-14 12:53:46 +01:00
Jussi Kukkonen
73ce299382
Merge pull request #1861 from MVrachev/metadata-unrecognized-fields 2022-02-14 13:36:40 +02:00
Lukas Pühringer
216c1eba51
Merge pull request #1856 from ivanayov/ngclient_docstrings_imprv
Ngclient docstrings improvement
2022-02-14 12:13:07 +01:00
Lukas Pühringer
66b3b46532
Merge pull request #1863 from theupdateframework/dependabot/pip/charset-normalizer-2.0.12
build(deps): bump charset-normalizer from 2.0.11 to 2.0.12
2022-02-14 11:42:01 +01:00
Martin Vrachev
922c5d28e5 Add support for unrecognized fields in Metadata
The Document formats section (chapter 4) of the
specification says the following:

"All of the formats described below include the ability to add more
attribute-value fields to objects for backward-compatible format
changes. Implementers who encounter undefined attribute-value pairs in
the format must include the data when calculating hashes or verifying
signatures and must preserve the data when re-serializing."

I initially thought it's applicable only to the SIGNED fields as
"undefined attribute-value pairs in the format must include the data
when calculating hashes or verifying signatures"
This doesn't mean that the sentence before that excludes "Metadata" as a
possible place for additional fields.
The other maintainers agreed with me and we are going to add support for
'unrecognized_fields" inside "Metadata".

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-14 12:12:54 +02:00
dependabot[bot]
2f59322cef
build(deps): bump charset-normalizer from 2.0.11 to 2.0.12
Bumps [charset-normalizer](https://github.com/ousret/charset_normalizer) from 2.0.11 to 2.0.12.
- [Release notes](https://github.com/ousret/charset_normalizer/releases)
- [Changelog](https://github.com/Ousret/charset_normalizer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ousret/charset_normalizer/compare/2.0.11...2.0.12)

---
updated-dependencies:
- dependency-name: charset-normalizer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 10:08:35 +00:00
Ivana Atanasova
a0d31854bc Fix line lengths in ngclient docstrings
This change shortens line lengths that exceed the requiremets and
adds more clarification on methods where the short message is not
complete enough

Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
2022-02-11 15:33:48 +02:00
Ivana Atanasova
43080e1228 Unify wording of docstrings language in ngclient
This change unifies common wording in the docstrings library of
ngclient, like "Args" vs. "Arguments"

Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
2022-02-11 14:51:51 +02:00
Ivana Atanasova
d399ad5d1b Unify article in ngclient docstrings
This change updates the docstrings library of ngclient with no
article for all Args in order to be unified amongst all python-tuf
docstrings

Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
2022-02-11 14:51:51 +02:00
Ivana Atanasova
d8f60e1baf Unify quoting in ngclient docstrings
This change updates the docstrings library of ngclient with
unified double backtick quoting for better readability

Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
2022-02-11 14:51:28 +02:00
Lukas Pühringer
a347d034a2
Merge pull request #1809 from MVrachev/signatures-tests
Add Metadata.signatures serialization tests
2022-02-11 11:47:59 +01:00
Lukas Pühringer
3b135d71f1
Merge pull request #1855 from lukpueh/update-maintainers-txt
doc: Remove inactive maintainers from MAINTAINERS
2022-02-11 10:58:47 +01:00
Lukas Puehringer
16e6f739a5 doc: add emeritus section to maintainers file
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-11 09:49:33 +01:00
Martin Vrachev
17503ebba3 Remove unnecessary copy operations
There is no need to copy "case_dict" inside serialization test
functions in test_metadata_serialization.py when we are testing
invalid arguments.
These dictionaries are not be used after calling "from_dict" and
it doesn't matter if they are empty afterward.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-10 17:30:35 +02:00
Martin Vrachev
cd34793b0a Move nonunique sigs test to serialization tests
Move the duplicating signatures tests from test_metadata_base function
in test_api.py into test_metadata_serialization.py.
This is a more logical place to store this test case as
test_metadata_base is actually focused on testing
Metadata.signed.is_expired.
That also is the reason why I renamed test_metadata_base to
test_metadata_signed_is_expired.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-10 17:30:35 +02:00
Martin Vrachev
d2a840f8e1 Add signatures serialization tests
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-10 17:30:35 +02:00
Martin Vrachev
bf5c6ee533 Update securesystemslib version to 0.22.0
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
2022-02-10 17:30:35 +02:00
Lukas Puehringer
b94ef08b30 doc: Remove inactive maintainers from MAINTAINERS
As discussed in detail in #1793, maintainer-level (GitHub)
permissions should be granted to those who need them, i.e. who
actively maintain the project at the moment.
The MAINTAINERS.txt file should reflect that state.

It will be reviewed regularly (#1803), and can be changed (e.g.
reverted to a prior state) at any time as need arises.

To express our appreciation for past efforts, we might use the
Acknowledgement section of the README, and also update it
regularly.

In the case of this update: Big kudos to @awwad, @SantiagoTorres
and @sechkova for all their valuable contributions to python-tuf!

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-10 13:11:21 +01:00
Lukas Puehringer
cd70e47d14 doc: cross-doc absolute link hack
This is an ugly hack to also resolve the link when the document is
rendered in GitHub, where it is likely to be browsed, because it is
the community standard location for a GitHub repo's contributing
docs.

Coordinate with #1849 to better separate RTD docs with GitHub docs
in the future.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-10 10:10:20 +01:00
Lukas Puehringer
02167403f2 doc: move verify section in install docs
Move release signature verification instructions to bottom of
install docs. The doc is short, so the section is still prominent
enough for promoting verification, but does not break the reading
flow as much anymore.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-10 10:07:13 +01:00
Jussi Kukkonen
99059a5661
Merge pull request #1848 from lukpueh/rm-docs-images
doc: remove obsolete docs/images dir
2022-02-10 10:20:15 +02:00
Lukas Puehringer
c40bb3092b doc: fix link to tox docs
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-09 17:56:35 +01:00
Lukas Puehringer
0b2b1bbe0e doc: minor title changes for rtd navbar
Make contributing document header sentence case for consistency
with other docs and shorten menu name in side navbar to stand out
less.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2022-02-09 17:56:35 +01:00