Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
04268e93
Unverified
Commit
04268e93
authored
6 years ago
by
Marco Ciotola
Browse files
Options
Downloads
Patches
Plain Diff
Use urlparse.parse_qs instead of cgi.parse_qs (deprecated)
parent
6078c1c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
helios_auth/security/oauth.py
+14
-15
14 additions, 15 deletions
helios_auth/security/oauth.py
with
14 additions
and
15 deletions
helios_auth/security/oauth.py
+
14
−
15
View file @
04268e93
...
@@ -6,7 +6,6 @@ Hacked a bit by Ben Adida (ben@adida.net) so that:
...
@@ -6,7 +6,6 @@ Hacked a bit by Ben Adida (ben@adida.net) so that:
- access tokens are looked up with an extra param of consumer
- access tokens are looked up with an extra param of consumer
"""
"""
import
cgi
import
urllib
import
urllib
import
time
import
time
import
random
import
random
...
@@ -76,7 +75,7 @@ class OAuthToken(object):
...
@@ -76,7 +75,7 @@ class OAuthToken(object):
# oauth_token_secret=digg&oauth_token=digg
# oauth_token_secret=digg&oauth_token=digg
@staticmethod
@staticmethod
def
from_string
(
s
):
def
from_string
(
s
):
params
=
cgi
.
parse_qs
(
s
,
keep_blank_values
=
False
)
params
=
urlparse
.
parse_qs
(
s
,
keep_blank_values
=
False
)
key
=
params
[
'
oauth_token
'
][
0
]
key
=
params
[
'
oauth_token
'
][
0
]
secret
=
params
[
'
oauth_token_secret
'
][
0
]
secret
=
params
[
'
oauth_token_secret
'
][
0
]
return
OAuthToken
(
key
,
secret
)
return
OAuthToken
(
key
,
secret
)
...
@@ -270,7 +269,7 @@ class OAuthRequest(object):
...
@@ -270,7 +269,7 @@ class OAuthRequest(object):
# util function: turn url string into parameters, has to do some unescaping
# util function: turn url string into parameters, has to do some unescaping
@staticmethod
@staticmethod
def
_split_url_string
(
param_str
):
def
_split_url_string
(
param_str
):
parameters
=
cgi
.
parse_qs
(
param_str
,
keep_blank_values
=
False
)
parameters
=
urlparse
.
parse_qs
(
param_str
,
keep_blank_values
=
False
)
for
k
,
v
in
parameters
.
iteritems
():
for
k
,
v
in
parameters
.
iteritems
():
parameters
[
k
]
=
urllib
.
unquote
(
v
[
0
])
parameters
[
k
]
=
urllib
.
unquote
(
v
[
0
])
return
parameters
return
parameters
...
@@ -287,7 +286,7 @@ class OAuthServer(object):
...
@@ -287,7 +286,7 @@ class OAuthServer(object):
self
.
signature_methods
=
signature_methods
or
{}
self
.
signature_methods
=
signature_methods
or
{}
def
set_data_store
(
self
,
oauth_data_store
):
def
set_data_store
(
self
,
oauth_data_store
):
self
.
data_store
=
data_store
self
.
data_store
=
oauth_
data_store
def
get_data_store
(
self
):
def
get_data_store
(
self
):
return
self
.
data_store
return
self
.
data_store
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment