Implement synchronization for community authentication
authorMagnus Hagander <magnus@hagander.net>
Sat, 8 Aug 2020 15:03:17 +0000 (17:03 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 11 Aug 2020 09:33:46 +0000 (11:33 +0200)
commitc1fb5de08019a28b84047fefb2e916bee5173f26
tree8e49bc8b5dcc3e8cb6eed97e7083632ee30056c7
parentd969bd33d869a7772db0e263b6f44a6947155416
Implement synchronization for community authentication

This adds the concept of an apiurl to each site that uses community
authentication, that the main website server can make calls to and send
updates. This URL will receive POSTs from the main website when a user
account that has been used on this site gets updated, and can then
optionally update it's local entries with it (the django plugin sample
is updated to handle this fully).

Updates are only sent for users that have a history of having logged
into the specific site -- this way we avoid braodcasting user
information to sites requiring specific constent that the user hasn't
given, and also decreases the amount of updates that have to be sent.

Updates are queued by the system in a table and using listen/notify a
daemon that's running picks up what needs to be updated and posts it to
the endpoints. If this daemon is not running, obviously nothing gets
sent.

Updates are tracked using triggers in the database which push
information into this queue.
pgweb/account/admin.py
pgweb/account/migrations/0006_communityauth_sync.py [new file with mode: 0644]
pgweb/account/models.py
tools/auth_changetrack/auth_changetrack.py [new file with mode: 0755]
tools/auth_changetrack/nagios_check.py [new file with mode: 0755]
tools/communityauth/sample/django/auth.py
tools/communityauth/sample/pushreceiver/.gitignore [new file with mode: 0644]
tools/communityauth/sample/pushreceiver/cauth_push_receiver.ini.sample [new file with mode: 0644]
tools/communityauth/sample/pushreceiver/cauth_push_receiver.py [new file with mode: 0755]
tools/communityauth/sample/pushreceiver/plugins/__init__.py [new file with mode: 0644]