Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update to new securesystemslib API #2617

Merged
merged 4 commits into from
May 3, 2024

Conversation

jku
Copy link
Member

@jku jku commented Apr 24, 2024

Update to new (currently unreleased) securesystemslib API

  • API changes covered:
    • keys and interface modules removed
    • SSlibSigner removed
    • CryptoSigner added: this replaces the removed functionality
    • DSSE "signatures" container type changed
  • Currently pins a securesystemslib main branch commit:
    this should be reverted before merging, when securesystemslib
    has made a release
  • tests/generated_data/generate_md.py was simplified
  • Encrypted test keys in tests/repository_data/keystore were replaced
    with the unencrypted PEM versions of the same keys
  • The public test keys in tests/repository_data/keystore were removed
    as they were not used anymore

It's a bit annoyingly in a single commit... but I was working on this fixing one test failure at a time: reasonable commits were not really an option during the work. Anyway, I think this proves the securesystemslib API changes are solid enough.

TODO:

  • wait for securesystemslib release
  • revert the pinned.txt change, update the dpendency in pyproject.toml

@jku

This comment was marked as outdated.

@jku
Copy link
Member Author

jku commented Apr 25, 2024

rebase on main

@coveralls
Copy link

coveralls commented Apr 25, 2024

Pull Request Test Coverage Report for Build 8936840461

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 33 of 33 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 97.588%

Totals Coverage Status
Change from base Build 8829329118: -0.02%
Covered Lines: 1462
Relevant Lines: 1487

💛 - Coveralls

Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

examples/uploader/_localrepo.py Outdated Show resolved Hide resolved
tests/test_api.py Show resolved Hide resolved
jku added 2 commits April 25, 2024 14:27
* API changes covered:
  * keys and interface modules removed
  * SSlibSigner removed
  * CryptoSigner added: this replaces the removed functionality
  * DSSE "signatures" container type changed
* Currently pins a securesystemslib main branch commit:
  this shoudl be reverted before merging, when securesystemslib
  has made a release
* tests/generated_data/generate_md.py was simplified
* Encrypted test keys in tests/repository_data/keystore were replaced
  with the unencrypted PEM versions of the same keys
* The public test keys in tests/repository_data/keystore were removed
  as they were not used anymore

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
private_bytes was just added to CryptoSigner, use it.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku
Copy link
Member Author

jku commented May 2, 2024

I suppose this is now ready for review 🤷

@jku jku marked this pull request as ready for review May 2, 2024 11:13
lukpueh added a commit to lukpueh/repository-service-tuf-worker that referenced this pull request May 2, 2024
* Update securesystemslib 1.0.0 in requirements*.txt files
  -> requires pinning a dev version of tuf
  TODO: - adopt in Pipfile
	- update tuf when theupdateframework/python-tuf#2617 is
	  released

* Remove local keyvault service, which makes heavy use of legacy
  securesystemslib interfaces removed in 1.0.0.
  TODO: - adopt in docs, config, etc
	- consider removing obsolete IKeyVault

* Remove keyvault initialisation in MetadatRepository, which (I think)
  would try to load local key vault otherwise

* Adopt removal in tests, just enough, so that they pass.
  TODO: - check if the tests still make sense

* Drop registration of CryptoSigner and use its new uri scheme "file2"
  in SignerStore.
  "file2" can be used like "file", but only for non-encrypted key files,
  which is all we care for in the worker.
  "file2" can also be used like "fn"  from the custom "FileNameSigner",
  i.e. with a directory specified via envvar.

  TODO: - consider only using "file2" and dropping the custom
          "FileNameSigner" (or only using it to ovverride the scheme
	  name and the envvar name.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Copy link
Member

@lukpueh lukpueh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. There's one mention of SSlibSigner left in a docstring. I can remove it.

``securesystemslib.signer.SSlibSigner``.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
@lukpueh lukpueh merged commit 4a26a0c into theupdateframework:develop May 3, 2024
15 checks passed
lukpueh added a commit to lukpueh/repository-service-tuf-worker that referenced this pull request May 3, 2024
* Update securesystemslib 1.0.0 in requirements*.txt files
  -> requires pinning a dev version of tuf

  TODO: - adopt in Pipfile (I tried, but `pipenv lock` was taking
	  way too long for my taste)
	- update tuf when theupdateframework/python-tuf#2617 is
	  released

* Remove local keyvault service, which makes heavy use of legacy
  securesystemslib interfaces, which are no longer available in 1.0.0.
  TODO: - adopt in docs, config, etc
	- consider removing obsolete IKeyVault

* Remove keyvault initialisation in MetadatRepository, which
  would try to load local key vault in tests, given the current configs
  (see TODO above)

* Adopt removal in tests, just enough, so that they pass.
  TODO: - check if the tests still make sense

* Drop registration of CryptoSigner and use its new uri scheme "file2"
  in SignerStore.
  "file2" can be used like "file", but only for non-encrypted key files,
  which is all we care for in the worker.
  "file2" can also be used like "fn"  from the custom "FileNameSigner",
  i.e. with a directory specified via envvar.

  TODO: - consider only using "file2" and dropping the custom
          "FileNameSigner" (or only using it to ovverride the scheme
	  name and the envvar name)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
kairoaraujo pushed a commit to lukpueh/repository-service-tuf-worker that referenced this pull request Jul 25, 2024
* Update securesystemslib 1.0.0 in requirements*.txt files
  -> requires pinning a dev version of tuf

  TODO: - adopt in Pipfile (I tried, but `pipenv lock` was taking
	  way too long for my taste)
	- update tuf when theupdateframework/python-tuf#2617 is
	  released

* Remove local keyvault service, which makes heavy use of legacy
  securesystemslib interfaces, which are no longer available in 1.0.0.
  TODO: - adopt in docs, config, etc
	- consider removing obsolete IKeyVault

* Remove keyvault initialisation in MetadatRepository, which
  would try to load local key vault in tests, given the current configs
  (see TODO above)

* Adopt removal in tests, just enough, so that they pass.
  TODO: - check if the tests still make sense

* Drop registration of CryptoSigner and use its new uri scheme "file2"
  in SignerStore.
  "file2" can be used like "file", but only for non-encrypted key files,
  which is all we care for in the worker.
  "file2" can also be used like "fn"  from the custom "FileNameSigner",
  i.e. with a directory specified via envvar.

  TODO: - consider only using "file2" and dropping the custom
          "FileNameSigner" (or only using it to ovverride the scheme
	  name and the envvar name)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
MVrachev pushed a commit to repository-service-tuf/repository-service-tuf-worker that referenced this pull request Jul 26, 2024
* Update securesystemslib 1.0.0 (WIP)

* Update securesystemslib 1.0.0 in requirements*.txt files
  -> requires pinning a dev version of tuf

  TODO: - adopt in Pipfile (I tried, but `pipenv lock` was taking
	  way too long for my taste)
	- update tuf when theupdateframework/python-tuf#2617 is
	  released

* Remove local keyvault service, which makes heavy use of legacy
  securesystemslib interfaces, which are no longer available in 1.0.0.
  TODO: - adopt in docs, config, etc
	- consider removing obsolete IKeyVault

* Remove keyvault initialisation in MetadatRepository, which
  would try to load local key vault in tests, given the current configs
  (see TODO above)

* Adopt removal in tests, just enough, so that they pass.
  TODO: - check if the tests still make sense

* Drop registration of CryptoSigner and use its new uri scheme "file2"
  in SignerStore.
  "file2" can be used like "file", but only for non-encrypted key files,
  which is all we care for in the worker.
  "file2" can also be used like "fn"  from the custom "FileNameSigner",
  i.e. with a directory specified via envvar.

  TODO: - consider only using "file2" and dropping the custom
          "FileNameSigner" (or only using it to ovverride the scheme
	  name and the envvar name)

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>

* chore: dependencies and ci/cd

Signed-off-by: Kairo Araujo <kairo.araujo@testifysec.com>

* fixup! Update securesystemslib 1.0.0 (WIP)

Signed-off-by: Kairo Araujo <kairo.araujo@testifysec.com>

* docs: update related docs about IKeyVault removal

Signed-off-by: Kairo Araujo <kairo.araujo@testifysec.com>

* fixup! fixup! Update securesystemslib 1.0.0 (WIP)

* fix: update the dependencies, including securesystemslib

Signed-off-by: Kairo Araujo <kairo.araujo@testifysec.com>

---------

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
Signed-off-by: Kairo Araujo <kairo.araujo@testifysec.com>
Co-authored-by: Kairo Araujo <kairo.araujo@testifysec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants