Skip to content

Conversation

@jiparis
Copy link
Member

@jiparis jiparis commented Nov 18, 2024

Group reference was missing in attestation API responses. This PR fixes that.
Related to #1405

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested review from javirln and migmartri November 18, 2024 15:43
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
}

if ev.PolicyReference != nil {
name, _ := ev.PolicyReference.GetAnnotations().AsMap()["organization"].(string)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work with old attestations right? Could we add a check to only add the organization name if the fields exists?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the key doesn't exist, or there are no annotations, orgName will be assigned an empty string "". I've tested it with references without groups and works as expected.

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis merged commit bafb919 into chainloop-dev:main Nov 19, 2024
13 checks passed
@jiparis jiparis deleted the 1405-fix branch November 19, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants