Allow rate limiting to be disabled via flag
* fixes bug 947776 Change-Id: I892394ead2d1921ac8390e54312c5229929042f5
This commit is contained in:
@@ -95,12 +95,14 @@ use = call:nova.api.auth:pipeline_factory
|
|||||||
noauth = faultwrap noauth ratelimit osapi_compute_app_v2
|
noauth = faultwrap noauth ratelimit osapi_compute_app_v2
|
||||||
deprecated = faultwrap auth ratelimit osapi_compute_app_v2
|
deprecated = faultwrap auth ratelimit osapi_compute_app_v2
|
||||||
keystone = faultwrap authtoken keystonecontext ratelimit osapi_compute_app_v2
|
keystone = faultwrap authtoken keystonecontext ratelimit osapi_compute_app_v2
|
||||||
|
keystone_nolimit = faultwrap authtoken keystonecontext osapi_compute_app_v2
|
||||||
|
|
||||||
[composite:openstack_volume_api_v1]
|
[composite:openstack_volume_api_v1]
|
||||||
use = call:nova.api.auth:pipeline_factory
|
use = call:nova.api.auth:pipeline_factory
|
||||||
noauth = faultwrap noauth ratelimit osapi_volume_app_v1
|
noauth = faultwrap noauth ratelimit osapi_volume_app_v1
|
||||||
deprecated = faultwrap auth ratelimit osapi_volume_app_v1
|
deprecated = faultwrap auth ratelimit osapi_volume_app_v1
|
||||||
keystone = faultwrap authtoken keystonecontext ratelimit osapi_volume_app_v1
|
keystone = faultwrap authtoken keystonecontext ratelimit osapi_volume_app_v1
|
||||||
|
keystone_nolimit = faultwrap authtoken keystonecontext osapi_volume_app_v1
|
||||||
|
|
||||||
[filter:faultwrap]
|
[filter:faultwrap]
|
||||||
paste.filter_factory = nova.api.openstack:FaultWrapper.factory
|
paste.filter_factory = nova.api.openstack:FaultWrapper.factory
|
||||||
|
@@ -10,6 +10,8 @@
|
|||||||
# allow_resize_to_same_host=false
|
# allow_resize_to_same_host=false
|
||||||
###### (StrOpt) File name for the paste.deploy config for nova-api
|
###### (StrOpt) File name for the paste.deploy config for nova-api
|
||||||
# api_paste_config="api-paste.ini"
|
# api_paste_config="api-paste.ini"
|
||||||
|
###### (BoolOpt) whether to rate limit the api
|
||||||
|
# api_rate_limit=true
|
||||||
###### (StrOpt) The strategy to use for auth. Supports noauth, keystone, and deprecated.
|
###### (StrOpt) The strategy to use for auth. Supports noauth, keystone, and deprecated.
|
||||||
# auth_strategy="noauth"
|
# auth_strategy="noauth"
|
||||||
###### (IntOpt) Seconds for auth tokens to linger
|
###### (IntOpt) Seconds for auth tokens to linger
|
||||||
@@ -1103,4 +1105,4 @@
|
|||||||
###### (StrOpt) The ZFS path under which to create zvols for volumes.
|
###### (StrOpt) The ZFS path under which to create zvols for volumes.
|
||||||
# san_zfs_volume_base="rpool/"
|
# san_zfs_volume_base="rpool/"
|
||||||
|
|
||||||
# Total option count: 465
|
# Total option count: 466
|
||||||
|
@@ -40,7 +40,11 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
def pipeline_factory(loader, global_conf, **local_conf):
|
def pipeline_factory(loader, global_conf, **local_conf):
|
||||||
"""A paste pipeline replica that keys off of auth_strategy."""
|
"""A paste pipeline replica that keys off of auth_strategy."""
|
||||||
pipeline = local_conf[FLAGS.auth_strategy].split()
|
pipeline = local_conf[FLAGS.auth_strategy]
|
||||||
|
if not FLAGS.api_rate_limit:
|
||||||
|
limit_name = FLAGS.auth_strategy + '_nolimit'
|
||||||
|
pipeline = local_conf.get(limit_name, pipeline)
|
||||||
|
pipeline = pipeline.split()
|
||||||
filters = [loader.get_filter(n) for n in pipeline[:-1]]
|
filters = [loader.get_filter(n) for n in pipeline[:-1]]
|
||||||
app = loader.get_app(pipeline[-1])
|
app = loader.get_app(pipeline[-1])
|
||||||
filters.reverse()
|
filters.reverse()
|
||||||
|
@@ -220,6 +220,9 @@ global_opts = [
|
|||||||
cfg.BoolOpt('rabbit_durable_queues',
|
cfg.BoolOpt('rabbit_durable_queues',
|
||||||
default=False,
|
default=False,
|
||||||
help='use durable queues in RabbitMQ'),
|
help='use durable queues in RabbitMQ'),
|
||||||
|
cfg.BoolOpt('api_rate_limit',
|
||||||
|
default=True,
|
||||||
|
help='whether to rate limit the api'),
|
||||||
cfg.ListOpt('enabled_apis',
|
cfg.ListOpt('enabled_apis',
|
||||||
default=['ec2', 'osapi_compute', 'osapi_volume', 'metadata'],
|
default=['ec2', 'osapi_compute', 'osapi_volume', 'metadata'],
|
||||||
help='a list of APIs to enable by default'),
|
help='a list of APIs to enable by default'),
|
||||||
|
Reference in New Issue
Block a user