protocol: update JSON output with structured Signature type#15009
Conversation
1b3da8c to
c6c44e9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
651a1a8 to
9460f53
Compare
9460f53 to
6645345
Compare
56a7aff to
39ab321
Compare
c8b760e to
030c419
Compare
030c419 to
4e61d65
Compare
097c8b3 to
3d71485
Compare
3d71485 to
05215e1
Compare
05215e1 to
c349957
Compare
Signature typeSignature type
|
|
||
| source common.sh | ||
|
|
||
| requireDaemonNewerThan "2.34pre20260122" |
There was a problem hiding this comment.
Currently the daemon format just uses the latest JSON for which is bad, but I don't think it is worth fixing because we have some more serious Realisation/Build Trace JSON format changes right around the corner, after which there will be a harder compat break for this unstable feature, and I also took that opportunity to make it stop using JSON so we won't have this versioning issue again.
There was a problem hiding this comment.
We should be able to delete this now!
| j = { | ||
| {"keyName", s.keyName}, | ||
| {"sig", base64::encode(std::as_bytes(std::span<const char>{s.sig}))}, | ||
| }; |
There was a problem hiding this comment.
I'm not sure what this gets us in terms of immediate benefits? The signature itself is still a binary blob that's supposed to be ed25519.
There was a problem hiding this comment.
- It is used in
nix path-info, but that is already versioned - It is used in realisations, but those are going to be subject to breaking changes anyways. We have back compat in the reading direction (just not writing direction) too.
| keyName: | ||
| type: string | ||
| title: Key Name | ||
| description: The name of the key used to produce this signature | ||
| sig: | ||
| type: string | ||
| title: Signature Data | ||
| description: The raw signature bytes, Base64-encoded |
c349957 to
4888aff
Compare
5640ebf to
ac6060f
Compare
There was a problem hiding this comment.
- Version 1: Original format
- Version 2:
- Remove `dependentRealisations`
- Version 3:
- Use `drvPath` not `drvHash` to refer to derivation in a more conventional way.
- Separate into `key` and `value`
- Use 2nd version of signatures format (objects, not strings)
We should have this in the version history, and this should be named to `v3 accordingly.
d5e7d61 to
75b6a24
Compare
This commit updates the JSON output with a Signature type containing keyName and sig fields. JSON parsing accepts both formats for backwards compatibility. Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
Ericson2314
left a comment
There was a problem hiding this comment.
The concern with this was that we were churning the formats, but now that we are changing realisations in a breaking way anyways (drv hash -> drv path) there is essentially no marginal cost of doing this
protocol: update JSON output with structured `Signature` type
Motivation
Previously, signatures were raw strings (in the format of
keyName:base64sig) in JSON outputs. A properSignaturetype in the JSON can improve this output by mimicking the innerSignaturetype used in the codebase.Context
The JSON output uses a structured
{keyName, sig}objects for Realisation and PathInfo V3. Additionally, V1 & V2 keeps the string format for backwards compatibility, and parsing accepts both formats.The new JSON schemas introduced in this PR are
signature-v1.yamlfor the Signature type itself andstore-object-info-v3.yamlfor PathInfo with structured signatures.Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.