You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add Concise Evidence DependencyTriples and MembershipTriples support
This commit addresses GitHub issue #83 by implementing missing triple types
from the TCG Concise Evidence CDDL specification.
Changes:
- Add DependencyTriple and MembershipTriple structures
- Enhance EvTriples with new triple types (CBOR indexes 2 and 3)
- Implement comprehensive validation and helper methods
- Add fluent API support for method chaining
- Full CBOR/JSON serialization support
- Comprehensive test coverage with examples
- Maintain full backward compatibility
The implementation now supports all required triple types from the
TCG Concise Evidence specification:
- EvidenceTriples (index 0) ✓
- IdentityTriples (index 1) ✓
- DependencyTriples (index 2) ✓ NEW
- MembershipTriples (index 3) ✓ NEW
- CoSWIDTriples (index 4) ✓
- AttestKeysTriples (index 5) ✓
Fixes#83
Signed-off-by: Kallal Mukherjee <[email protected]>
This implementation addresses GitHub issue #83 by enhancing the Concise Evidence support in the `coev` package to align with the TCG Concise Evidence CDDL specification.
6
+
7
+
## Changes Made
8
+
9
+
### 1. Added Missing Triple Types
10
+
11
+
The original `EvTriples` struct was missing two critical triple types defined in the TCG Concise Evidence specification:
12
+
13
+
-**DependencyTriples** (CBOR index 2): Represents dependencies between domains
14
+
-**MembershipTriples** (CBOR index 3): Represents membership relationships between domains and environments
15
+
16
+
### 2. New Files Added
17
+
18
+
#### `coev/dependency_triple.go`
19
+
-`DependencyTriple` struct: Represents `ev-dependency-triple-record` from the CDDL spec
20
+
-`DependencyTriples` collection type
21
+
- Validation methods and helper functions
22
+
- Setter methods with fluent API support
23
+
24
+
#### `coev/membership_triple.go`
25
+
-`MembershipTriple` struct: Represents `ev-membership-triple-record` from the CDDL spec
26
+
-`MembershipTriples` collection type
27
+
- Validation methods and helper functions
28
+
- Setter methods with fluent API support
29
+
30
+
#### `coev/dependency_triple_test.go`
31
+
- Comprehensive test coverage for `DependencyTriple` and `DependencyTriples`
32
+
- Tests for validation, setters, nil receiver handling, and collection operations
33
+
34
+
#### `coev/membership_triple_test.go`
35
+
- Comprehensive test coverage for `MembershipTriple` and `MembershipTriples`
36
+
- Tests for validation, setters, nil receiver handling, and collection operations
37
+
38
+
#### `coev/ev_triples_test.go`
39
+
- New tests for the enhanced `EvTriples` functionality
40
+
- Tests for the new `AddDependencyTriple` and `AddMembershipTriple` methods
41
+
- CBOR/JSON marshaling tests with empty collection handling
- CBOR/JSON serialization omits new fields when empty
128
+
- All existing tests continue to pass
129
+
130
+
## Test Results
131
+
132
+
- ✅ All existing tests pass
133
+
- ✅ New comprehensive test suite passes
134
+
- ✅ Integration tests with full codebase pass
135
+
- ✅ Example tests demonstrate real-world usage
136
+
137
+
This implementation successfully addresses the GitHub issue by providing complete support for the TCG Concise Evidence specification while maintaining full backward compatibility and following established codebase patterns.
0 commit comments