cubicweb-mercurial-server #2529187 Implement keys synchronization [validation pending]

We want to keep the hgadmin/keys repository in sync with the MercurialServerAccessKey entities.

To do so we introduce 2 hooks scheduling the same operation SynchonizeAccessKeyOperation, which uses the DataMixIn. The data passed is composed of :

  • the EID of the MercurialServerConfig
  • the EID of the MercurialServerAccessKey
  • the type of the operation : 'create', 'update', 'delete'

The first hook is on update of the AccessKey entity, the second one is after addition and before removal of the access_key relation.

The operation should :

  • for each MercurialServerConfig :
    1. clone the hgadmin/keys repo
    2. iterate over all keys for the config
      • build the filename of the key
      • if the operation is add or update : write the pubkey attribute to the file
      • if the operation is add : do hg add
      • if the operation is delete : do hg rm
    3. Commit and push all that with a commit message built from the CW transaction information
done in0.1.0
load left0.000
closed by#de60b8466818 [hooks] closes #2529187 - Synchronize access keys.