You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3f06adf
Browse filesBrowse the repository at this point in the historyBrowse files
feat: Add in-memory signing API returning the Sigstore bundle as bytes
The library only exposed `Config.sign(model_path, signature_path)`, which
forces signing output to a filesystem path. Serverless functions, CI steps,
and streaming pipelines often run on read-only or ephemeral filesystems and
need the Sigstore bundle in memory, leaving a write-read-delete temp-file
workaround as the only option.
Add an abstract `Signature.to_bytes()` and implement it on both Sigstore
signature types as the UTF-8 encoded bundle JSON, then route `write()`
through it so the on-disk and in-memory artifacts share a single
serialization path. Expose `Config.sign_to_bytes()` and a module-level
`sign_to_bytes()` helper that mirror the existing `sign()` API. The hash,
payload, and sign sequence is factored into a private `_sign()` helper
reused by both output modes; `sign()` is behaviorally unchanged. Document
the new API in the README and add a CHANGELOG entry.
Add a key-based API test asserting the returned bytes are a valid Sigstore
bundle whose signed payload matches what `sign()` writes to disk, and that
the bytes survive the real verification path: the bundle is persisted
unmodified and verified with the elliptic-key verifier, so the test fails
if `to_bytes()` ever emits something that is well-formed but not
cryptographically valid.
Part of: #582
Signed-off-by: Devam Shah <devamshah91@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ All versions prior to 1.0.0 are untracked.
12
12
### Added
13
13
- Added the `digest` subcommand to compute and print a model's digest. This enables other tools to easily pair the attestations with a model directory.
14
14
- Added `--module-paths` option to PKCS #11 signing methods pkcs11-key and pkcs11-certificate.
15
+
- Added `model_signing.signing.Config.sign_to_bytes()` (and a module-level `model_signing.signing.sign_to_bytes()` helper) that return the Sigstore bundle in memory as bytes instead of writing it to disk. This supports serverless and pipeline callers that need to stream or store the signature without filesystem access. ([#582](https://github.com/sigstore/model-transparency/issues/582))
15
16
16
17
### Changed
17
18
- Standardized CLI flags to use hyphens (e.g., `--trust-config` instead of `--trust_config`). Underscore variants are still accepted for backwards compatibility via token normalization.
0 commit comments