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

Update doc.go to align with the current implementation of Attestation… #45

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

Conversation

Priyanshuthapliyal2005
Copy link

@Priyanshuthapliyal2005 Priyanshuthapliyal2005 commented Jan 3, 2025

This pull request updates the doc.go file to ensure it aligns with the current implementation of the AttestationResult structure and its related components. The changes include:

1.Timestamp Field:

Original: myTimestamp := time.Now().Format(time.RFC3339)
Updated: myTimestamp := time.Now().Unix()
Reference: AttestationResult struct in ear.go uses Unix timestamp (IssuedAt field).

2.Included VerifierID and Submods in AttestationResult:

Original:

ar := AttestationResult{
	Status:            &myStatus,
	Timestamp:         &testTimestamp,
	AppraisalPolicyID: &testPolicyID,
	Profile:           &testProfile,
}

Updated:

    ar := AttestationResult{
        Profile:  &myProfile,
        IssuedAt: &myTimestamp,
        Submods: map[string]*Appraisal{
            "submodName": {
                TrustVector: &TrustVector{},
                Status:      &myStatus,
            },
        },
        VerifierID: &VerifierIdentity{
            Build:     &verifierBuild,
            Developer: &verifierDeveloper,
        },
    }

Reference: AttestationResult struct in ear.go includes VerifierID and Submods.

3.Updating TrustVector in Submods:

Original: ar.TrustVector := &tv
Updated: ar.Submods["submodName"].TrustVector = &tv
Reference: AttestationResult struct in ear.go uses Submods to store TrustVector.

4.Handling Appraisal Status:

Original: if *ar.Status != TrustTierAffirming
Updated: if *ar.Submods["submodName"].Status != TrustTierAffirming
Reference: AttestationResult struct in ear.go uses Submods to store Status.

5.Pretty Printing TrustVector:

Original: fmt.Print(ar.TrustVector.Report(short, color))
Updated: fmt.Print(ar.Submods["submodName"].TrustVector.Report(short, color))
Reference: AttestationResult struct in ear.go uses Submods to store TrustVector.

fixes #36

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.

hi @Priyanshuthapliyal2005, thanks for the contribution!

It looks good apart from a couple of small nits that I have commented about inline.

doc.go Show resolved Hide resolved
doc.go Show resolved Hide resolved
…and include myPolicyID in AttestationResult as it is part of ear_appraisal.go struct

Signed-off-by: Priyanshu Thapliyal <[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.

Thanks for addressing my comments!

@Priyanshuthapliyal2005
Copy link
Author

Thanks for addressing my comments!

Thank you very much for your kind words, sir.

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.

Embedded documentation out of sync
2 participants