[PR #11526] server: add signature metadata to manifest format #13569

Open
opened 2026-04-13 00:30:19 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/ollama/ollama/pull/11526

State: open
Merged: No


Problem

Currently, Ollama has no mechanism to store or track signature
information for models. To enable future model integrity
verification, we need a way to associate signature metadata with
model manifests.

Solution

This PR adds an optional SignatureInfo struct to the Manifest format
to prepare for model signature verification capabilities. The change
is designed to be completely backwards compatible with existing
unsigned models.

Changes

Core Changes:

  • Add SignatureInfo struct with fields for signature metadata:
    • Format: signature format version (e.g., "oms-v1.0")
    • SignatureURI: reference to signature file location
    • Verified: boolean indicating verification status
    • Signer: identity of the signer (optional)
    • SignedAt: timestamp when model was signed (optional)
  • Add optional Signature field to Manifest using omitempty JSON tag
    for backwards compatibility

Testing:

No business logic to test yet.

Backwards Compatibility

Fully backwards compatible - existing manifests continue to work
unchanged:

  • Uses json:"signature,omitempty" to exclude field when nil
  • No behavioral changes to existing code paths
  • All existing tests continue to pass

Usage Example

  // Future usage - model with signature
  manifest := &Manifest{
      SchemaVersion: 2,
      MediaType:
  "application/vnd.docker.distribution.manifest.v2+json",
      Config:        layer,
      Layers:        []Layer{modelLayer},
      Signature: &SignatureInfo{
          Format:       "oms-v1.0",
          SignatureURI: "sha256:abc123...",
          Verified:     true,
          Signer:       "signer@example.com",
          SignedAt:     time.Now(),
      },
  }

  // Existing usage - unchanged
  manifest := &Manifest{
      SchemaVersion: 2,
      Config:        layer,
      Layers:        []Layer{modelLayer},
      // No signature field - works exactly as before
  }

Testing

All existing tests pass

go test ./server -run TestManifests -v

Future Work

This struct provides the foundation for upcoming PRs that will add:

  • Signature verification workflows
  • CLI commands for signing/verifying models
  • Integration with model pull/push operations

Draft PR with the full implementation #11573

Files Changed

  • server/manifest.go - Add SignatureInfo struct and optional
    Manifest.Signature field
**Original Pull Request:** https://github.com/ollama/ollama/pull/11526 **State:** open **Merged:** No --- # Problem Currently, Ollama has no mechanism to store or track signature information for models. To enable future model integrity verification, we need a way to associate signature metadata with model manifests. # Solution This PR adds an optional SignatureInfo struct to the Manifest format to prepare for model signature verification capabilities. The change is designed to be completely backwards compatible with existing unsigned models. # Changes ## Core Changes: - Add SignatureInfo struct with fields for signature metadata: - Format: signature format version (e.g., "oms-v1.0") - SignatureURI: reference to signature file location - Verified: boolean indicating verification status - Signer: identity of the signer (optional) - SignedAt: timestamp when model was signed (optional) - Add optional Signature field to Manifest using omitempty JSON tag for backwards compatibility ## Testing: No business logic to test yet. ## Backwards Compatibility ✅ Fully backwards compatible - existing manifests continue to work unchanged: - Uses `json:"signature,omitempty"` to exclude field when nil - No behavioral changes to existing code paths - All existing tests continue to pass ## Usage Example ``` // Future usage - model with signature manifest := &Manifest{ SchemaVersion: 2, MediaType: "application/vnd.docker.distribution.manifest.v2+json", Config: layer, Layers: []Layer{modelLayer}, Signature: &SignatureInfo{ Format: "oms-v1.0", SignatureURI: "sha256:abc123...", Verified: true, Signer: "signer@example.com", SignedAt: time.Now(), }, } // Existing usage - unchanged manifest := &Manifest{ SchemaVersion: 2, Config: layer, Layers: []Layer{modelLayer}, // No signature field - works exactly as before } ``` # Testing ## All existing tests pass `go test ./server -run TestManifests -v` # Future Work This struct provides the foundation for upcoming PRs that will add: - Signature verification workflows - CLI commands for signing/verifying models - Integration with model pull/push operations Draft PR with the full implementation #11573 # Files Changed - `server/manifest.go` - Add SignatureInfo struct and optional Manifest.Signature field
GiteaMirror added the pull-request label 2026-04-13 00:30:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#13569