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

Return meaningful EAT in chares #37

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Return meaningful EAT in chares #37

wants to merge 2 commits into from

Conversation

cowbon
Copy link
Collaborator

@cowbon cowbon commented Mar 5, 2025

Endpoint chares now gathers the output of GetEvidence() from each sub-attesters, combines them into a CMW collection, and wrap it as an EAT in its response. If there are multiple supported format available from a sub-attester, ratsd core picks the first available format from GetSupportedFormats()

@cowbon cowbon force-pushed the mocktsm branch 3 times, most recently from 04f8b0c to 3ddb4a5 Compare March 10, 2025 16:04
@cowbon
Copy link
Collaborator Author

cowbon commented Mar 10, 2025

Thanks @thomas-fossati for your review, I've switched to RawURLEncoding and adopted the latest CMW library.

Endpoint chares now gathers the output of GetEvidence() from each
sub-attesters, combines them into a CMW collection, and wrap it as an
EAT in its response. If there are multiple supported format available
from a sub-attesters, ratsd core picks the first available format from
GetSupportedFormats()

Signed-off-by: Ian Chin Wang <[email protected]>
Signed-off-by: Ian Chin Wang <[email protected]>
Copy link
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

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

A few comments as per f2f discussion with @cowbon


// Use a map until we finalize ratsd output format
eat := make(map[string]interface{})
collection := cmw.NewCollection("tag:ietf.org,2025:ratsd")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
collection := cmw.NewCollection("tag:ietf.org,2025:ratsd")
collection := cmw.NewCollection("tag:github.com,2025:veraison/ratsd/cmw")

return
}

for _, pn := range s.manager.GetPluginList() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for _, pn := range s.manager.GetPluginList() {
for _, pn := range pl {


formatOut := attester.GetSupportedFormats()
if !formatOut.Status.Result || len(formatOut.Formats) == 0 {
errMsg := fmt.Sprintf("no supported formats from attester %s: %s ",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should fail hard rather than soft here: we should either return the complete view of the sub-attesters or an error.

s.reportProblem(w, p)
return
}
eat["cmw"] = serialized
w.Header().Set("Content-Type", respCt)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are not yet signing the EAT, the correct media type is an UCS. See https://www.ietf.org/archive/id/draft-ietf-rats-eat-media-type-12.html#section-6.8 for the details.

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.

2 participants