Skip to content

Commit 80e7efe

Browse files
authored
Merge pull request #380 from marcelamelara/update-scai-type-uri
Simplify SCAI predicate TypeURI
2 parents d93139a + f7aac53 commit 80e7efe

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

go/predicates/scai/v0/scai.go

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ package v0
66

77
import "fmt"
88

9+
const PredicateTypeUri = "https://in-toto.io/attestation/scai/"
10+
const PredicateVersion = "v0.3"
11+
912
func (a *AttributeAssertion) Validate() error {
1013
// at least the attribute field is required
1114
if a.GetAttribute() == "" {

python/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(VENV_STAMP): pyproject.toml
3737
.PHONY: lint
3838
lint: $(VENV_STAMP)
3939
. $(VENV_BIN)/activate && \
40-
ruff format --check $(ALL_PY_SRCS) && \
40+
ruff format --diff $(ALL_PY_SRCS) && \
4141
ruff check $(ALL_PY_SRCS) && \
4242
mypy $(PY_MODULE)
4343

python/in_toto_attestation/predicates/scai/v0/scai.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import in_toto_attestation.predicates.scai.v0.scai_pb2 as scaipb
44
from in_toto_attestation.v1.resource_descriptor import ResourceDescriptor
55

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

99

1010
class AttributeAssertion:

python/pyproject.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ path = "in_toto_attestation/__init__.py"
4545
[tool.hatch.build.targets.sdist]
4646
include = ["/in_toto_attestation"]
4747

48-
[tool.ruff]
49-
select = ["E", "F", "I", "UP", "W"]
50-
5148
[tool.ruff.lint]
49+
select = ["E", "F", "I", "UP", "W"]
5250
ignore = [
5351
# protobuf generates non-top-level imports.
5452
"E402",

spec/predicates/scai.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Predicate type: Software Supply Chain Attribute Integrity (SCAI)
22

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

5-
Version: 0.2
5+
Version: 0.3
66

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

@@ -99,7 +99,7 @@ together in a SCAI Attribute Report predicate.
9999

100100
```jsonc
101101
{
102-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
102+
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
103103
"predicate": {
104104
"attributes": [{
105105
"attribute": "<ATTRIBUTE>",
@@ -136,7 +136,7 @@ The following parsing rules apply in addition:
136136
`predicateType` _string ([TypeURI]), required_
137137

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

200-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
200+
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
201201
"predicate": {
202202
"attributes": [{
203203
"attribute": "WITH_STACK_PROTECTION",
@@ -226,7 +226,7 @@ The following parsing rules apply in addition:
226226
"digest": { "sha256": "78ab6a8..." }
227227
}],
228228

229-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
229+
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
230230
"predicate": {
231231
"attributes": [{
232232
"attribute": "WITH_STACK_PROTECTION",
@@ -256,7 +256,7 @@ The following parsing rules apply in addition:
256256
"digest": { "sha256": "78ab6a8..." }
257257
}],
258258

259-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
259+
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
260260
"predicate": {
261261
"attributes": [{
262262
"attribute": "WITH_STACK_PROTECTION",
@@ -290,7 +290,7 @@ The following parsing rules apply in addition:
290290
"digest": { "sha256": "78ab6a8..." }
291291
}],
292292

293-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2",
293+
"predicateType": "https://in-toto.io/attestation/scai/v0.3",
294294
"predicate": {
295295
"attributes": [{
296296
"attribute": "ATTESTED_DEPENDENCIES",
@@ -323,7 +323,7 @@ The following parsing rules apply in addition:
323323
"digest": { "sha256": "78ab6a8..." }
324324
}],
325325

326-
"predicateType": "https://in-toto.io/attestation/scai/attribute-report/v0.2"
326+
"predicateType": "https://in-toto.io/attestation/scai/v0.3"
327327
"predicate": {
328328
"attributes": [{
329329
"attribute": "VALID_ENCLAVE",
@@ -354,7 +354,7 @@ The following parsing rules apply in addition:
354354
"digest": { "sha256": "88888888..." }
355355
}],
356356

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

388388
## Changelog and Migrations
389389

390+
### New in v0.3
391+
392+
- Simplify the predicate `TypeURI` suffix from `/scai/attribute-report` to `/scai` per the latest [predicate naming convention].
393+
390394
### New in v0.2
391395

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

0 commit comments

Comments
 (0)