Refactors role-specific properties into entities#776
Refactors role-specific properties into entities#776stevespringett wants to merge 4 commits into2.0-devfrom
Conversation
Signed-off-by: Steve Springett <steve@springett.us>
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new entity schema to CycloneDX 2.0 that refactors role-specific properties into a unified entity structure. The change implements issue #718 by adding new entity types (entity, entityChoice, and entities) along with a comprehensive role taxonomy to the common schema model.
Changes:
- Adds
entityobject definition with person/organization roles and priority handling - Introduces predefined and custom role taxonomies covering 27 predefined roles
- Creates
entityChoiceandentitiescollection types for flexible entity referencing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| ] | ||
| }, | ||
| "role": { |
There was a problem hiding this comment.
"role" for id, and "Role" for title - a much too broad term.
please use a more narrow term.
i mean, if we ever have roles for services or something, you would call them "ServiceRoles", right?
Better not use these broad and general terms for things that are pretty narrow in their scope, this prevents extensions in the future and might lead to confusion.
There was a problem hiding this comment.
then the name should also change to "organizationOrPersonRole"
|
Thank you for putting this together — the unified entity/role model feels like a solid direction for reducing duplicated patterns across the schema over time. I’m not a formal reviewer here, but I wanted to share a few small, hopefully low-impact suggestions that may improve clarity and long-term maintainability (and please ignore any of these if they were already intentional for CycloneDX 2.0): Definition naming: I see the point raised about Ordering semantics: Minor hardening: it might be worth adding Reference target clarity: since Person vs org readability: the Again, these are just small polish items — the overall structure looks promising, and I appreciate the RFC-style approach here. |
|
cc: @bhess |
… feedback Signed-off-by: Steve Springett <steve@springett.us>
Signed-off-by: Steve Springett <steve@springett.us>
|
Hi @stevespringett — quick follow-ups (low-impact), in case you think they’re worth folding in:
|
…operty. Signed-off-by: Steve Springett <steve@springett.us>
Good point. We've created our own linter for CycloneDX 2.0, which I believe handles this case. We still need to hook it up into a build process, but the framework should be there.
I don't think we have a linter check for this today and I know we've had an issue or two where this has come up, allowing someone to simply use
Thanks for catching this. This has been corrected. |
| "organizationalEntityOrContact": { | ||
|
|
||
| }, | ||
| "entity": { |
There was a problem hiding this comment.
i still dont like the wording "entity".
an entity of what? better name: "organizationOrPerson"
There was a problem hiding this comment.
The term entity is used here as a domain-level abstraction representing an identifiable actor within CycloneDX.
Although the current oneOf constrains implementations to organization/person, this reflects the present schema scope rather than the conceptual boundary of the model.
Encoding concrete types directly into the primitive name (e.g. organizationOrPerson) tightly couples the abstraction to today’s variants and reduces extensibility for future actor classes (such as services, signing authorities, or automated agents).
Keeping entity generic aligns with standard domain modeling practice: define a stable abstract actor, then specialize via schema composition. This avoids introducing parallel actor constructs as the specification evolves.
There was a problem hiding this comment.
role models the contextual function an entity assumes (e.g. supplier, manufacturer, operator), not an intrinsic attribute of organization/person.
The structural relationship is:
entity → roles[]
This follows established actor/role modeling patterns (RBAC / domain-driven design), where actors remain generic and roles express situational responsibility.
Renaming to organizationOrPersonRole couples role semantics to specific actor variants and limits reuse if additional entity types are introduced later.
Keeping role generic preserves a clean separation between actor identity and functional responsibility, and prevents fragmentation of role taxonomies across future entity categories.
| } | ||
| ] | ||
| }, | ||
| "role": { |
There was a problem hiding this comment.
then the name should also change to "organizationOrPersonRole"
Implements and closes #718