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

Change annotations fields in ResourceDecriptor from objects to values #251

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion protos/in_toto_attestation/v1/resource_descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ message ResourceDescriptor {

string mediaType = 6;

map<string, google.protobuf.Struct> annotations = 7;
map<string, google.protobuf.Value> annotations = 7;
}
15 changes: 9 additions & 6 deletions spec/v1/resource_descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ or immutable).
"downloadLocation": "<RESOURCE URI>",
"mediaType": "<MIME TYPE>",
"annotations": {
"<FIELD_1>": { /* object */ },
"<FIELD_2>": { /* object */ },
"<FIELD_1>": /* value */,
"<FIELD_2>": /* value */,
...
}
}
Expand Down Expand Up @@ -85,15 +85,18 @@ specified here.
> prefixing types with `x.`, `prs.`, or `vnd.` to avoid collisions with other
> producers.

`annotations` _map <string, object>, optional_
`annotations` _map <string, value>, optional_

> This field MAY be used to provide additional information or metadata about
> the resource or artifact that may be useful to the consumer when evaluating
> the attestation against a policy.
>
> For maximum flexibility annotations may be any mapping from a field name to
> any JSON value (string, number, object, array, boolean or _null_).
>
> The producer and consumer SHOULD agree on the semantics, and acceptable
> fields and objects in the `annotations` map. Producers SHOULD follow the
> same formatting conventions used in [extension fields].
> fields and values in the `annotations` map. Producers SHOULD follow the
> same naming conventions for annotation fields as for [extension fields].

## Semantics

Expand Down Expand Up @@ -131,7 +134,7 @@ Pointer to a git repo (with annotations):
{
"uri": "git+https://github.com/actions/runner",
"digest": { "sha1": "d61b27b8395512..." },
"annotations": { "git-review": { "twoPartyReview": false } }
"annotations": { "twoPartyReview": false }
}
```

Expand Down