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

Add methods to directly add Reference Values and Endorsed Values #142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Priyanshuthapliyal2005
Copy link

Files Added/Modified:

comid/comid.go
comid/comid_test.go
comid/digests.go
comid/hashalg.go
comid/hashalg_test.go
comid/valuetriple.go

Issue Addressed:

This pull request addresses #136 which highlights the difficulty in introducing Extensions for Reference Value Measurements using the current Extensions Interface.

###** Solution:**
New methods have been introduced to the CoMID struct to facilitate the addition of Reference Values without requiring the creation of instances for Measurement and ValueTriples. These methods include:

AddSimpleReferenceValue
AddDigestReferenceValue
AddRawReferenceValue
AddReferenceValueDirect
AddEndorsedValueDirect
These enhancements streamline the process, making it easier to add Reference Values and ensuring better usability of the Extensions Interface.

Before:

Users had to manually create instances for Measurement and ValueTriples to add Reference Values, which was cumbersome and error-prone.

Example:

measurement := &Measurement{ /* initialize measurement */ }
valueTriple := ValueTriple{
Environment: env,
Measurements: *NewMeasurements().Add(measurement),
}
comid.Triples.ReferenceValues.Add(valueTriple)

### After:
With the new methods, users can directly add Reference Values without creating these instances, significantly simplifying the process and reducing the likelihood of errors.

Example:

err := comid.AddSimpleReferenceValue(env, measurement)
if err != nil {
log.Fatalf("failed to add reference value: %v", err)
}

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.

1 participant