Fix OAuth length problems in clients by removing that constraint
authorJessica Tallon <jessica@megworld.co.uk>
Mon, 8 Dec 2014 13:44:33 +0000 (13:44 +0000)
committerJessica Tallon <jessica@megworld.co.uk>
Mon, 8 Dec 2014 13:44:33 +0000 (13:44 +0000)
mediagoblin/oauth/oauth.py

index 100dc8eb642c7ab69dd720de48883b4cac1bcd80..c7951734c9fb39916d117e748f3adba8df23ca76 100644 (file)
@@ -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 """