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

Add Release Attestation #319

Merged
merged 13 commits into from
Feb 5, 2024
51 changes: 49 additions & 2 deletions spec/predicates/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,55 @@ attestation SHOULD have a subject per artifact:
## Changelog and Migrations

As this is the initial version, no changes or migrations to previous versions.
This proposal is a subset of the information in the existing npm
[publish attestation], so npm could easily migrate to this specification.
The required predicates in this specification are a subset of the information
steiza marked this conversation as resolved.
Show resolved Hide resolved
in the existing npm [publish attestation], so npm could easily migrate to this
specification.

For example, here is an existing npm publish attestation:

```json
{
"_type": "https://in-toto.io/Statement/v0.1",
steiza marked this conversation as resolved.
Show resolved Hide resolved
"subject": [
{
"name": "pkg:npm/semver@7.5.4",
"digest": {
"sha512": "d5b09211..."
}
}
],
"predicateType":
"https://github.com/npm/attestation/tree/main/specs/publish/v0.1",
"predicate": {
"name": "semver",
"version": "7.5.4",
"registry": "https://registry.npmjs.org"
}
}
```

And this is what it would look like as a release attestation:

```jsonc
{
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
// The subject.name value is from the publish attestation subject.name:
// take the purl name and version to construct "<name>-<version>.tgz"
"name": "semver-7.5.4.tgz",
"digest": {
"sha512": "d5b09211..."
}
}
],
"predicateType": "https://in-toto.io/attestation/release/v0.1",
"predicate": {
// The predicate.purl value is from the publish attestation subject.name
"purl": "pkg:npm/semver@7.5.4"
}
}
```

[build provenance feature]:
https://github.blog/2023-04-19-introducing-npm-package-provenance/
Expand Down