Skip to content

Upgrade to attestation 0.0.8Β #725

Closed

Description

@asgrim

Pending PR ThePHPF/attestation#37 merge and release of 0.0.8, update PIE to use this; note there are BC breaks to handle

Activity

  1. added this to the 1.5.0 milestone on Sep 4, 2026
  2. self-assigned this
    on Sep 4, 2026
  3. added theissue type on Sep 4, 2026
  4. added
    enhancementNew feature or request
    dependenciesPull requests that update a dependency file
    phpPull requests that update Php code
    on Sep 4, 2026
  5. asgrim commented on Sep 4, 2026

    @asgrim
    ContributorAuthor

    Fetching/verifying are separate now:

    // before
    $this->verifyAttestation->verify(
        FilenameWithChecksum::fromFilenameAndChecksum($pharFilename->filePath, $pharFilename->checksum),
        self::ORGANISATION,
        self::ARTIFACT_FILENAME,
        $expectedExtensions,
    );
    
    // after
    $file = FilenameWithChecksum::fromFilenameAndChecksum($pharFilename->filePath, $pharFilename->checksum);
    $bundles = DownloadGitHubBundle::factory(self::ORGANISATION)->getBundles($file);
    $this->verifyBundle->verify($bundles, $file);

    Verification rules/setup is moved to construction now instead of ->verify() params

    // before
    private const ATTESTATION_CERTIFICATE_EXPECTED_EXTENSION_VALUES = [
        FulcioSigstoreOidExtensions::ISSUER_V2 => 'https://token.actions.githubusercontent.com',
        FulcioSigstoreOidExtensions::SOURCE_REPOSITORY_URI => 'https://github.com/php/pie',
        FulcioSigstoreOidExtensions::SOURCE_REPOSITORY_OWNER_URI => 'https://github.com/php',
    ];
    // ...
    $expectedExtensions[self::BUILD_SIGNER_URI] = '...@refs/heads/...'; // or SOURCE_REPOSITORY_REF for tags
    
    // after
    private const ATTESTATION_CERTIFICATE_EXPECTED_EXTENSION_VALUES = [
        FulcioSigstoreOidExtensions::SOURCE_REPOSITORY_URI => 'https://github.com/php/pie',
        FulcioSigstoreOidExtensions::SOURCE_REPOSITORY_OWNER_URI => 'https://github.com/php',
    ];
    private const OIDC_ISSUER = 'https://token.actions.githubusercontent.com'; // used to be `ISSUER_V2` extension, now is first class citizen
    // ...
    $expectedCertificateIdentity = '.../build-assets.yml@refs/heads/...'; // or @refs/tags/<tag>
    
    VerifyBundleWithOpenSsl::factory(
        self::ATTESTATION_CERTIFICATE_EXPECTED_EXTENSION_VALUES,
        $expectedCertificateIdentity,
        self::OIDC_ISSUER,
    );

    Note: the verifier now therefore varies per release (as identity is ingrained) so construction should be inline not injected (although, a factory could be injected, and release-specific params can be passed to that factory fn?)

    Check if exceptions have moved/updated

    Some exceptions might've moved, check them. There is also new exceptions (e.g. NoSodium, NoGmpOrBcmath etc) to potentially handle (if we don't globally handle them, can't remember off my head)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dependenciesPull requests that update a dependency fileenhancementNew feature or requestphpPull requests that update Php code

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions