| changeset | f80c566f5726 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | feat: improve store_trace_reason with extract parameter store_trace_reason() used embedded code to extract reason based on the location passed to the function. This change adds support for extract keyword that is a Python expression eval'ed when the underlying function/method is called. All callers now set the extract parameter. The prior embedded code has been removed from store_trace_reason(). Failure to eval the expression results in an roundup.logcontext error severity log. Also updated docs. Also replaced env['REQUEST_URI'] with env['PATH_INFO'] for web based entry points as REQUEST_URI isn't documented as a required key and some other front end (e.g. zope, cgi) might not supply this. |
| files |
| changeset | b09ef85f0da6 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | feat: add nanoid pkg trace_id gen and decorator for setting processName nanoid is a shorter unique id generator and faster than uuid. I truncate nanoid id's to 12 chars to make it more readable. Also added decorator to allow setting the default processName definition in the logging module. admin.py and wsgi_handler now set processName. configuration.py knows how to overide the processName if set to the default MainProcess. Updated install docs to add nanoid as optional, how to switch to different trace_id output. pydoc generated docs include logcontext module and are referenced from admin.py. |
| files |
| changeset | 617d55f1d518 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | refactor: replace boolean expr with named function call Replace a confusing boolean expression with a the use_cached_tracker() method call. |
| files |
| changeset | 14c7c07b32d8 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | feature: add thread local trace_id and trace_reason to logging. Added trace_id to default logging so that all logs for a given request share the same trace_id. This allows correlation of logs across a request. admin_guide.txt, upgrading.txt: add docs update sample configs to include trace_id. rewrite logging docs in admin_guide. Hopefully they are clearer now. clean up some stuff in the logging config file docs. admin.py: add decorators to run_command to enable trace_id. change calls to db.commit() to use run_command to get trace_id. configuration.py: clean up imports. update docstrings, comments and inline docs. add trace_id to default log format. add function for testing decorated with trace_id. add support for dumping stack trace in logging. add check for pytest in sys.modules to enable log propagation when pytest is running. Otherwise tests fail as the caplog logger doesn't see the roundup logs. logcontext.py: new file to handle thread local contextvar mangement. mailgw.py: add decorators for trace_id etc. scripts/roundup_xlmrpc_server.py: add decorators for trace_id etc. fix encoding bug turning bytes into a string. fix command line issue where we can't set encoding. (not sure if changing encoding via command line even works) cgi/client.py decorate two entry points for trace_id etc. cgi/wsgi_handler.py: decorate entry point for trace_id etc. test/test_config.py: add test for trace_id in new log format. test various cases for sinfo and errors in formating msg. |
| files |
| changeset | dbeb6bf056c7 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | chore(lint): _ unused var; replace assert wth if/raise; whitespace |
| files |
| changeset | da4c51effdfd |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | chore(lint): fix imports, normalize trailing , on list/tuple |
| files |
| changeset | 0fe2b9f6e19f |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | issue2551212 - enable wsgi cache_tracker by default Switch the code so the wsgi cache_tracker optimization is enabled by default. Leave the unoptimized/uncached code path available in case it breaks something. The feature flag can be set to False to disable caching. Updated tests to test the disabled (non-cache) code path. Updated upgrading.txt with info on how to disable caching. |
| files |
| changeset | 273c8c2b5042 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | fix(api): - issue2551063 - Rest/Xmlrpc interfaces needs failed login protection. Failed API login rate limiting with expiring lockout added. |
| files |
| changeset | 07ce4e4110f5 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | flake8 fixes: whitespace, remove unused imports |
| files |
| changeset | d32d43e4a5ba |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | wsgi can cache tracker instance enabled by feature flag. Patch by Marcus Priesch caches a loaded tracker instance and reuse it for future client sessions. It is enabled by a feature flag in wsgi.py since it arrived during the 2.2.0 beta period. The provided wsgi.py is modified to enable it. Testing is run with flag enabled and disabled. Ralf Schlatterbeck and Marcus tested it on one of their larger more complex trackers and it sped up the response time to a client request by a factor of 3 (270ms down to about 80-85ms). |
| files |
| changeset | 0da655d1498d |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Remove Connection: close header for 501 error handling rest Ralf doesn't know why the "Connection: close" header was added. Was there since the original code to support OPTIONS verb was added. He agrees it can be removed. Enable test for that code path. Commit the code not just the test.... |
| files |
| changeset | 0343b6fea4b9 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Ralf Schlatterbeck <rsc@runtux.com> |
| description | Factor preloading into a preload method |
| files |
| changeset | 979cecdb70f8 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Ralf Schlatterbeck <rsc@runtux.com> |
| description | Pre-load imports and templates for wsgi This triggers preloading once in __init__ doing essentially the same thing as in __call__. This avoids burdening the first request with the startup cost. Fixes issue2551112. Thanks to Robert Klonner for the patch. |
| files |
| changeset | 3cba8949bfe0 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Christof Meerwald <cmeerw@cmeerw.org> |
| description | reworked WSGI interface to not use the RequestDispatcher class for two different purposes (but have a separate RequestHandler) |
| files |
| changeset | f74d078cfd9a |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Christof Meerwald <cmeerw@cmeerw.org> |
| description | issue2551019 needs to be handled in the action code itself, not the WSGI handler for Python 3 we always need to encode the output in the client character set |
| files |
| changeset | 274c2c082f68 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Christof Meerwald <cmeerw@cmeerw.org> |
| description | factor out get_tracker so we can potentially customise if we want to reuse tracker instances or create a new instance for each request |
| files |
| changeset | 82816000aef3 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Flake8 whitespace changes, removal of unused import cgi. |
| files |
| changeset | 40f5b20d1e70 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | issue2551047: Fix crashes in DELETE, OPTIONS, PATCH The wsgi handler parses the form data. This is a partial patch that fixes some crashes and allows OPTIONS to be passed through the system. Before it was rejected with a 501 error. Other modes (cgi, roundup-server) use the code in the __init__method of the Client class in client.py to parse the input form. The Client code has been modified to parse and pass json input data. I think these changes have to be included in the wsgi handler as well. |
| files |
| changeset | 883c9e90b403 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Fix problem with cgi.escape being depricated a different way. This way uses anypy and is cleaner. Also fixes incorrect/incomplete change that resulted in escaped in TAL generated by TALInterpreter.py. The escaped quotes break javascript etc. defined using tal string: values. TODO: add test cases for TAL. This wouldn't have snuck through for a month if we had good coverage of that library. |
| files |
| changeset | edd9e2c67785 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Ralf Schlatterbeck <rsc@runtux.com> |
| description | Make REST-API updates work with WSGI Now the Content-Type header is handled specially, it doesn't have a HTTP_ prefix in WSGI. Also make some form lookups more robust in rest. |
| files |
| changeset | e7b30ab60941 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Ralf Schlatterbeck <rsc@runtux.com> |
| description | Fix REST API for WSGI Add dictionary-like headers attribute. Similar to the apache implementation in same directory but we look up the given header in the wsgi environment. Environment entries are mangled (all uppercase, '-' replaced with '_', prefix HTTP_). So on lookup we mangle the given name first. This allows the rest implementation (and others) to look up headers. |
| files |
| changeset | 1a835db41674 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Call cgi.escape only on python 2. Replace with html.escapeif it can be found. |
| files |
| changeset | ab37c1705dbf |
|---|---|
| branch | maint-1.6 |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Fix fix XSS issue in wsgi and cgi when handing url not found/404. issue2551035 |
| files |
| changeset | 5579fa034f9e |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | John Rouillard <rouilj@ieee.org> |
| description | Fix fix XSS issue in wsgi and cgi when handing url not found/404. issue2551035 |
| files |
| changeset | dccf9b7e5ee4 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Tom Ekberg <tekberg@uw.edu> |
| description | Fix CSV export with WSGI and Python 3 (issue2551019). |
| files |
| changeset | 3a07c57d72bb |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Joseph Myers <jsm@polyomino.org.uk> |
| description | Handle string-to-bytes conversions for Python 3 for wsgi_handler. |
| files |
| changeset | 277e91bf7936 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Joseph Myers <jsm@polyomino.org.uk> |
| description | Python 3 preparation: update BaseHTTPServer imports. roundup/anypy/http_.py extended and used in more places. Manual patch. |
| files |
| changeset | 35ea9b1efc14 |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Joseph Myers <jsm@polyomino.org.uk> |
| description | Python 3 preparation: "raise" syntax. Changing "raise Exception, value" to "raise Exception(value)". Tool-assisted patch. Particular cases to check carefully are the one place in frontends/ZRoundup/ZRoundup.py where a string exception needed to be fixed, and the one in roundup/cgi/client.py involving raising an exception with a traceback (requires three-argument form of raise in Python 2, which as I understand it requires exec() to avoid a Python 3 syntax error). |
| files |
| changeset | 92757447dcf0 |
|---|---|
| branch | routing |
| bookmark | |
| tag | |
| user | anatoly techtonik <techtonik@gmail.com> |
| description | Remove PATH_INFO hacks that strip leading slash PATH_INFO should always start with '/' when not empty, see http://tools.ietf.org/html/rfc3875#section-4.1.5 Instead, do leading slash stripping inside cgi.client |
| files |
| changeset | 7aa72c31464d |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Richard Jones <richard@users.sourceforge.net> |
| description | Fix WSGI response code (thanks Peter Pöml) |
| files |
| changeset | 859ab007829f |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
| description | Handle OPTIONS http request method in wsgi handler, fixes issue2550587. Thanks to Thomas Arendsen Hein for reporting and to Intevation for funding the fix. |
| files |
| changeset | 0728808fdf5c |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Richard Jones <richard@users.sourceforge.net> |
| description | make WSGI threadsafe |
| files |
| changeset | a2d22d0de0bc |
|---|---|
| branch | |
| bookmark | |
| tag | |
| user | Richard Jones <richard@users.sourceforge.net> |
| description | WSGI support via roundup.cgi.wsgi_handler |
| files |