Changeset View
Changeset View
Standalone View
Standalone View
swh/web/config.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | DEFAULT_CONFIG = { | ||||
'debug': ('bool', False), | 'debug': ('bool', False), | ||||
'serve_assets': ('bool', False), | 'serve_assets': ('bool', False), | ||||
'host': ('string', '127.0.0.1'), | 'host': ('string', '127.0.0.1'), | ||||
'port': ('int', 5004), | 'port': ('int', 5004), | ||||
'secret_key': ('string', 'development key'), | 'secret_key': ('string', 'development key'), | ||||
# do not display code highlighting for content > 1MB | # do not display code highlighting for content > 1MB | ||||
'content_display_max_size': ('int', 5 * 1024 * 1024), | 'content_display_max_size': ('int', 5 * 1024 * 1024), | ||||
'snapshot_content_max_size': ('int', 1000), | 'snapshot_content_max_size': ('int', 1000), | ||||
'pids_max_size': ('int', 1), | |||||
vlorentz: You don't need to make this configurable; most API endpoints aren't. (eg. look for `limit` in… | |||||
DanSerafAuthorUnsubmitted Not Done Inline ActionsSo, should i limit the request directly inside the endpoint? DanSeraf: So, should i limit the request directly inside the endpoint? | |||||
anlambertUnsubmitted Not Done Inline ActionsAdding this in configuration is not a shocker to me. pids_list_max_size is also more explicit. anlambert: Adding this in configuration is not a shocker to me.
`pids_list_max_size` is also more… | |||||
vlorentzUnsubmitted Not Done Inline ActionsYes, like you already do, it just doesn't need a config value vlorentz: Yes, like you already do, it just doesn't need a config value | |||||
DanSerafAuthorUnsubmitted Not Done Inline ActionsIt would be hard to test without a config value, i can't get the limit from the endpoint DanSeraf: It would be hard to test without a config value, i can't get the limit from the endpoint | |||||
vlorentzUnsubmitted Not Done Inline ActionsAlright. But use a reasonable default value then (eg. 1000 or 10000) vlorentz: Alright. But use a reasonable default value then (eg. 1000 or 10000) | |||||
zackUnsubmitted Not Done Inline Actions
well, this isn't great, they should be configurable :-) (but ack, I agree it is pointless to diverge and make only one of them configurable at this point) making all endpoints configurable might be a good easy hack task to file zack: > You don't need to make this configurable; most API endpoints aren't.
well, this isn't great… | |||||
'throttling': ('dict', { | 'throttling': ('dict', { | ||||
'cache_uri': None, # production: memcached as cache (127.0.0.1:11211) | 'cache_uri': None, # production: memcached as cache (127.0.0.1:11211) | ||||
# development: in-memory cache so None | # development: in-memory cache so None | ||||
'scopes': { | 'scopes': { | ||||
'swh_api': { | 'swh_api': { | ||||
'limiter_rate': { | 'limiter_rate': { | ||||
'default': '120/h' | 'default': '120/h' | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines |
You don't need to make this configurable; most API endpoints aren't. (eg. look for limit in swh/web/api/views/origin.py)