Unit testing for bundled trust root getters#591
Conversation
|
I was originally planning on using the staging root for this test, but sigstore/root-signing#756 is still inflight. We can cutover and update staging test assets whenever that lands. |
7458d2d to
bbca128
Compare
test/unit/internal/test_tuf.py
Outdated
| # The test should use the TUF path, so we stub out the legacy getter here. | ||
| monkeypatch.setattr(updater, "_get", lambda usage, statuses: []) | ||
|
|
||
| assert _der_keys(updater.get_ctfe_keys()) == _pem_keys([_contents("ctfe_2022.pub")]) |
There was a problem hiding this comment.
Just so I know what to expect. When there's a key rotation, we should expect these to begin failing right? And in that case, we should refresh the keys and certs under assets/prod-tuf.
There was a problem hiding this comment.
Yep! I could alternatively monkeypatch datetime.now to return a static time, if we think that would be better :)
There was a problem hiding this comment.
also, i intend on removing assets/prod-tuf and switching to our staging assets once staging has bundled roots
There was a problem hiding this comment.
Hmm, I'm not too bothered by it. If it becomes annoying then we can look into monkey patching the time, but for now I'd say we can switch to staging assets when it's ready and pull the trigger on this.
These tests need to be updated for our new trusted root format. Testing for that is landing in sigstore#591. Signed-off-by: Andrew Pan <[email protected]>
* Update staging-root.json Change hardcoded root to the new root from sigstore/root-signing#756 Signed-off-by: Hayden B <[email protected]> * wip: test: adjust local assets for staging update Signed-off-by: Andrew Pan <[email protected]> * test_tuf: skip failing getter tests These tests need to be updated for our new trusted root format. Testing for that is landing in #591. Signed-off-by: Andrew Pan <[email protected]> * fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * test_tuf: doc Signed-off-by: Andrew Pan <[email protected]> * test: add staging-tuf targets Signed-off-by: Andrew Pan <[email protected]> --------- Signed-off-by: Hayden B <[email protected]> Signed-off-by: Andrew Pan <[email protected]> Co-authored-by: Hayden B <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
bbca128 to
9d4378b
Compare
Signed-off-by: Andrew Pan <[email protected]>
Signed-off-by: Andrew Pan <[email protected]>
| success[filepath] += 1 | ||
| return BytesIO(filepath.read_bytes()) | ||
| else: | ||
| print(f"POO {filepath}") |
* Update staging-root.json Change hardcoded root to the new root from sigstore/root-signing#756 Signed-off-by: Hayden B <[email protected]> * wip: test: adjust local assets for staging update Signed-off-by: Andrew Pan <[email protected]> * test_tuf: skip failing getter tests These tests need to be updated for our new trusted root format. Testing for that is landing in sigstore#591. Signed-off-by: Andrew Pan <[email protected]> * fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * fixup! fixup! fixup! fixup! test_tuf: skip failing getter tests Signed-off-by: Andrew Pan <[email protected]> * test_tuf: doc Signed-off-by: Andrew Pan <[email protected]> * test: add staging-tuf targets Signed-off-by: Andrew Pan <[email protected]> --------- Signed-off-by: Hayden B <[email protected]> Signed-off-by: Andrew Pan <[email protected]> Co-authored-by: Hayden B <[email protected]> Signed-off-by: Emile Baez <[email protected]>
* wip: test_tuf, tuf: basic bundled tests Signed-off-by: Andrew Pan <[email protected]> * tuf: use correct tlogs for rekor Signed-off-by: Andrew Pan <[email protected]> * test_tuf: test all bundled root getters Signed-off-by: Andrew Pan <[email protected]> * assets/prod-tuf: checkin Signed-off-by: Andrew Pan <[email protected]> * assets/prod-tuf: ajouter plus d'keys Signed-off-by: Andrew Pan <[email protected]> * test_tuf: reformat Signed-off-by: Andrew Pan <[email protected]> * test_tuf, conftest: staging bundled root changes Signed-off-by: Andrew Pan <[email protected]> * assets/prod-tuf: rm Signed-off-by: Andrew Pan <[email protected]> --------- Signed-off-by: Andrew Pan <[email protected]> Co-authored-by: Alex Cameron <[email protected]> Signed-off-by: Emile Baez <[email protected]>
This changeset exercises the bundled trusted root codepaths in
get_rekor_keys,get_ctfe_keys, andget_fulcio_certswith new offline tests. We also yakshave the TUF module further.Resolves #580.