Skip to content

Commit 10d7815

Browse files
Kairo de Araujokairoaraujo
authored andcommitted
WIP: TUF Initialization using python-tuf 1.0.0
This work refactors the [Draft PR](pypi#7488) by @ woodruffw, to build a new repository tool on top of the Python-TUF Metadata API, and use it instead of the Python-TUF repository tool that was deprecated in v1.0.0. Part of pypi#10672 Signed-off-by: Kairo de Araujo <[email protected]>
1 parent eb24643 commit 10d7815

37 files changed

+1522
-700
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ docker-compose.override.yaml
2020

2121
node_modules/
2222

23-
dev/tuf.*
23+
dev/tufkeys/
2424
dev/example.sql
2525
dev/prod.sql
2626
dev/prod.sql.xz

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
DB := example
22
IPYTHON := no
3-
LOCALES := $(shell .state/env/bin/python -c "from warehouse.i18n import KNOWN_LOCALES; print(' '.join(set(KNOWN_LOCALES)-{'en'}))")
43
WAREHOUSE_CLI := docker-compose run --rm web python -m warehouse
54

65
# set environment variable WAREHOUSE_IPYTHON_SHELL=1 if IPython
@@ -97,14 +96,17 @@ initdb: .state/docker-build-web
9796
$(MAKE) reindex
9897

9998
inittuf:
100-
$(WAREHOUSE_CLI) tuf keypair --name root --path /opt/warehouse/src/dev/tuf.root
101-
$(WAREHOUSE_CLI) tuf keypair --name snapshot --path /opt/warehouse/src/dev/tuf.snapshot
102-
$(WAREHOUSE_CLI) tuf keypair --name targets --path /opt/warehouse/src/dev/tuf.targets
103-
$(WAREHOUSE_CLI) tuf keypair --name timestamp --path /opt/warehouse/src/dev/tuf.timestamp
104-
$(WAREHOUSE_CLI) tuf keypair --name bins --path /opt/warehouse/src/dev/tuf.bins
105-
$(WAREHOUSE_CLI) tuf keypair --name bin-n --path /opt/warehouse/src/dev/tuf.bin-n
106-
$(WAREHOUSE_CLI) tuf new-repo
107-
$(WAREHOUSE_CLI) tuf build-targets
99+
$(WAREHOUSE_CLI) tuf dev keypair --name root --path /opt/warehouse/src/dev/tufkeys/root
100+
$(WAREHOUSE_CLI) tuf dev keypair --name snapshot --path /opt/warehouse/src/dev/tufkeys/snapshot
101+
$(WAREHOUSE_CLI) tuf dev keypair --name targets --path /opt/warehouse/src/dev/tufkeys/targets1
102+
$(WAREHOUSE_CLI) tuf dev keypair --name targets --path /opt/warehouse/src/dev/tufkeys/targets2
103+
$(WAREHOUSE_CLI) tuf dev keypair --name timestamp --path /opt/warehouse/src/dev/tufkeys/timestamp
104+
$(WAREHOUSE_CLI) tuf dev keypair --name bins --path /opt/warehouse/src/dev/tufkeys/bins
105+
$(WAREHOUSE_CLI) tuf dev keypair --name bin-n --path /opt/warehouse/src/dev/tufkeys/bin-n
106+
$(WAREHOUSE_CLI) tuf dev init-repo
107+
$(WAREHOUSE_CLI) tuf dev init-delegations
108+
$(WAREHOUSE_CLI) tuf dev add-all-packages
109+
$(WAREHOUSE_CLI) tuf dev add-all-indexes
108110

109111
reindex: .state/docker-build-web
110112
docker-compose run --rm web python -m warehouse search reindex
@@ -114,6 +116,7 @@ shell: .state/docker-build-web
114116

115117
clean:
116118
rm -rf dev/*.sql
119+
rm -rf dev/tufkeys
117120

118121
purge: stop clean
119122
rm -rf .state

dev/environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ TUF_SNAPSHOT_SECRET="an insecure private key password"
6666
TUF_TARGETS_SECRET="an insecure private key password"
6767
TUF_TIMESTAMP_SECRET="an insecure private key password"
6868
TUF_BINS_SECRET="an insecure private key password"
69-
TUF_BIN_N_SECRET="an insecure private key password"
69+
TUF_BIN_N_SECRET="an insecure private key password"

dev/tufkeys/bin-n

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/bin-n.pub

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/bins

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/bins.pub

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/root

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/root.pub

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev/tufkeys/snapshot

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)