Skip to content

Commit f617964

Browse files
committed
tuf: More repo loading skeleton code
1 parent 79c1e82 commit f617964

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

warehouse/tuf/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
def includeme(config):
2222
config.add_settings(
2323
{
24+
"tuf.repository": "TODO",
2425
"tuf.keytype": "ed25519",
2526
"tuf.keyid_hash_algorithm": "sha512",
2627
"tuf.consistent_snapshot": True,

warehouse/tuf/tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def add_target(task, request, file):
2222

2323
with utils.RepoLock(r):
2424
fileinfo = utils.make_fileinfo(file)
25-
repository = utils.open_repository(request)
25+
repository = utils.load_repository(request)
2626

2727
repository.add_target_to_bin(file.path, fileinfo=fileinfo)
2828

warehouse/tuf/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# limitations under the License.
1212

1313
import tuf.formats
14+
import tuf.repository_tool
1415

1516

1617
def make_fileinfo(file, custom=None):
@@ -27,8 +28,10 @@ def make_fileinfo(file, custom=None):
2728
return fileinfo
2829

2930

30-
def open_repository(request):
31-
pass
31+
def load_repository(request):
32+
return tuf.repository_tool.load_repository(
33+
request.registry.settings["tuf.repository"]
34+
)
3235

3336

3437
class RepoLock:

0 commit comments

Comments
 (0)