Skip to content

Commit

Permalink
Implement python-tuf 2.0.0
Browse files Browse the repository at this point in the history
The introduction of python-tuf 2.0.0 adds the feature of Succinct
Delegation Roles as part of TAP15
(https://github.com/theupdateframework/taps/blob/master/tap15.md)

This feature reduces the number of lines as the Hash Bins become
built-in on python-tuf.

All unit tests updated.

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
  • Loading branch information
Kairo de Araujo authored and kairoaraujo committed Sep 20, 2022
1 parent 8fe843e commit 815ab11
Show file tree
Hide file tree
Showing 13 changed files with 584 additions and 1,319 deletions.
2 changes: 1 addition & 1 deletion requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ stripe
structlog
transaction
trove-classifiers
tuf==1.1.0
tuf==2.0.0
typeguard
webauthn>=1.0.0,<2.0.0
whitenoise
Expand Down
10 changes: 3 additions & 7 deletions requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1199,10 +1199,6 @@ securesystemslib==0.22.0 \
# via
# -r requirements/main.in
# tuf
sentry-sdk==1.6.0 \
--hash=sha256:b82ad57306d5546713f15d5d70daea0408cf7f998c7566db16e0e6257e51e561 \
--hash=sha256:ddbd191b6f4e696b7845b4d87389898ae1207981faf114f968a57363aa6be03c
# via -r requirements/main.in
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
Expand Down Expand Up @@ -1305,9 +1301,9 @@ trove-classifiers==2022.8.31 \
--hash=sha256:0db52e6a5cbe1035f306fcfee0066f22bcf842004f19dcc6258e309e36e5eb5f \
--hash=sha256:9e32190e4ec0b7a173789ee0db20c433ef25060e98f64ff32ae4111990085526
# via -r requirements/main.in
tuf==1.1.0 \
--hash=sha256:28cd35eafa5aa4223eba03a397d14acb57c522381180db9ff3b54477dcbe1b73 \
--hash=sha256:512a864789e291b5e8f5a5ace0e87b2d158303364a77ad6e53ffd042ba2b4933
tuf==2.0.0 \
--hash=sha256:1524b0fbd8504245f600f121daf86b8fdcb30df74410acc9655944c4868e461c \
--hash=sha256:76e7f2a7aced84466865fac2a7127b6085afae51d4328af896fb46f952dd3a53
# via -r requirements/main.in
typeguard==2.13.3 \
--hash=sha256:00edaa8da3a133674796cf5ea87d9f4b4c367d77476e185e80251cc13dfbb8c4 \
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from warehouse.subscriptions import services as subscription_services
from warehouse.subscriptions.interfaces import IBillingService, ISubscriptionService
from warehouse.tuf.interfaces import IKeyService
from warehouse.tuf.repository import MetadataRepository
from warehouse.tuf.services import RepositoryService

from .common.db import Session
from .common.db.accounts import EmailFactory, UserFactory
Expand Down Expand Up @@ -475,7 +475,7 @@ class FakeKeyBackend(IKeyService):
"tuf.bin-n.expiry": 604800,
}

tuf_repo = MetadataRepository(
tuf_repo = RepositoryService(
FakeStorageBackend, FakeKeyBackend, db_request.registry.settings
)
return tuf_repo
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/cli/test_tuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,9 @@ def test_add_all_indexes_content_hash_none(self, cli, monkeypatch):

result = cli.invoke(add_all_indexes, obj=config)

assert result.exit_code == 0
assert result.exit_code == 1
assert config.task.calls == [
pretend.call(_add_hashed_targets),
pretend.call(_add_hashed_targets),
]
assert task.get_request.calls == [pretend.call()]

Expand Down
61 changes: 0 additions & 61 deletions tests/unit/tuf/test_hash_bins.py

This file was deleted.

Loading

0 comments on commit 815ab11

Please sign in to comment.