-
Notifications
You must be signed in to change notification settings - Fork 29
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
Can KindVersion be an enum? #52
Comments
Agreed, enums are definitely preferred over strings, less need for validation |
Yes, they are meant to be populated directly from the response from Rekor. And primarily used when e.g. verifying the SET from Rekor (which requires them to be exactly the same as returned from Rekor). Beyond that, the kind is what drives the interpretation of the Rekor entry, exactly like it is today with the responses from Rekor. If the bundle switches to an enum, we would need to keep the bundle format in sync whenever a new type (kind) is added to Rekor, which I think may be creating an artificial coupling that can make it hard to keep up. Also enums in protobuf are represented as strings with uppercase letters, which would also make the value different from what any Rekor client expects. So any client must maintain a mapping table from the enum value to the Rekor value, or we bake this logic in to Rekor. But that would be even worse. My suggestion is to leave it as-is, and clarify the documentation that this is intended to be an (for the bundle) opaque value from Rekor, to use when interacting with a Rekor client. |
When Rekor gets an updated protobuf API, I think it would be good to use the same enum for both the bundle and the Rekor response type. But before that my feeling is that this will just cause issues for any client trying to work with the bundle. |
Another concern here is that we want people to be able to fork Rekor and add new types. This might require some extra thinking for how this will work generally. |
Without thinking too much, let's assume the bundle continues to use a (opaque) string: With that said, clients must of course still know how to work with the custom Rekor type(s), but putting that restriction to the bundle format it self, feels a bit too restrictive/unflexible. |
Makes sense, but to clarify this a bit more?
edit: I'm okay punting on this discussion for 0.1.0 though, things seem to work fine |
Agreed in principle, but in practice I care a little less about that.
IMO: ideally you could add pluggable types to Rekor using configuration only, so it wouldn't imply that you had actually forked Rekor (my last comment was sloppy). So no, the hope would be for the protobuf-spec to be "future compatible" in this way.
Yeah that's possible I think. I could be convinced to do that. One consideration: we might want to enable non-JSON formats. (We can always wrap the non-JSON format in a JSON wrapper |
Some more background on this. The initial idea was (still is) to not capture the canonicalized body. It was added quite recently as in the general case, it's not possible to deterministically recreate the canonicalized body, so it was added to the bundle. There is an initiative in Rekor to change how the SET (Signed Entry Timestamp) is calcualted, so it can be deterministic. When that is in place, the canoncialized body should be removed from the bundle. So yes, today the kind is duplicated, but in the long run it should not. |
It's not super clear in the proto itself what this type should be. The docs simply link to rekor.
https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_rekor.proto#L29
Are they case sensitive? Is it up to the consumer to verify validity? I would like to propose that this should be more concrete, especially if/when rekor were to adopt this for on the wire transmissions.
Was the reasoning that these currently map to existing fields in rekor entries?
The text was updated successfully, but these errors were encountered: