Merge "Impose a min and a max on time values in CONF.token"

This commit is contained in:
Jenkins 2016-08-30 15:01:18 +00:00 committed by Gerrit Code Review
commit db5b76cbf7

View File

@ -11,6 +11,7 @@
# under the License. # under the License.
import hashlib import hashlib
import sys
from oslo_config import cfg from oslo_config import cfg
@ -46,6 +47,8 @@ binding metadata be supported by keystone.
expiration = cfg.IntOpt( expiration = cfg.IntOpt(
'expiration', 'expiration',
default=3600, default=3600,
min=0,
max=sys.maxsize,
help=utils.fmt(""" help=utils.fmt("""
The amount of time that a token should remain valid (in seconds). Drastically The amount of time that a token should remain valid (in seconds). Drastically
reducing this value may break "long-running" operations that involve multiple reducing this value may break "long-running" operations that involve multiple
@ -96,6 +99,8 @@ unless global caching is enabled.
cache_time = cfg.IntOpt( cache_time = cfg.IntOpt(
'cache_time', 'cache_time',
min=0,
max=sys.maxsize,
help=utils.fmt(""" help=utils.fmt("""
The number of seconds to cache token creation and validation data. This has no The number of seconds to cache token creation and validation data. This has no
effect unless both global and `[token] caching` are enabled. effect unless both global and `[token] caching` are enabled.