zaqar/marconi/common/exceptions.py
kgriffs fa487de15e fix(wsgi): Non-ASCII characters in the queue name trigger 500 status
The problem was that queue_name wasn't being validated before being
used to construct log messages. Also, I found that the regex used to
validate queue names was not reliable and needed to be rewritten.

Upon further investigation, I also discovered that the queue name
wasn't being validated for all routes that included it. This was
also fixed. Validating all input is a basic best practice re
application security.

Along the way, I edited the validation error messages for clarity,
and relocated the ValidationFailed exception since it is only used
by the transport driver.

Change-Id: Idf9f6c7b9a88865a6396dfcd72abbce96c774490
Closes-Bug: 1208873
2013-10-03 12:06:45 -05:00

23 lines
762 B
Python

# Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class InvalidDriver(Exception):
"""A driver was not found or loaded."""
class PatternNotFound(Exception):
"""A string did not match the expected pattern or regex."""