Removed rfc3987 library
The rfc3987 library is licensed under the GPL, and should not be used. Change-Id: I141e1d94c9eb105749346f0471c93bf6a4e9e01c
This commit is contained in:
parent
dffd4f7fdc
commit
17c6c4e1f9
@ -24,6 +24,5 @@ eventlet>=0.13.0
|
||||
stevedore>=1.0.0
|
||||
python-crontab>=1.8.1
|
||||
tzlocal>=1.1.2
|
||||
rfc3987>=1.3.4
|
||||
Jinja2>=2.7.3
|
||||
PyMySQL>=0.6.2
|
||||
|
@ -24,7 +24,6 @@ eventlet>=0.13.0
|
||||
stevedore>=1.0.0
|
||||
python-crontab>=1.8.1
|
||||
tzlocal>=1.1.2
|
||||
rfc3987>=1.3.4
|
||||
email>=4.0.2
|
||||
Jinja2>=2.7.3
|
||||
PyMySQL>=0.6.2
|
||||
|
@ -16,8 +16,8 @@
|
||||
from oslo.config import cfg
|
||||
from oslo_log import log
|
||||
import requests
|
||||
import rfc3987
|
||||
import six
|
||||
from six.moves.urllib.parse import urlparse
|
||||
|
||||
from storyboard.api.auth import ErrorMessages as e_msg
|
||||
from storyboard.api.auth import utils
|
||||
@ -45,9 +45,9 @@ class OpenIdClient(object):
|
||||
# Sanity Check: Redirect URI
|
||||
if not redirect_uri:
|
||||
raise InvalidRequest(message=e_msg.NO_REDIRECT_URI)
|
||||
try:
|
||||
rfc3987.parse(redirect_uri, 'URI')
|
||||
except ValueError:
|
||||
|
||||
parts = urlparse(redirect_uri)
|
||||
if not parts.scheme or not parts.path:
|
||||
raise InvalidRequest(message=e_msg.INVALID_REDIRECT_URI)
|
||||
|
||||
# Sanity Check: response_type
|
||||
|
@ -19,8 +19,9 @@ import functools
|
||||
from pecan import abort
|
||||
from pecan import redirect
|
||||
from pecan import response
|
||||
import rfc3987
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from six.moves.urllib.parse import urlencode
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from six.moves.urllib.parse import urlunparse
|
||||
|
||||
from storyboard.common import exception as exc
|
||||
from storyboard.openstack.common.gettextutils import _ # noqa
|
||||
@ -51,19 +52,20 @@ def oauth_exceptions(func):
|
||||
# If we have a redirect URL, build the error redirect.
|
||||
if o_exc.redirect_uri:
|
||||
# Split the redirect_url apart
|
||||
parts = rfc3987.parse(o_exc.redirect_uri, 'URI')
|
||||
parts = urlparse(o_exc.redirect_uri)
|
||||
|
||||
# Add the error and error_description
|
||||
if parts['query']:
|
||||
params = urlparse.parse_qsl(parts['query'])
|
||||
if parts.query:
|
||||
params = urlparse.parse_qsl(parts.query)
|
||||
else:
|
||||
params = []
|
||||
params.append(('error', error))
|
||||
params.append(('error_description', error_description))
|
||||
|
||||
# Overwrite the old query params and reconstruct the URL
|
||||
parts['query'] = urlparse.urlencode(params)
|
||||
location = rfc3987.compose(**parts)
|
||||
parts_list = list(parts)
|
||||
parts_list[4] = urlencode(params)
|
||||
location = urlunparse(parts_list)
|
||||
|
||||
redirect(location)
|
||||
else:
|
||||
|
@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
from oslo_log import log
|
||||
import rfc3987
|
||||
from six.moves import http_client
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from wsme.exc import ClientSideError
|
||||
|
||||
from storyboard.openstack.common.gettextutils import _ # noqa
|
||||
@ -268,8 +268,8 @@ class OAuthException(ClientSideError):
|
||||
code = http_client.BAD_REQUEST
|
||||
else:
|
||||
try:
|
||||
parts = rfc3987.parse(redirect_uri, 'URI')
|
||||
if parts['scheme'] not in ['http', 'https']:
|
||||
parts = urlparse(redirect_uri)
|
||||
if parts.scheme not in ['http', 'https']:
|
||||
raise ValueError('Invalid scheme')
|
||||
self.redirect_uri = redirect_uri
|
||||
code = http_client.SEE_OTHER
|
||||
|
Loading…
x
Reference in New Issue
Block a user