Skip to content

Commit

Permalink
Merge pull request #380 from marcelamelara/update-scai-type-uri
Browse files Browse the repository at this point in the history
Simplify SCAI predicate TypeURI
  • Loading branch information
pxp928 authored Sep 23, 2024
2 parents d93139a + f7aac53 commit 80e7efe
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
3 changes: 3 additions & 0 deletions go/predicates/scai/v0/scai.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ package v0

import "fmt"

const PredicateTypeUri = "https://in-toto.io/attestation/scai/"
const PredicateVersion = "v0.3"

func (a *AttributeAssertion) Validate() error {
// at least the attribute field is required
if a.GetAttribute() == "" {
Expand Down
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $(VENV_STAMP): pyproject.toml
.PHONY: lint
lint: $(VENV_STAMP)
. $(VENV_BIN)/activate && \
ruff format --check $(ALL_PY_SRCS) && \
ruff format --diff $(ALL_PY_SRCS) && \
ruff check $(ALL_PY_SRCS) && \
mypy $(PY_MODULE)

Expand Down
4 changes: 2 additions & 2 deletions python/in_toto_attestation/predicates/scai/v0/scai.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import in_toto_attestation.predicates.scai.v0.scai_pb2 as scaipb
from in_toto_attestation.v1.resource_descriptor import ResourceDescriptor

SCAI_PREDICATE_TYPE = "https://in-toto.io/attestation/scai/attribute-report/"
SCAI_PREDICATE_VERSION = "v0.2"
SCAI_PREDICATE_TYPE = "https://in-toto.io/attestation/scai/"
SCAI_PREDICATE_VERSION = "v0.3"


class AttributeAssertion:
Expand Down
4 changes: 1 addition & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ path = "in_toto_attestation/__init__.py"
[tool.hatch.build.targets.sdist]
include = ["/in_toto_attestation"]

[tool.ruff]
select = ["E", "F", "I", "UP", "W"]

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "W"]
ignore = [
# protobuf generates non-top-level imports.
"E402",
Expand Down
25 changes: 15 additions & 10 deletions spec/predicates/scai.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Predicate type: Software Supply Chain Attribute Integrity (SCAI)

Type URI: https://in-toto.io/attestation/scai/attribute-report
Type URI: https://in-toto.io/attestation/scai

Version: 0.2
Version: 0.3

Author: Marcela Melara ([@marcelamelara](https://github.com/marcelamelara))

Expand Down Expand Up @@ -99,7 +99,7 @@ together in a SCAI Attribute Report predicate.

```jsonc
{
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "<ATTRIBUTE>",
Expand Down Expand Up @@ -136,7 +136,7 @@ The following parsing rules apply in addition:
`predicateType` _string ([TypeURI]), required_

> Identifier for the schema of the Attribute Report. Always
> `https://in-toto.io/attestation/scai/attribute-report/v0.2` for this version of the
> `https://in-toto.io/attestation/scai/v0.3` for this version of the
> spec.
`predicate.attributes` _array of objects, required_
Expand Down Expand Up @@ -197,7 +197,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "78ab6a8..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "WITH_STACK_PROTECTION",
Expand Down Expand Up @@ -226,7 +226,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "78ab6a8..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "WITH_STACK_PROTECTION",
Expand Down Expand Up @@ -256,7 +256,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "78ab6a8..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "WITH_STACK_PROTECTION",
Expand Down Expand Up @@ -290,7 +290,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "78ab6a8..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "ATTESTED_DEPENDENCIES",
Expand Down Expand Up @@ -323,7 +323,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "78ab6a8..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2"
"predicateType": "https://in-toto.io/attestation/scai/v0.3"
"predicate": {
"attributes": [{
"attribute": "VALID_ENCLAVE",
Expand Down Expand Up @@ -354,7 +354,7 @@ The following parsing rules apply in addition:
"digest": { "sha256": "88888888..." }
}],

"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
"predicate": {
"attributes": [{
"attribute": "attestation-1",
Expand Down Expand Up @@ -387,6 +387,10 @@ The following parsing rules apply in addition:

## Changelog and Migrations

### New in v0.3

- Simplify the predicate `TypeURI` suffix from `/scai/attribute-report` to `/scai` per the latest [predicate naming convention].

### New in v0.2

- Change the `target` and `evidence` field type of a SCAI Attribute
Expand All @@ -399,3 +403,4 @@ The following parsing rules apply in addition:
[TypeURI]: ../v1/field_types.md#typeuri
[attestation Bundle]: ../v1/bundle.md
[parsing rules]: ../v1#parsing-rules
[predicate naming convention]: ../../docs/new_predicate_guidelines.md#vetting-process

0 comments on commit 80e7efe

Please sign in to comment.