diff options
author | Jessica Tallon <jessica@megworld.co.uk> | 2014-12-08 13:44:33 +0000 |
---|---|---|
committer | Jessica Tallon <jessica@megworld.co.uk> | 2014-12-08 13:44:33 +0000 |
commit | a5c09c50c06b271ab4bba23a90153183430622ef (patch) | |
tree | 404443437023a6c9bd16291256ba62ef36a31543 | |
parent | 8d8fdfd1b828d83292e17a98670227834d533f35 (diff) | |
download | mediagoblin-a5c09c50c06b271ab4bba23a90153183430622ef.tar.lz mediagoblin-a5c09c50c06b271ab4bba23a90153183430622ef.tar.xz mediagoblin-a5c09c50c06b271ab4bba23a90153183430622ef.zip |
Fix OAuth length problems in clients by removing that constraint
-rw-r--r-- | mediagoblin/oauth/oauth.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mediagoblin/oauth/oauth.py b/mediagoblin/oauth/oauth.py index 100dc8eb..c7951734 100644 --- a/mediagoblin/oauth/oauth.py +++ b/mediagoblin/oauth/oauth.py @@ -28,9 +28,17 @@ class GMGRequestValidator(RequestValidator): self.POST = data super(GMGRequestValidator, self).__init__(*args, **kwargs) - @property - def nonce_length(self): - return 5, 30 + def check_nonce(self, nonce): + """ + This checks that the nonce given is a valid nonce + + RequestValidator.check_nonce checks that it's between a maximum and + minimum length which, not only does pump.io not do this from what + I can see but there is nothing in rfc5849 which suggests a maximum or + minium length should be required so I'm removing that check + """ + # Check the nonce only contains a subset of the safe characters. + return set(nonce) <= self.safe_characters def save_request_token(self, token, request): """ Saves request token in db """ |