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 update.

Signed-off-by: Kairo de Araujo <kdearaujo@vmware.com>
  • Loading branch information
Kairo de Araujo committed Aug 22, 2022
1 parent f6c134b commit eccef82
Show file tree
Hide file tree
Showing 13 changed files with 584 additions and 1,315 deletions.
2 changes: 1 addition & 1 deletion requirements/main.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ stdlib-list
structlog
transaction
trove-classifiers
tuf==1.1.0
tuf==2.0.0
typeguard
webauthn>=1.0.0,<2.0.0
whitenoise
Expand Down
6 changes: 3 additions & 3 deletions requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1270,9 +1270,9 @@ trove-classifiers==2022.8.7 \
--hash=sha256:10053f2df40092c2d65d750cf12fab6df28714e422114fed91465814939a3284 \
--hash=sha256:c0618efe27904e272de1212143c8554657eef8adcf9800f1d2a1cf7164cc185b
# 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 @@ -50,7 +50,7 @@
from warehouse.organizations import services as organization_services
from warehouse.organizations.interfaces import IOrganizationService
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 @@ -446,7 +446,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 eccef82

Please sign in to comment.