Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR: TDF spec version enforcement #1677

Open
biscoe916 opened this issue Oct 23, 2024 · 3 comments
Open

ADR: TDF spec version enforcement #1677

biscoe916 opened this issue Oct 23, 2024 · 3 comments
Labels
adr Architecture Decision Records pertaining to OpenTDF

Comments

@biscoe916
Copy link
Member

Context

The Base ZTDF specification includes a yet to be implemented tdf_spec_version field. This version field is sufficient in the context of of the OpenTDF ecosystem, but we also want to support 3rd parties to "extend" the specification to accommodate their unique use-cases. For example, a 3rd party who is leveraging OpenTDF may want to require their applications require the inclusion of specific assertions, or attributes. This ADR proposes two potential approaches for how we might allow the inclusion of version information for vendor specific spec requirements.

Current State

Below is a snippet of the payload portion of a ZTDF's manifest.

    "payload": {
        "type": "reference",
        "url": "0.payload",
        "protocol": "zip",
        "isEncrypted": true,
        "mimeType": "text/plain",
        "tdf_spec_version": "1.0.0" // Made up version as this isn't implemented yet
    }

Option 1 - Separate version fields.

Use a separate field for vendor specific versioning.

    "payload": {
        "type": "reference",
        "url": "0.payload",
        "protocol": "zip",
        "isEncrypted": true,
        "mimeType": "text/plain",
        "tdf_spec_version": "1.0.0", // Made up version as this isn't implemented yet
        "vendor_version": "0.2.1"
    }

Advantages

  • Clear separation of concerns
  • Independent versioning lifecycles
  • Full semver support for both versions
  • Simple version comparison logic
  • Explicit and self-documenting
  • Easy to add additional version fields if needed

Disadvantages

  • Requires an update to ZTDF spec
  • Slightly more complex version handling code
  • Requires coordination between version fields for compatibility

Option 2 - Leverage semver build metadata

    "payload": {
        "type": "reference",
        "url": "0.payload",
        "protocol": "zip",
        "isEncrypted": true,
        "mimeType": "text/plain",
        "tdf_spec_version": "1.0.0+p1.2" // Made up version as this isn't implemented yet
    }

Advantages

  • Doesn't require spec update
  • Single version field
  • Fully compliant with semver specification
  • Build metadata doesn't affect version precedence
  • Compact representation
  • Easy to parse base version

Disadvantages

  • Less explicit than separate fields
  • Limited vendor version format (no dots in build metadata)

Recommended approach - Option 2

Using build metadata allows for sufficient versioning information, while not requiring an update to the existing specification. The base OpenTDF platform will will be able to function properly even if vendor specific code adds build metadata by ignoring it.

@jrschumacher
Copy link
Member

I agree with Option 2.

@jrschumacher jrschumacher added the adr Architecture Decision Records pertaining to OpenTDF label Oct 23, 2024
@damorris25
Copy link
Member

Agreed - option 2 is flexible and aligned to existing version standards.

@cassandrabailey293
Copy link
Contributor

this is an additional requirement that we are adding as part of this ADR - discussed 11/12
opentdf/spec#52

this will bubble up the version to the root rather than on various policy objects within the tdf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adr Architecture Decision Records pertaining to OpenTDF
Projects
None yet
Development

No branches or pull requests

4 participants