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