@@ -96,7 +96,7 @@ def test_trust_root_tuf_caches_and_requests(mock_staging_tuf, tuf_dirs):
96
96
# keep track of requests the TrustUpdater invoked by TrustedRoot makes
97
97
reqs , fail_reqs = mock_staging_tuf
98
98
99
- trust_root = TrustedRoot .staging ()
99
+ trust_root = ClientTrustConfig .staging ()
100
100
# metadata was "downloaded" from staging
101
101
expected = [
102
102
"root.json" ,
@@ -126,7 +126,7 @@ def test_trust_root_tuf_caches_and_requests(mock_staging_tuf, tuf_dirs):
126
126
assert fail_reqs == expected_fail_reqs
127
127
128
128
# New trust root (and TrustUpdater instance), same cache dirs
129
- trust_root = TrustedRoot .staging ()
129
+ trust_root = ClientTrustConfig .staging ()
130
130
131
131
# Expect new timestamp and root requests
132
132
expected_requests ["timestamp.json" ] += 1
@@ -148,7 +148,7 @@ def test_trust_root_tuf_offline(mock_staging_tuf, tuf_dirs):
148
148
# keep track of requests the TrustUpdater invoked by TrustedRoot makes
149
149
reqs , fail_reqs = mock_staging_tuf
150
150
151
- trust_root = TrustedRoot .staging (offline = True )
151
+ trust_root = ClientTrustConfig .staging (offline = True )
152
152
153
153
# local TUF metadata is not initialized, nothing is downloaded
154
154
assert not os .path .exists (data_dir )
@@ -217,7 +217,7 @@ def _pem_keys(keys):
217
217
]
218
218
219
219
# Assert that trust root from TUF contains the expected keys/certs
220
- trust_root = TrustedRoot .staging ()
220
+ trust_root = ClientTrustConfig .staging (). trusted_root
221
221
assert ctfe_keys [0 ] in get_public_bytes (
222
222
[
223
223
k .key
@@ -240,7 +240,7 @@ def _pem_keys(keys):
240
240
assert trust_root .get_fulcio_certs () == fulcio_certs
241
241
242
242
# Assert that trust root from offline TUF contains the expected keys/certs
243
- trust_root = TrustedRoot .staging (offline = True )
243
+ trust_root = ClientTrustConfig .staging (offline = True ). trust_root
244
244
assert ctfe_keys [0 ] in get_public_bytes (
245
245
[
246
246
k .key
@@ -289,18 +289,18 @@ def _pem_keys(keys):
289
289
290
290
def test_trust_root_tuf_instance_error ():
291
291
with pytest .raises (RootError ):
292
- TrustedRoot .from_tuf ("foo.bar" )
292
+ ClientTrustConfig .from_tuf ("foo.bar" )
293
293
294
294
295
295
def test_trust_root_tuf_ctfe_keys_error (monkeypatch ):
296
- trust_root = TrustedRoot .staging (offline = True )
296
+ trust_root = ClientTrustConfig .staging (offline = True ). trusted_root
297
297
monkeypatch .setattr (trust_root ._inner , "ctlogs" , [])
298
298
with pytest .raises (Exception , match = "CTFE keys not found in trusted root" ):
299
299
trust_root .ct_keyring (purpose = KeyringPurpose .VERIFY )
300
300
301
301
302
302
def test_trust_root_fulcio_certs_error (tuf_asset , monkeypatch ):
303
- trust_root = TrustedRoot .staging (offline = True )
303
+ trust_root = ClientTrustConfig .staging (offline = True ). trusted_root
304
304
monkeypatch .setattr (trust_root ._inner , "certificate_authorities" , [])
305
305
with pytest .raises (
306
306
Exception , match = "Fulcio certificates not found in trusted root"
0 commit comments