Skip to content

comid: add dependency-triples (triples-map key 4)#258

Merged
yogeshbdeshpande merged 1 commit intoveraison:mainfrom
rsampaio:feature/add-dependency-triples
Mar 26, 2026
Merged

comid: add dependency-triples (triples-map key 4)#258
yogeshbdeshpande merged 1 commit intoveraison:mainfrom
rsampaio:feature/add-dependency-triples

Conversation

@rsampaio
Copy link
Copy Markdown
Contributor

Implements domain-dependency-triple-record as defined in draft-ietf-rats-corim 5.1.11.2.

A Domain Dependency Triple (DDT) expresses a trust relationship between domains: the trustworthiness of a domain-id depends on one or more trustee domains having been appraised first. Both fields are typed as environment-map per the spec.

Adds DomainDependencyTriple and DomainDependencyTriples types with Valid() and IsEmpty(), and wires DomainDependencies (CBOR key 4, JSON dependency-triples) into the Triples struct alongside the existing triple categories.

Includes unit tests covering the happy path and all validation error cases.

@rsampaio rsampaio changed the title Feature/add dependency triples comid: add dependency-triples (triples-map key 4) Mar 24, 2026
@rsampaio rsampaio force-pushed the feature/add-dependency-triples branch from 05f4321 to 73cdb31 Compare March 24, 2026 15:17
@thomas-fossati
Copy link
Copy Markdown
Contributor

Hi @rsampaio thanks very much for your contribution. LGTM apart from a small formatting issue in comid/triples.go:

➜  comid git:(feature/add-dependency-triples) gofmt -d triples.go
diff triples.go.orig triples.go
--- triples.go.orig
+++ triples.go
@@ -12,12 +12,12 @@
 )

 type Triples struct {
-	ReferenceValues   *ValueTriples             `cbor:"0,keyasint,omitempty" json:"reference-values,omitempty"`
-	EndorsedValues    *ValueTriples             `cbor:"1,keyasint,omitempty" json:"endorsed-values,omitempty"`
-	DevIdentityKeys   *KeyTriples               `cbor:"2,keyasint,omitempty" json:"dev-identity-keys,omitempty"`
-	AttestVerifKeys   *KeyTriples               `cbor:"3,keyasint,omitempty" json:"attester-verification-keys,omitempty"`
-	DomainDependencies *DomainDependencyTriples `cbor:"4,keyasint,omitempty" json:"dependency-triples,omitempty"`
-	CondEndorseSeries *CondEndorseSeriesTriples `cbor:"8,keyasint,omitempty" json:"conditional-endorsement-series,omitempty"`
+	ReferenceValues    *ValueTriples             `cbor:"0,keyasint,omitempty" json:"reference-values,omitempty"`
+	EndorsedValues     *ValueTriples             `cbor:"1,keyasint,omitempty" json:"endorsed-values,omitempty"`
+	DevIdentityKeys    *KeyTriples               `cbor:"2,keyasint,omitempty" json:"dev-identity-keys,omitempty"`
+	AttestVerifKeys    *KeyTriples               `cbor:"3,keyasint,omitempty" json:"attester-verification-keys,omitempty"`
+	DomainDependencies *DomainDependencyTriples  `cbor:"4,keyasint,omitempty" json:"dependency-triples,omitempty"`
+	CondEndorseSeries  *CondEndorseSeriesTriples `cbor:"8,keyasint,omitempty" json:"conditional-endorsement-series,omitempty"`
 	Extensions
 }

Please run:

gofmt -w comid/triples.go

and commit the changes.

@rsampaio
Copy link
Copy Markdown
Contributor Author

@thomas-fossati thank you for the review! I just pushed a commit with the fix

Copy link
Copy Markdown
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.

LGTM, thanks!

Copy link
Copy Markdown
Contributor

@yogeshbdeshpande yogeshbdeshpande left a comment

Choose a reason for hiding this comment

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

I have left some comment, but in general LGTM.

Once you add the API and insert tests,. I will approve it!

@thomas-fossati
Copy link
Copy Markdown
Contributor

Nice, thanks! Before merging, could you please squash the 5 commits into one with title "feat(comid): add domain dependency triples”?

@yogeshbdeshpande
Copy link
Copy Markdown
Contributor

yogeshbdeshpande commented Mar 26, 2026

@rsampaio : The changes LGTM One thing, I forgot to mention, please do so in a separate PR, where

We need to exercise, all triples as part of examples, so please see:

https://github.com/veraison/corim/blob/main/comid/example_test.go#L15

And add your triple in this test also.

Copy link
Copy Markdown
Contributor

@yogeshbdeshpande yogeshbdeshpande left a comment

Choose a reason for hiding this comment

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

Please see my latest comment, remember to do it!
As suggested by Thomas, Please squash commits
Also, Make sure you follow the commit template

You have my approval for this one!

Implement DomainDependencyTriple per draft-ietf-rats-corim §5.1.11.2,
including validation, serialisation hooks and AddDomainDependency().

Signed-off-by: Rodrigo Sampaio Vaz <rvaz@nvidia.com>
@rsampaio rsampaio force-pushed the feature/add-dependency-triples branch from 6737732 to 7edf95f Compare March 26, 2026 14:37
@rsampaio
Copy link
Copy Markdown
Contributor Author

@thomas-fossati @yogeshbdeshpande thanks for the feedback, I believe I addressed all the comments and I will open a separate PR for the example_test.go

@yogeshbdeshpande
Copy link
Copy Markdown
Contributor

Please squash all the commits to one commit

@yogeshbdeshpande yogeshbdeshpande merged commit 25855f5 into veraison:main Mar 26, 2026
5 checks passed
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