jku / repository-playground

Community artifact repository workflow experiments
Other
7 stars 4 forks source link

signer: During close, lookup correct root keys #104

Closed jku closed 1 year ago

jku commented 1 year ago

root is a special case since the signing keys are stored in root itself: we should be using both new and old keys in that case

The final PR ended up changing the signing and closing:

Comment below lists some advantages of this.

Fixes #103

Issues:

jku commented 1 year ago

Still thinking about the cleanest implementation here. There are three possible sources of keys:

  1. the keys in un-saved metadata we are signing
  2. the keys defined in current signing event
  3. the keys defined in known-good metadata (i.e. main branch)

The interesting thing is that

Case 1 would merge to case 2 if we did not do automated signing in close and instead required explicit signing. This seems to make more and more sense

jku commented 1 year ago

I have rewritten this PR:

This still requires keeping track of the different key sets but has some nice side effects:

I've filed a new issue for the extra test

jku commented 1 year ago

An alternative to tracking the "unsigned" state while doing the metadata modifications would be to not do that and instead run _user_signature_needed() just before signing... this would likely be the simplest result but I think I'll leave that for future refactoring (since that means SignerRepository state tracking changes)