File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import absolute_import
2
+ from __future__ import unicode_literals
3
+
1
4
from oauthlib .common import generate_client_id as oauthlib_generate_client_id
5
+ from oauthlib .common import UNICODE_ASCII_CHARACTER_SET
2
6
3
7
from .settings import oauth2_settings
4
8
5
9
6
- CLIENT_ID_CHARACTER_SET = r'_-.:;=?!@0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
7
-
8
-
9
10
class BaseHashGenerator (object ):
10
11
"""
11
12
All generators should extend this class overriding `.hash()` method.
@@ -20,13 +21,13 @@ def hash(self):
20
21
Generate a client_id without colon char as in http://tools.ietf.org/html/rfc2617#section-2
21
22
for Basic Authentication scheme
22
23
"""
23
- client_id_charset = CLIENT_ID_CHARACTER_SET .replace (":" , "" )
24
- return oauthlib_generate_client_id (length = 40 , chars = client_id_charset )
24
+ return oauthlib_generate_client_id (length = 40 , chars = UNICODE_ASCII_CHARACTER_SET )
25
25
26
26
27
27
class ClientSecretGenerator (BaseHashGenerator ):
28
28
def hash (self ):
29
- return oauthlib_generate_client_id (length = oauth2_settings .CLIENT_SECRET_GENERATOR_LENGTH , chars = CLIENT_ID_CHARACTER_SET )
29
+ return oauthlib_generate_client_id (length = oauth2_settings .CLIENT_SECRET_GENERATOR_LENGTH ,
30
+ chars = UNICODE_ASCII_CHARACTER_SET )
30
31
31
32
32
33
def generate_client_id ():
You can’t perform that action at this time.
0 commit comments