1) Pushers are now associated with an access token

2) Change places where we mean unauthenticated to 401, not 403, in C/S v2: hack so it stays as 403 in v1 because web client relies on it.
This commit is contained in:
David Baker 2015-03-24 17:24:15 +00:00
parent d19e79ecc9
commit c7023f2155
8 changed files with 48 additions and 26 deletions

View file

@ -57,7 +57,7 @@ class PusherPool:
self._start_pushers(pushers)
@defer.inlineCallbacks
def add_pusher(self, user_name, profile_tag, kind, app_id,
def add_pusher(self, user_name, access_token, profile_tag, kind, app_id,
app_display_name, device_display_name, pushkey, lang, data):
# we try to create the pusher just to validate the config: it
# will then get pulled out of the database,
@ -79,17 +79,18 @@ class PusherPool:
"failing_since": None
})
yield self._add_pusher_to_store(
user_name, profile_tag, kind, app_id,
user_name, access_token, profile_tag, kind, app_id,
app_display_name, device_display_name,
pushkey, lang, data
)
@defer.inlineCallbacks
def _add_pusher_to_store(self, user_name, profile_tag, kind, app_id,
app_display_name, device_display_name,
def _add_pusher_to_store(self, user_name, access_token, profile_tag, kind,
app_id, app_display_name, device_display_name,
pushkey, lang, data):
yield self.store.add_pusher(
user_name=user_name,
access_token=access_token,
profile_tag=profile_tag,
kind=kind,
app_id=app_id,