Subscribe to updates for newly created users
authorMagnus Hagander <magnus@hagander.net>
Mon, 7 Mar 2022 20:40:32 +0000 (21:40 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 7 Mar 2022 20:40:32 +0000 (21:40 +0100)
commit21bacb789bead4b35eb8473924be1ec392764d58
tree3cdcc96743bd2c30d92aeede23500a8e13e30bfc
parent191ed788ced03933c60b1f35c6c205af027ff807
Subscribe to updates for newly created users

When a user was created by import, such as when a permission was granted
before their first login, the main community auth system would not know
about this registration, and because of that it would not send any
updates about the user such as secondary email addresses or ssh keys.
This would result in the user ssh key not being present and the user
unable to work with the repositories until they first logged in and ten
removed and re-added their key. Not very friendly, so use the newly
created endpoint on pgweb to subscribe to the notifications as soon as
the user has been created.

Also call this endpoint after the user has manually logged in the very
first time (meaning the user entry is created), to trigger an immediate
replication of any *existing* ssh key on the pgweb system. This is
required since the ssh key is not part of the "login package" due to
being potentially too long to fit on an URL.
gitadmin/gitadmin/auth.py