Skip to content

Conversation

@woodruffw
Copy link
Member

I come bearing gifts 🙂

This is a work in progress; it shouldn't be merged until sigstore/sigstore-python#1470 lands in a release.

Key changes:

  • sigstore-protobuf-specs is entirely gone.
  • I've refactored the tests to use the public OIDC beacon, and made some corresponding tweaks to the CI to use the beacon by default. This allows tests to run with 100% coverage, even on third-party PRs (like this one).

Closes #131.

@woodruffw
Copy link
Member Author

Huh, no idea why this is failing in CI but not locally for me:

    @classmethod
    def from_json(cls, json: str | bytes) -> te.Self:
>       return cls.model_validate_json(json)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E       pydantic_core._pydantic_core.ValidationError: 1 validation error for TrustedRoot
E       timestampAuthorities
E         Field required [type=missing, input_value={'mediaType': 'applicatio...rjePK3/h4pygC8p7o4='}}]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.11/v/missing

env/lib/python3.13/site-packages/sigstore_models/_core.py:22: ValidationError
------------------------------ Captured log call -------------------------------
DEBUG    pypi_attestations._cli:_cli.py:620 Namespace(verbose=0, subcommand='verify', verification_type='attestation', identity='https://github.com/trailofbits/pypi-attestations/.github/workflows/release.yml@refs/tags/v0.0.19', staging=False, offline=True, files=[PosixPath('/home/runner/work/pypi-attestations/pypi-attestations/test/assets/pypi_attestations-0.0.19.tar.gz')])
DEBUG    sigstore._internal.tuf:tuf.py:95 TUF metadata: /home/runner/.local/share/sigstore-python/tuf/https%3A%2F%2Ftuf-repo-cdn.sigstore.dev
DEBUG    sigstore._internal.tuf:tuf.py:96 TUF targets cache: /home/runner/.cache/sigstore-python/tuf/https%3A%2F%2Ftuf-repo-cdn.sigstore.dev
WARNING  sigstore._internal.tuf:tuf.py:100 TUF repository is loaded in offline mode; updates will not be performed
DEBUG    sigstore._internal.tuf:tuf.py:130 Using unverified trusted root from cache
=============================== warnings summary ===============================

Either way this is an overly strict check in sigstore-models, so I'll fix it.

@facutuesca
Copy link
Collaborator

@woodruffw now that sigstore-python==4.0.0 was released, nothing is blocking this, right?

Comment on lines +12 to +13
resp = requests.get(
"https://raw.githubusercontent.com/sigstore-conformance/extremely-dangerous-public-oidc-beacon/refs/heads/current-token/oidc-token.txt"
Copy link
Contributor

@jku jku Oct 9, 2025

Choose a reason for hiding this comment

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

unfortunately GitHub cached raw.githubusercontent.com quite aggressively when I last tried this -- it usually works but the error rate was still annoyingly high. This is why conformance uses the clumsy looking "git clone" approach https://github.com/sigstore/sigstore-conformance/blob/e0997c248c40ee615c1e8aa1e3ee043a62920951/test/conftest.py#L131

Copy link
Contributor

Choose a reason for hiding this comment

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

an alternative (for CI only) would be to use the GH action from extremely-dangerous-public-oidc-beacon -- this is only feasible if the test suite is fast enough that it can be run with one token

Comment on lines 350 to 354
return Bundle._from_parts( # noqa: SLF001
cert=certificate,
content=evp,
log_entry=log_entry,
)
Copy link
Contributor

@jku jku Oct 9, 2025

Choose a reason for hiding this comment

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

Bundle has to include a timestamp if the entry kindversion is 0.0.2 (IOW it comes from rekor2). I think including the TSA timestamp would be a good idea in general

Copy link
Contributor

@jku jku Oct 9, 2025

Choose a reason for hiding this comment

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

The more general way to say this is that the PyPI attestations should be modified so that they can include timestamps... but that should happen in another PR

@jku
Copy link
Contributor

jku commented Oct 9, 2025

I believe the TestAttestation::test_roundtrip test is now failing (after updating some minor things) since it runs using sigstore staging and sigstore staging already defaults to rekor v2.

EDIT: confirmed: the test passes with trust_config.force_tlog_version = 1 which does the same things --rekor-version=1 does on sigstore CLI

@jku
Copy link
Contributor

jku commented Oct 9, 2025

There is two commits for this branch in https://github.com/jku/pypi-attestations/commits/ww/drop-protobufs/

  • Upgrade for sigstore-python 4.0
  • forces use of rekor v2 when signing: this way we can keep the rekorv2 (and TSA) support as a separate issue
  • Update README

@woodruffw
Copy link
Member Author

@jku I'm probably not going to get back to this for the next week or so, so feel free to open your branch as a PR!

@facutuesca
Copy link
Collaborator

Closing in favor of #144

@facutuesca facutuesca closed this Oct 14, 2025
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.

Drop sigstore_protobuf_specs

3 participants