Skip to content

Commit 815ab11

Browse files
Kairo de Araujokairoaraujo
Kairo de Araujo
authored andcommitted
Implement python-tuf 2.0.0
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 <[email protected]>
1 parent 8fe843e commit 815ab11

File tree

13 files changed

+584
-1319
lines changed

13 files changed

+584
-1319
lines changed

requirements/main.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ stripe
6464
structlog
6565
transaction
6666
trove-classifiers
67-
tuf==1.1.0
67+
tuf==2.0.0
6868
typeguard
6969
webauthn>=1.0.0,<2.0.0
7070
whitenoise

requirements/main.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,10 +1199,6 @@ securesystemslib==0.22.0 \
11991199
# via
12001200
# -r requirements/main.in
12011201
# tuf
1202-
sentry-sdk==1.6.0 \
1203-
--hash=sha256:b82ad57306d5546713f15d5d70daea0408cf7f998c7566db16e0e6257e51e561 \
1204-
--hash=sha256:ddbd191b6f4e696b7845b4d87389898ae1207981faf114f968a57363aa6be03c
1205-
# via -r requirements/main.in
12061202
six==1.16.0 \
12071203
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
12081204
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
@@ -1305,9 +1301,9 @@ trove-classifiers==2022.8.31 \
13051301
--hash=sha256:0db52e6a5cbe1035f306fcfee0066f22bcf842004f19dcc6258e309e36e5eb5f \
13061302
--hash=sha256:9e32190e4ec0b7a173789ee0db20c433ef25060e98f64ff32ae4111990085526
13071303
# via -r requirements/main.in
1308-
tuf==1.1.0 \
1309-
--hash=sha256:28cd35eafa5aa4223eba03a397d14acb57c522381180db9ff3b54477dcbe1b73 \
1310-
--hash=sha256:512a864789e291b5e8f5a5ace0e87b2d158303364a77ad6e53ffd042ba2b4933
1304+
tuf==2.0.0 \
1305+
--hash=sha256:1524b0fbd8504245f600f121daf86b8fdcb30df74410acc9655944c4868e461c \
1306+
--hash=sha256:76e7f2a7aced84466865fac2a7127b6085afae51d4328af896fb46f952dd3a53
13111307
# via -r requirements/main.in
13121308
typeguard==2.13.3 \
13131309
--hash=sha256:00edaa8da3a133674796cf5ea87d9f4b4c367d77476e185e80251cc13dfbb8c4 \

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
from warehouse.subscriptions import services as subscription_services
5454
from warehouse.subscriptions.interfaces import IBillingService, ISubscriptionService
5555
from warehouse.tuf.interfaces import IKeyService
56-
from warehouse.tuf.repository import MetadataRepository
56+
from warehouse.tuf.services import RepositoryService
5757

5858
from .common.db import Session
5959
from .common.db.accounts import EmailFactory, UserFactory
@@ -475,7 +475,7 @@ class FakeKeyBackend(IKeyService):
475475
"tuf.bin-n.expiry": 604800,
476476
}
477477

478-
tuf_repo = MetadataRepository(
478+
tuf_repo = RepositoryService(
479479
FakeStorageBackend, FakeKeyBackend, db_request.registry.settings
480480
)
481481
return tuf_repo

tests/unit/cli/test_tuf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,9 @@ def test_add_all_indexes_content_hash_none(self, cli, monkeypatch):
297297

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

300-
assert result.exit_code == 0
300+
assert result.exit_code == 1
301301
assert config.task.calls == [
302302
pretend.call(_add_hashed_targets),
303-
pretend.call(_add_hashed_targets),
304303
]
305304
assert task.get_request.calls == [pretend.call()]
306305

tests/unit/tuf/test_hash_bins.py

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)