Skip to content

Commit 6425bd8

Browse files
authored
feat: license expression details and properties - text attachment, licensing, etc (#599)
As discussed via #549, this PR adds new structures to allow documenting the licensing and "properties" of SPDX expressions As discussed via #554, this PR adds new structures to allow documenting the license texts for SPDX expressions' individual parts. ---- TODO - [x] agree on data models & finalize examples - [x] write the schemata - [x] write the spec - [x] write a proper summary for this PR ---- - fixes #554 - fixes #549
2 parents ee39f18 + 5b12e67 commit 6425bd8

18 files changed

+1084
-325
lines changed

schema/bom-1.7.proto

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,14 @@ message LicenseChoice {
400400
oneof choice {
401401
// A license
402402
License license = 1;
403-
// A valid SPDX license expression. Refer to https://spdx.org/specifications for syntax requirements
403+
// A valid SPDX license expression. Refer to https://spdx.org/specifications for syntax requirements.
404404
string expression = 2;
405+
// A SPDX license expression and its details
406+
LicenseExpressionDetailed expression_detailed = 5;
405407
}
406-
// This field must only be used when "expression" is chosen as the License object has its own acknowledgement.
408+
// This field must only be used when `expression` is chosen as the other options have their own acknowledgement.
407409
optional LicenseAcknowledgementEnumeration acknowledgement = 3;
408-
// This field must only be used when "expression" is chosen as the License object has its own bom_ref.
410+
// This field must only be used when `expression` is chosen as the other options have their own bom_ref.
409411
optional string bom_ref = 4;
410412
}
411413

@@ -431,6 +433,46 @@ message License {
431433
optional LicenseAcknowledgementEnumeration acknowledgement = 8;
432434
}
433435

436+
// Specifies the details and attributes related to a software license.
437+
// It must be a valid SPDX license expression, along with additional properties such as license acknowledgment.
438+
message LicenseExpressionDetailed {
439+
440+
// This document specifies the details and attributes related to a software license identifier. An SPDX expression may be a compound of license identifiers.
441+
// The `license_identifier` field serves as the key that identifies each record. Note that this key is not required to be unique, as the same license identifier could apply to multiple, different but similar license details, texts, etc.
442+
message ExpressionDetails {
443+
// A valid SPDX license identifier. Refer to https://spdx.org/specifications for syntax requirements.
444+
// This field serves as the primary key, which uniquely identifies each record.
445+
// Example values:
446+
// - "Apache-2.0",
447+
// - "GPL-3.0-only WITH Classpath-exception-2.0"
448+
// - "LicenseRef-my-custom-license"
449+
string license_identifier = 1;
450+
// An optional identifier which can be used to reference the license elsewhere in the BOM. Uniqueness is enforced within all elements and children of the root-level bom element.
451+
optional string bom_ref = 2;
452+
// An optional way to include the textual content of the license.
453+
optional AttachedText text = 3;
454+
// The URL to the license file. If specified, a 'license' externalReference should also be specified for completeness
455+
optional string url = 4;
456+
}
457+
458+
// A valid SPDX license expression. Refer to https://spdx.org/specifications for syntax requirements.
459+
// Example values:
460+
// - "Apache-2.0 AND (MIT OR GPL-2.0-only)",
461+
// - "GPL-3.0-only WITH Classpath-exception-2.0"
462+
string expression = 1;
463+
// Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata
464+
// Details for parts of the `expression`.
465+
repeated ExpressionDetails details = 2;
466+
// An optional identifier which can be used to reference the license elsewhere in the BOM. Uniqueness is enforced within all elements and children of the root-level bom element.
467+
optional string bom_ref = 3;
468+
// Declared licenses and concluded licenses represent two different stages in the licensing process within software development. Declared licenses refer to the initial intention of the software authors regarding the licensing terms under which their code is released. On the other hand, concluded licenses are the result of a comprehensive analysis of the project's codebase to identify and confirm the actual licenses of the components used, which may differ from the initially declared licenses. While declared licenses provide an upfront indication of the licensing intentions, concluded licenses offer a more thorough understanding of the actual licensing within a project, facilitating proper compliance and risk management. Observed licenses are defined in `@.evidence.licenses`. Observed licenses form the evidence necessary to substantiate a concluded license.
469+
optional LicenseAcknowledgementEnumeration acknowledgement = 4;
470+
// Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata
471+
optional Licensing licensing = 5;
472+
// Specifies optional, custom, properties
473+
repeated Property properties = 6;
474+
}
475+
434476
// Declared licenses and concluded licenses represent two different stages in the licensing process within software development. Declared licenses refer to the initial intention of the software authors regarding the licensing terms under which their code is released. On the other hand, concluded licenses are the result of a comprehensive analysis of the project's codebase to identify and confirm the actual licenses of the components used, which may differ from the initially declared licenses. While declared licenses provide an upfront indication of the licensing intentions, concluded licenses offer a more thorough understanding of the actual licensing within a project, facilitating proper compliance and risk management. Observed licenses are defined in `@.evidence.licenses`. Observed licenses form the evidence necessary to substantiate a concluded license.
435477
enum LicenseAcknowledgementEnumeration {
436478
// The license acknowledgement is not specified.

0 commit comments

Comments
 (0)