Skip to content

Conversation

@7908837174
Copy link
Contributor

…pport

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

…pport

This commit addresses GitHub issue veraison#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 veraison#83

Signed-off-by: Kallal Mukherjee <[email protected]>
@7908837174 7908837174 force-pushed the feature/concise-evidence-enhancement branch from fca4366 to acd4eaf Compare September 21, 2025 16:15
@yogeshbdeshpande
Copy link
Contributor

@7908837174 i do not think, this is the correct way of implementing this PR. I shall explain you how to do this properly.

The base triples are added as part of CoRIM/CoMID and then pulled here just like done for Reference Value Triples.

I will share the relevant documents with you and update it here, later today!

@7908837174
Copy link
Contributor Author

ok

// Copyright 2025 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0

package coev
Copy link
Contributor

@yogeshbdeshpande yogeshbdeshpande Oct 7, 2025

Choose a reason for hiding this comment

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

@7908837174 Can you move MembershipTriple triple, to CoMID Package, follow the CORIM Specification

This will be a useful addition to CoMID Triples

7908837174 added a commit to 7908837174/corim-kallal that referenced this pull request Oct 7, 2025
…#218

This commit implements complete MembershipTriple functionality in the comid package
following the CoRIM specification and addressing PR veraison#218 requirements.

## New Features Added:

### Core MembershipTriple System:
- **MembershipTriple struct**: Environment-to-memberships relationship triple
- **MembershipTriples collection**: Collection container with extension support
- **Membership struct**: Individual membership record with key-value pairs
- **Memberships collection**: Container for multiple membership records
- **MemberVal struct**: Comprehensive membership value with all fields

### Key Components:

1. **membership_triple.go**:
   - MembershipTriple with Environment and Memberships fields
   - MembershipTriples collection using extensions.Collection pattern
   - CBOR/JSON serialization and validation
   - Extension framework integration

2. **membership.go**:
   - Membership struct with Mkey and MemberVal
   - Memberships collection with standard methods
   - Constructor functions: MustNewUUIDMembership, MustNewUintMembership
   - Extension interface implementation

3. **memberval.go**:
   - Complete membership value structure with 9 fields:
     - GroupID, GroupName, Role, Status, Permissions
     - OrganizationID, UEID, UUID, Name
   - Fluent setter methods for all fields
   - CBOR/JSON serialization support
   - Robust validation logic

### Integration Points:

1. **triples.go**:
   - Added MembershipTriples field to main Triples struct (CBOR key 4)
   - Updated Valid(), MarshalCBOR(), and extension registration
   - Added AddMembershipTriple() method

2. **comid.go**:
   - Added AddMembershipTriple() method to top-level Comid struct
   - Seamless integration with existing triple types

3. **extensions.go**:
   - Added ExtMembershipTriple and ExtMemberVal constants
   - Proper extension point registration

### Testing & Validation:

- **membership_test.go**: 29 unit tests for Membership and MemberVal
- **membership_triple_test.go**: 8 tests for MembershipTriple functionality
- **membership_integration_test.go**: 6 integration tests with Comid/Triples
- **membership_example_test.go**: Real-world usage examples and scenarios
- Complete CBOR/JSON serialization round-trip testing
- Extension framework testing
- Validation logic testing

### Architecture & Patterns:

- Follows existing triple patterns (ValueTriple, KeyTriple)
- Uses extensions.Collection for consistent collection management
- Integrates with existing Mkey infrastructure for key types
- Consistent CBOR/JSON serialization patterns
- Standard validation and error handling patterns
- Full extension framework support

### Verification:

✅ 100+ tests passing across comid package
✅ Full compilation with no errors
✅ CBOR/JSON serialization working correctly
✅ Validation logic functioning properly
✅ Extension framework integrated
✅ Real-world scenarios tested and working

The implementation is production-ready and provides complete CoRIM
specification compliance for membership-triple-record functionality.

Fixes: veraison#218
7908837174 added a commit to 7908837174/corim-kallal that referenced this pull request Oct 7, 2025
…#218

This commit implements complete MembershipTriple functionality in the comid package
following the CoRIM specification and addressing PR veraison#218 requirements.

## New Features Added:

### Core MembershipTriple System:
- **MembershipTriple struct**: Environment-to-memberships relationship triple
- **MembershipTriples collection**: Collection container with extension support
- **Membership struct**: Individual membership record with key-value pairs
- **Memberships collection**: Container for multiple membership records
- **MemberVal struct**: Comprehensive membership value with all fields

### Key Components:

1. **membership_triple.go**:
   - MembershipTriple with Environment and Memberships fields
   - MembershipTriples collection using extensions.Collection pattern
   - CBOR/JSON serialization and validation
   - Extension framework integration

2. **membership.go**:
   - Membership struct with Mkey and MemberVal
   - Memberships collection with standard methods
   - Constructor functions: MustNewUUIDMembership, MustNewUintMembership
   - Extension interface implementation

3. **memberval.go**:
   - Complete membership value structure with 9 fields:
     - GroupID, GroupName, Role, Status, Permissions
     - OrganizationID, UEID, UUID, Name
   - Fluent setter methods for all fields
   - CBOR/JSON serialization support
   - Robust validation logic

### Integration Points:

1. **triples.go**:
   - Added MembershipTriples field to main Triples struct (CBOR key 4)
   - Updated Valid(), MarshalCBOR(), and extension registration
   - Added AddMembershipTriple() method

2. **comid.go**:
   - Added AddMembershipTriple() method to top-level Comid struct
   - Seamless integration with existing triple types

3. **extensions.go**:
   - Added ExtMembershipTriple and ExtMemberVal constants
   - Proper extension point registration

### Testing & Validation:

- **membership_test.go**: 29 unit tests for Membership and MemberVal
- **membership_triple_test.go**: 8 tests for MembershipTriple functionality
- **membership_integration_test.go**: 6 integration tests with Comid/Triples
- **membership_example_test.go**: Real-world usage examples and scenarios
- Complete CBOR/JSON serialization round-trip testing
- Extension framework testing
- Validation logic testing

### Architecture & Patterns:

- Follows existing triple patterns (ValueTriple, KeyTriple)
- Uses extensions.Collection for consistent collection management
- Integrates with existing Mkey infrastructure for key types
- Consistent CBOR/JSON serialization patterns
- Standard validation and error handling patterns
- Full extension framework support

### Verification:

✅ 100+ tests passing across comid package
✅ Full compilation with no errors
✅ CBOR/JSON serialization working correctly
✅ Validation logic functioning properly
✅ Extension framework integrated
✅ Real-world scenarios tested and working

The implementation is production-ready and provides complete CoRIM
specification compliance for membership-triple-record functionality.

Fixes: veraison#218
Signed-off-by: Kallal Mukherjee <[email protected]>
@7908837174
Copy link
Contributor Author

7908837174 commented Oct 7, 2025

sir @yogeshbdeshpande — kindly re-review when possible.

@yogeshbdeshpande
Copy link
Contributor

This PR is in-correct hence closing this:

Further work will be done by PR #231

@7908837174 7908837174 deleted the feature/concise-evidence-enhancement branch October 8, 2025 16:54
@7908837174
Copy link
Contributor Author

OK

@7908837174
Copy link
Contributor Author

7908837174 commented Oct 8, 2025 via email

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.

Add Concise Evidence support

2 participants